Skip to content

Ptycho constraints#241

Merged
arthurmccray merged 8 commits into
electronmicroscopy:diffractive_imagingfrom
arthurmccray:ptycho_constraints
Jun 3, 2026
Merged

Ptycho constraints#241
arthurmccray merged 8 commits into
electronmicroscopy:diffractive_imagingfrom
arthurmccray:ptycho_constraints

Conversation

@arthurmccray
Copy link
Copy Markdown
Collaborator

This is a followup to PR #234 that does 3 main things:

  • adds ptychography ConstraintParams dataclasses for tab-completable and better-documented constraints. Tutorial for that here
  • Converts pure_phase ptycho objects to being stored as realvalued arrays. This prevents issues of phase wrapping (especially with DIPs) and makes regularization and filtering more consistent/accurate. It does make it fairly duplicitous to potential objects, but I think it can be left for the time being.
  • Moves hard constraints to being computed outside the computational graph with torch.no_grad. This doesn't make much of an difference in results, but it's cleaner and the more standard way of doing hard constraints.

@arthurmccray arthurmccray marked this pull request as ready for review June 3, 2026 05:22
@arthurmccray arthurmccray merged commit 7400459 into electronmicroscopy:diffractive_imaging Jun 3, 2026
8 checks passed
@arthurmccray arthurmccray deleted the ptycho_constraints branch June 3, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant