You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ To help users better understand and use our codebase, we briefly overview the fu
29
29
*[networks.py](../models/networks.py) module implements network architectures (both generators and discriminators), as well as normalization layers, initialization methods, optimization scheduler (i.e., learning rate policy), and GAN objective function (`vanilla`, `lsgan`, `wgangp`).
30
30
*[test_model.py](../models/test_model.py) implements a model that can be used to generate CycleGAN results for only one direction. This option will automatically set `--dataset_mode single`, which only loads the images from one set. See the test [instruction](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix#apply-a-pre-trained-model-cyclegan) for more details.
31
31
32
-
[options](../options) directory includes our option modules: training options, test options and, basic options (used in both training and test). `TrainOptions` and `TestOptions` are both subclasses of `BaseOptions`. They will reuse the options defined in `BaseOptions`.
32
+
[options](../options) directory includes our option modules: training options, test options, and basic options (used in both training and test). `TrainOptions` and `TestOptions` are both subclasses of `BaseOptions`. They will reuse the options defined in `BaseOptions`.
33
33
*[\_\_init\_\_.py](../options/__init__.py) is required to make Python treat the directory `options` as containing packages,
34
34
*[base_options.py](../options/base_options.py) includes options that are used in both training and test. It also implements a few helper functions such as parsing, printing, and saving the options. It also gathers additional options defined in `modify_commandline_options` functions in both dataset class and model class.
35
35
*[train_options.py](../options/train_options.py) includes options that are only used during training time.
@@ -41,5 +41,5 @@ To help users better understand and use our codebase, we briefly overview the fu
41
41
*[get_data.py](../util/get_data.py) provides a Python script for downloading CycleGAN and pix2pix datasets. Alternatively, You can also use bash scripts such as [download_pix2pix_model.sh](../scripts/download_pix2pix_model.sh) and [download_cyclegan_model.sh](../scripts/download_cyclegan_model.sh).
42
42
*[html.py](../util/html.py) implements a module that saves images into a single HTML file. It consists of functions such as `add_header` (add a text header to the HTML file), `add_images` (add a row of images to the HTML file), `save` (save the HTML to the disk). It is based on Python library `dominate`, a Python library for creating and manipulating HTML documents using an elegant DOM API.
43
43
*[image_pool.py](../util/image_pool.py) implements an image buffer that stores previously generated images. This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators. The original idea was discussed in this [paper](http://openaccess.thecvf.com/content_cvpr_2017/papers/Shrivastava_Learning_From_Simulated_CVPR_2017_paper.pdf). The size of the buffer is controlled by the flag `--pool_size`.
44
-
*[visualizer.py](../util/visualizer.py) includes several functions to display and save images as well as print and save logging information. It is based on Python library `visdom` display.
45
-
*[util.py](../util/util.py) consists of simple helper functions such as `tensor2im` (convert a tensor array to a numpy image array), `diagnose_network` (print the mean and stddev of weights for each layer), and `mkdirs` (create multiple directories).
44
+
*[visualizer.py](../util/visualizer.py) includes several functions that can display/save images and print/save logging information. It uses a Python library `visdom`for display and a Python library `dominate` (wrapped in `HTML`) for creating HTML files with images.
45
+
*[util.py](../util/util.py) consists of simple helper functions such as `tensor2im` (convert a tensor array to a numpy image array), `diagnose_network` (calculate and print the mean of average absolute value of gradients), and `mkdirs` (create multiple directories).
Copy file name to clipboardExpand all lines: options/train_options.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,14 @@
2
2
3
3
4
4
classTrainOptions(BaseOptions):
5
+
"""This class includes options that are only used during training time.
6
+
7
+
It also includes shared options defined in BaseOptions.
8
+
"""
9
+
5
10
definitialize(self, parser):
6
11
parser=BaseOptions.initialize(self, parser)
12
+
# visdom and HTML visualization parameters
7
13
parser.add_argument('--display_freq', type=int, default=400, help='frequency of showing training results on screen')
8
14
parser.add_argument('--display_ncols', type=int, default=4, help='if positive, display all images in a single visdom web panel with certain number of images per row.')
9
15
parser.add_argument('--display_id', type=int, default=1, help='window id of the web display')
@@ -12,19 +18,21 @@ def initialize(self, parser):
12
18
parser.add_argument('--display_port', type=int, default=8097, help='visdom port of the web display')
13
19
parser.add_argument('--update_html_freq', type=int, default=1000, help='frequency of saving training results to html')
14
20
parser.add_argument('--print_freq', type=int, default=100, help='frequency of showing training results on console')
21
+
parser.add_argument('--no_html', action='store_true', help='do not save intermediate training results to [opt.checkpoints_dir]/[opt.name]/web/')
22
+
# network saving and loading parameters
15
23
parser.add_argument('--save_latest_freq', type=int, default=5000, help='frequency of saving the latest results')
16
24
parser.add_argument('--save_epoch_freq', type=int, default=5, help='frequency of saving checkpoints at the end of epochs')
17
25
parser.add_argument('--save_by_iter', action='store_true', help='whether saves model by iteration')
18
26
parser.add_argument('--continue_train', action='store_true', help='continue training: load the latest model')
19
27
parser.add_argument('--epoch_count', type=int, default=1, help='the starting epoch count, we save the model by <epoch_count>, <epoch_count>+<save_latest_freq>, ...')
parser.add_argument('--niter', type=int, default=100, help='# of iter at starting learning rate')
22
31
parser.add_argument('--niter_decay', type=int, default=100, help='# of iter to linearly decay learning rate to zero')
23
32
parser.add_argument('--beta1', type=float, default=0.5, help='momentum term of adam')
24
33
parser.add_argument('--lr', type=float, default=0.0002, help='initial learning rate for adam')
25
34
parser.add_argument('--gan_mode', type=str, default='lsgan', help='the type of GAN objective. [vanilla| lsgan | wgangp]. vanilla GAN loss is the cross-entropy objective used in the original GAN paper.')
26
35
parser.add_argument('--pool_size', type=int, default=50, help='the size of image buffer that stores previously generated images')
27
-
parser.add_argument('--no_html', action='store_true', help='do not save intermediate training results to [opt.checkpoints_dir]/[opt.name]/web/')
0 commit comments