Skip to content

Commit

Permalink
Fix to trainable mask. (#98)
Browse files Browse the repository at this point in the history
* Add support for training from measured CelebA.

* Update example to compare with original.

* Update default unrolled config.

* Clean up global shutter capture.

* Fix nbits for global shutter.

* Long exposure comments.

* Fix path.

* Fix aperture.

* Update setup for Python 3.11

* Improve benchmarking.

* Use natural sorting.

* Save analysis.

* Save eval examples.

* Set seed.

* Fix typo.

* Add support to benchmark on DigiCamCelebA dataset.

* Better align simulated PSF.

* Add support to train adafruit mask.

* Fix data type of shape for new PyTorch.

* Add sensor.

* Add option to set number of channels.

* Add more options to analyzing measured dataset.

* Fix resizing.

* Update configs.

* Add option to train mask color filter.

* Add and improve hardware utilities.

* Add more features to unrolled training.

* Update configs.

* update changelog.

* Small fixes.

---------

Co-authored-by: Eric Bezzam <[email protected]>
  • Loading branch information
ebezzam and Eric Bezzam authored Nov 18, 2023
1 parent b11568f commit 53ac235
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lensless/hardware/trainable_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, initial_mask, optimizer="Adam", lr=1e-3, **kwargs):
"""
super().__init__()
self._mask = torch.nn.Parameter(initial_mask)
self._optimizer = getattr(torch.optim, optimizer)([self._mask], lr=lr, **kwargs)
self._optimizer = getattr(torch.optim, optimizer)([self._mask], lr=lr)
self.train_mask_vals = True
self._counter = 0

Expand Down
3 changes: 2 additions & 1 deletion mask_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sympy>=1.11.1
perlin_numpy @ git+https://github.com/pvigier/perlin-numpy.git@5e26837db14042e51166eb6cad4c0df2c1907016
waveprop>=0.0.8
waveprop>=0.0.8
slm_controller @ git+https://github.com/ebezzam/slm-controller.git

0 comments on commit 53ac235

Please sign in to comment.