flax icon indicating copy to clipboard operation
flax copied to clipboard

Updating linen_examples/vae

Open andsteing opened this issue 5 years ago • 2 comments

This issue tracks updates the vae example to follow practices outlined in #231.

  • [x] Port to linen API - once ported all subsequent changes should be done in linen_examples/vae
  • [ ] Update README.md
  • [x] Add requirements.txt
  • [ ] Update file structure
  • [ ] Use ml_collections.ConfigDict ?
  • [ ] Add benchmark test ?
  • [ ] Add unit test for training/eval step
  • [ ] Add Colab
  • [ ] Adhere to Google Python style
  • [ ] Add mypy annotations
  • [ ] Shorten/beautify training loop (consider using clu for this)

andsteing avatar Oct 29 '20 06:10 andsteing

Note that "file structure" in #231 got changed (as part of #634):

  • To make it easier to test, maintain and reuse code structure the code as follows:

    • main.py contains the flags and calls a method from train.py to run the training loop. This should be the only file defining flags! This can be almost identical for all examples, please copy from linen_examples/wmt/main.py.
    • train.py contains classes and methods for training and evaluating the model.
    • train_test.py for test cases of the training code. At a minimum the test should run a single training step but more fine grained unit tests are a bonus. You can use tfds.testing.mock_data to avoid real data from disk.

andsteing avatar Nov 15 '20 07:11 andsteing

Unassigning myself and adding "pull requests welcome"

marcvanzee avatar Sep 06 '22 10:09 marcvanzee

Mind if I take a run at this? I might not be able to do everything in the checklist but can certainly move this along

canyon289 avatar Apr 20 '23 00:04 canyon289

Yes, please have a run.

Happy to answer questions and review PRs.

andsteing avatar Apr 20 '23 08:04 andsteing

Thanks! Feel free to assign this to me, I'll likely open up multiple smaller PRs for subpieces rather than one open one. If that doesn't sound like a good plan please let me know!

canyon289 avatar Apr 20 '23 14:04 canyon289

We should reopen the issue and mark some of the tasks as done

SauravMaheshkar avatar Aug 11 '23 13:08 SauravMaheshkar

Even mypy and Google Style Guide can be checked IMO. Gentle ping @levskaya

SauravMaheshkar avatar Aug 15 '23 11:08 SauravMaheshkar

Updated Tracker

  • [x] Port to linen API
  • [x] Update README.md
  • [x] Add requirements.txt
  • [x] Update file structure
  • [x] Use ml_collections.ConfigDict
  • [ ] Add benchmark test
  • [ ] Add unit test for training/eval step
  • [ ] Add Colab
  • [x] Adhere to Google Python style
  • [x] Add mypy annotations
  • [ ] Shorten/beautify training loop (consider using clu for this)

SauravMaheshkar avatar Sep 13 '23 17:09 SauravMaheshkar

Request for permission to modify

The current vae example does not work, may I make minor modifications?

Modifications

Two modifications are as follows:

  1. modify requirements.txt
    • add clu==0.0.6
    • upgrade flax==0.6.9 To flax==0.7.4
  2. modify README.md
    • remove "--workdir=/tmp/mnist" from a execution command

Reasons

  • flax==0.7.4

  • remove "--workdir=/tmp/mnist"

    • commit hash db7b1762
      • workdir flag definition is removed in main.py

shimejii avatar Sep 25 '23 10:09 shimejii

Yes, please go ahead and create a PR to fix the example.

andsteing avatar Sep 25 '23 12:09 andsteing

Thank you very much. I have created a PR, please check it.

shimejii avatar Sep 25 '23 23:09 shimejii