From 53ac235b9060131b0b9ef2938bf201216e88596f Mon Sep 17 00:00:00 2001 From: Eric Bezzam Date: Sat, 18 Nov 2023 08:43:06 +0100 Subject: [PATCH] Fix to trainable mask. (#98) * 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 --- lensless/hardware/trainable_mask.py | 2 +- mask_requirements.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lensless/hardware/trainable_mask.py b/lensless/hardware/trainable_mask.py index a20d502d..f0d258ba 100644 --- a/lensless/hardware/trainable_mask.py +++ b/lensless/hardware/trainable_mask.py @@ -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 diff --git a/mask_requirements.txt b/mask_requirements.txt index 9e9c28a4..1c0c0b93 100644 --- a/mask_requirements.txt +++ b/mask_requirements.txt @@ -1,3 +1,4 @@ sympy>=1.11.1 perlin_numpy @ git+https://github.com/pvigier/perlin-numpy.git@5e26837db14042e51166eb6cad4c0df2c1907016 -waveprop>=0.0.8 \ No newline at end of file +waveprop>=0.0.8 +slm_controller @ git+https://github.com/ebezzam/slm-controller.git \ No newline at end of file