Skip to content

Conversation

cmanzo
Copy link
Contributor

@cmanzo cmanzo commented Aug 2, 2023

I've added the Wasserstein-GAN and modified the VAE so that the input size can be changed easily.

@cmanzo cmanzo changed the title added deterministic wae_gan, slightly modified vae (input size)) added non-deterministic wae_gan, slightly modified vae (input size)) Aug 2, 2023
@JesusPinedaC
Copy link
Collaborator

JesusPinedaC commented Aug 4, 2023

It looks good to me!

I have a few suggestions:

  1. It would be possible to include the optimizers as input parameters either by adding them in __init__ or by overriding the compile method. This would give the user the ability to adjust them as needed, similar to what was done for the GAN.

  2. Have you considered adjusting the code format to ensure it is compatible in style? One possible solution is to use the ms-python.black-formatter, which can be found in Visual Studio Code.

  3. It is important to include comprehensive documentation regarding the various input parameters of the model.

  4. In the experiment done by the authors for MNIST, they used different learning rates for the autoencoder and the discriminator. 1e-3 and 5e-4, respectively. Have you tried training with these values? Do you think it is worth keeping the values ​​suggested by the authors as default? The current implementation utilizes 1e-3 for both networks.

  5. It would be very convenient to include a unit test for this model!

cmanzo added 2 commits August 14, 2023 19:42
Implemented proposed changes to GAN, VAE, WAE_GAN:
- optimizers of WAE_GAN as input parameters by overriding the compile method.
- included documentation of input parameters for VAE and WAE_GAN.
- WAE_GAN: different learning rates for the autoencoder and the discriminator, 1e-3 and 5e-4, respectively as in the original paper.
- included a unit test for WAE_GAN, VAE, and GAN.
- removed @as_KerasModel from GAN.
- formatted the code for compatibility.
@cmanzo
Copy link
Contributor Author

cmanzo commented Aug 14, 2023

I have included your suggestions, let me know how it looks!

@JesusPinedaC
Copy link
Collaborator

Great! I think we are ready to merge!

@cmanzo
Copy link
Contributor Author

cmanzo commented Aug 16, 2023

I fixed a little typo in the test_models.py, let me know if it runs now

@cmanzo cmanzo changed the title added non-deterministic wae_gan, slightly modified vae (input size)) added WAE (both MMD and GAN) Sep 11, 2023
@giovannivolpe giovannivolpe merged commit 1413e01 into DeepTrackAI:develop Sep 12, 2023
giovannivolpe added a commit that referenced this pull request Sep 13, 2023
* chore: autopublish 2022-07-26T13:54:44Z

* Remove create-badges job

* Delete test.py

* Add multi-head masked attention

* Update multi-head gated attention to match parent layer

* Update documentation

* Test multi-head masked attention

* allow gated attention layers to use bias

* test bias in gated attention layers

* set return_attention_weights to False to avoid multi-outputs

Use MultiHeadSelfAttention and MultiHeadGatedSelfAttention if want to return the attention weights

* reformat gnns/layers.py

This commit adds new message-passing graph layers (MPN) and graph convolutional layers to dt, including vanilla MPN, GRUMPN, Masked-attention FGNN, and GraphTransformer.

* Update layers.py

* Update test_layers.py

* Update models.py

* Update test_models.py

* Update test_models.py

* Fix indexing problems related to tf.gather

* Allow multi-inputs in ContinuousGenerator

* Fix bad conversion to integer

* version bump

* Fix phase correction at focus and offset calculation

* Fix phase correction in propagation

* Fix mie phase out of foucs

* Fix mie phase out of foucs

* Update README.md

* Bm/version 1.4.0 (#137)

* Update layers.py

* Update convolutional.py

Transformer-based models can now be reused and expanded quickly and easily

* Update documentation

* Update Transformer-based models

* Delete classifying_MNIST_vit_tutorial.ipynb

* Create classifying_MNIST_vit_tutorial.ipynb

* Update datasets.py

* Allows kwargs as inputs in single_layer_call

* Update embeddings.py

* masked transformers

* reformat transformer models

* Create trajectory_analysis_tutorial.ipynb

* Add Variational autoencoders

* Add variational autoencoders

* Update vae.py

* Create MNIST_VAE_tutorial.ipynb

* Update MNIST_VAE_tutorial.ipynb

* Create folder for course examples

* Update README.md

* Update README.md

* Update examples

* Update README.md

* Update README.md

* Update MNIST VAE examples

* Added MLP regression example

* Update README.md

* Create image_segmentation_Unet.ipynb

* Update README.md

* Documented and tested cell_counting_tutorial.ipynb

* improve dnn example

* Shift variant mie

* Position mie scatterer correctly

* implement set z

* implement mnist v1

* implement z dependence

* remove logging

* Implement flattening methods

* Implement pooling and resizing

* Implement TensorflowDataset

* Finalize MNIST

* Implement Malaria classification

* alpha0 release

* fix batchsize in fit

* implement dataset.take

* Implement datasets

* fix phase in mie

* Fix mie positioning and focusing

* Commit to new branch

* add tensorflow datasets dependence

* remove test

Co-authored-by: Jesús Pineda <jesus.pineda@physics.gu.se>
Co-authored-by: Jesús Pineda <36273229+JesusPinedaC@users.noreply.github.com>
Co-authored-by: Benjamin Midtvedt <benmid@student.chalmers.se>
Co-authored-by: Ccx55 <ccx555@gmail.com>

* Add tensorflow datasets to the list of dependencies.

* Read requirements.txt into setup.py

* remove sphinx from build

* remove create badges

* Create CITATION.cff

* Create .zenodo.json

* Update transformer models

* Update pint_definition.py

* Update requirements.txt

* create TimeDistributed CNN

* small fixes to lodestar

* Update layers.py

* Update test_layers.py

* remove direct getter of properties

* Update scatterers.py

Coherence length fix for MieScatterer

* Update scatterers.py

Added coherence length to the conversion table

* mie phase fix

* removed pydeepimagej from deps

* Change loss input order of CGAN and PCGAN

* Create dmdataset (dataset for graph-level regression tasks)

* Update gnns/__init__.py

* Add detection_linking_hela dataset

* Update dmdataset.py

* Create the regression_diffusion_landscape

* Update scatterers.py

CuPy fix for coherence length

* Update test_scatterers.py

Added a new method for testing MieSphere when coherence length parameter is provided.

* Update augmentations.py

* Update test_scatterers.py

* Update test_scatterers.py

* Create endothelial_vs dataset

* Update layers.py

* Update utils.py

* Update docs link

* Update README.md

* version bump

* version bump

* Update README.md

* Update README.md

* Update graphs.py

* Update test_generators.py

* Update generators.py

* fix test

* Update vae.py

* Bugfix in endothelial_vs dataset

* Fix issue with repeated oneof-features (#169)

* Update cell_migration_analysis.ipynb

* Update features.py (#189)

* added WAE (both MMD and GAN) (#185)

* added deterministic wae_gan, slightly modified vae (input size))

* changes to VAE, WAE_GAN, and GAN

Implemented proposed changes to GAN, VAE, WAE_GAN:
- optimizers of WAE_GAN as input parameters by overriding the compile method.
- included documentation of input parameters for VAE and WAE_GAN.
- WAE_GAN: different learning rates for the autoencoder and the discriminator, 1e-3 and 5e-4, respectively as in the original paper.
- included a unit test for WAE_GAN, VAE, and GAN.
- removed @as_KerasModel from GAN.
- formatted the code for compatibility.

* Update test_models.py

* fixed typo

* extra fixes

* WAE generalized

allows WAE-GAN and WAE-MMD

* fixes

* check unit test

* compatibility issue

removed match for compatibility, replaced with if

* test unit

corrected assert in test unit for GAN, VAE. and WAE

* fixed dimension in test_models

* added compile for GAN and WAE in test_model

* defined call in gan

* fixed input size in GAN

---------

Co-authored-by: BenjaminMidtvedt <41636530+BenjaminMidtvedt@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jesús Pineda <jesus.pineda@physics.gu.se>
Co-authored-by: Benjamin Midtvedt <benmid@student.chalmers.se>
Co-authored-by: Jesús Pineda <36273229+JesusPinedaC@users.noreply.github.com>
Co-authored-by: Ccx55 <ccx555@gmail.com>
Co-authored-by: Harshith Bachimanchi <62615092+HarshithBachimanchi@users.noreply.github.com>
Co-authored-by: gideon <gideon.jagenstedt@gmail.com>
Co-authored-by: Benjamin Midtvedt <benjamin.midtvedt@physics.gu.se>
Co-authored-by: Carlo <carlo.manzo@gmail.com>
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.

3 participants