pypty.iterative¶
run
¶
Launch an iterative ptychographic reconstruction.
| PARAMETER | DESCRIPTION |
|---|---|
pypty_params
|
Reconstruction parameters dictionary or path to a saved parameters file. Must include
experiment setup and algorithm settings (see
TYPE:
|
Notes
- The function mutates global state, including
obj,probe, andhistory_bfgs. - Parameters can be dynamically varied via lambda functions in
pypty_params. - Checkpoints and logs are saved to
output_folderas specified in the parameters.
bfgs_update
¶
x Internal function of PyPTy. Perform a single L-BFGS update step for all active reconstruction parameters.
| PARAMETER | DESCRIPTION |
|---|---|
Way
|
|
| RETURNS | DESCRIPTION |
|---|---|
total_loss
|
Total objective loss for this epoch.
TYPE:
|
this_sse
|
Sum of squared errors for this epoch.
TYPE:
|
constraint_contributions
|
Regularization term contributions.
TYPE:
|
actual_step
|
Final step length chosen by line search.
TYPE:
|
count
|
Number of line search iterations performed.
TYPE:
|
d_value
|
Directional derivative before update.
TYPE:
|
new_d_value
|
Directional derivative after update.
TYPE:
|
warnings
|
Warnings generated during update.
TYPE:
|
Notes
- This function updates global variables:
obj,probe,positions, etc. - Handles both first-time and history-based L-BFGS updates.
reset_bfgs_history
¶
Reset the global BFGS history and free GPU memory.
Notes
- Clears all stored vectors and scalars in
history_bfgs. - Attempts to free memory pools for CuPy and pinned memory.