summaryrefslogtreecommitdiff
path: root/options/train_options.py
diff options
context:
space:
mode:
authortingchunw <tingchunw@nvidia.com>2017-12-04 16:52:46 -0800
committertingchunw <tingchunw@nvidia.com>2017-12-04 16:52:46 -0800
commit9054cf9b0c327a5077fd0793abe178f400da3315 (patch)
tree3c69c07bdcba86c47d8442648fd69c0434e04136 /options/train_options.py
parentf9e9999541d67a908a169cc88407675133130e1f (diff)
first commit
Diffstat (limited to 'options/train_options.py')
-rwxr-xr-xoptions/train_options.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/options/train_options.py b/options/train_options.py
new file mode 100755
index 0000000..9994a4a
--- /dev/null
+++ b/options/train_options.py
@@ -0,0 +1,36 @@
+### Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
+### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
+from .base_options import BaseOptions
+
+class TrainOptions(BaseOptions):
+ def initialize(self):
+ BaseOptions.initialize(self)
+ # for displays
+ self.parser.add_argument('--display_freq', type=int, default=100, help='frequency of showing training results on screen')
+ self.parser.add_argument('--print_freq', type=int, default=100, help='frequency of showing training results on console')
+ self.parser.add_argument('--save_latest_freq', type=int, default=1000, help='frequency of saving the latest results')
+ self.parser.add_argument('--save_epoch_freq', type=int, default=10, help='frequency of saving checkpoints at the end of epochs')
+ self.parser.add_argument('--no_html', action='store_true', help='do not save intermediate training results to [opt.checkpoints_dir]/[opt.name]/web/')
+ self.parser.add_argument('--debug', action='store_true', help='only do one epoch and displays at each iteration')
+
+ # for training
+ self.parser.add_argument('--continue_train', action='store_true', help='continue training: load the latest model')
+ self.parser.add_argument('--load_pretrain', type=str, default='', help='load the pretrained model from the specified location')
+ self.parser.add_argument('--which_epoch', type=str, default='latest', help='which epoch to load? set to latest to use latest cached model')
+ self.parser.add_argument('--phase', type=str, default='train', help='train, val, test, etc')
+ self.parser.add_argument('--niter', type=int, default=100, help='# of iter at starting learning rate')
+ self.parser.add_argument('--niter_decay', type=int, default=100, help='# of iter to linearly decay learning rate to zero')
+ self.parser.add_argument('--beta1', type=float, default=0.5, help='momentum term of adam')
+ self.parser.add_argument('--lr', type=float, default=0.0002, help='initial learning rate for adam')
+
+ # for discriminators
+ self.parser.add_argument('--num_D', type=int, default=2, help='number of discriminators to use')
+ self.parser.add_argument('--n_layers_D', type=int, default=3, help='only used if which_model_netD==n_layers')
+ self.parser.add_argument('--ndf', type=int, default=64, help='# of discrim filters in first conv layer')
+ self.parser.add_argument('--lambda_feat', type=float, default=10.0, help='weight for feature matching loss')
+ self.parser.add_argument('--no_ganFeat_loss', action='store_true', help='if specified, do *not* use discriminator feature matching loss')
+ self.parser.add_argument('--no_vgg_loss', action='store_true', help='if specified, do *not* use VGG feature matching loss')
+ self.parser.add_argument('--no_lsgan', action='store_true', help='do *not* use least square GAN, if false, use vanilla GAN')
+ self.parser.add_argument('--pool_size', type=int, default=0, help='the size of image buffer that stores previously generated images')
+
+ self.isTrain = True