forked from tldr-group/GAN-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into main
- Loading branch information
Showing
2 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,83 @@ | ||
# GAN-boilerplate | ||
|
||
A boilerplate repo for GAN projects | ||
A boilerplate repo for GAN projects. | ||
|
||
TODO | ||
This repo is geared towards GANs for material microstructure projects, where the generator learned to output a homogeneous image. However, it can be easily adapted to any GAN project. | ||
|
||
explain .env file | ||
## Folder structure | ||
|
||
Explain whole thing | ||
``` | ||
GAN-boilerplate | ||
┣ src | ||
┃ ┣ __init__.py | ||
┃ ┣ networks.py | ||
┃ ┣ postprocessing.py | ||
┃ ┣ preprocessing.py | ||
┃ ┣ test.py | ||
┃ ┣ train.py | ||
┃ ┗ util.py | ||
┣ data | ||
┃ ┗ example.png | ||
┣ .gitignore | ||
┣ config.py | ||
┣ main.py | ||
┣ README.md | ||
┗ requirements.txt | ||
``` | ||
|
||
Finish dosctrings | ||
## Quickstart | ||
|
||
Prerequisites: | ||
|
||
- conda | ||
- python3 | ||
|
||
Create a new conda environment, activate and install pytorch | ||
|
||
_Note: cudatoolkit version and pytorch install depends on system, see [PyTorch install](https://pytorch.org/get-started/locally/) for more info._ | ||
|
||
``` | ||
conda create --name gan-boilerplate | ||
conda activate gan-boilerplate | ||
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch | ||
conda install -r requirements.txt | ||
``` | ||
|
||
Create a .env file to hold secrets, the .env file must include | ||
|
||
``` | ||
WANDB_API_KEY= | ||
WANDB_ENTITY= | ||
WANDB_PROJECT= | ||
``` | ||
|
||
You are now ready to run the repo. To start training | ||
|
||
``` | ||
python main.py train -t test-run | ||
``` | ||
|
||
This will track your run online with Weights and Biases and name your training run `test-run`. To run in offline mode | ||
|
||
``` | ||
python main.py train -t test-run -o | ||
``` | ||
|
||
To generate samples from a trained generator | ||
|
||
``` | ||
python main.py generate -t test-run | ||
``` | ||
|
||
To run unit tests | ||
|
||
``` | ||
python main.py test | ||
``` | ||
|
||
## TODO | ||
|
||
- [x] Quickstart | ||
- [ ] Saving and loading models | ||
- [ ] Training outputs | ||
- [ ] Network architectures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters