summaryrefslogtreecommitdiff
path: root/options/train_options.py
diff options
context:
space:
mode:
authorjunyanz <junyanz@berkeley.edu>2017-04-18 03:38:47 -0700
committerjunyanz <junyanz@berkeley.edu>2017-04-18 03:38:47 -0700
commitc99ce7c4e781712e0252c6127ad1a4e8021cc489 (patch)
treeba99dfd56a47036d9c1f18620abf4efc248839ab /options/train_options.py
first commit
Diffstat (limited to 'options/train_options.py')
-rw-r--r--options/train_options.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/options/train_options.py b/options/train_options.py
new file mode 100644
index 0000000..e7d4b3a
--- /dev/null
+++ b/options/train_options.py
@@ -0,0 +1,24 @@
+from .base_options import BaseOptions
+
+class TrainOptions(BaseOptions):
+ def initialize(self):
+ BaseOptions.initialize(self)
+ 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=5000, help='frequency of saving the latest results')
+ self.parser.add_argument('--save_epoch_freq', type=int, default=5, help='frequency of saving checkpoints at the end of epochs')
+ self.parser.add_argument('--save_display_freq', type=int, default=2500, help='save the current display of results every save_display_freq_iterations')
+ self.parser.add_argument('--continue_train', action='store_true', help='if continue training, load the latest model')
+ self.parser.add_argument('--phase', type=str, default='train', help='train, val, test, etc')
+ 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('--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('--ntrain', type=int, default=float("inf"), help='# of examples per epoch.')
+ self.parser.add_argument('--lr', type=float, default=0.0002, help='initial learning rate for adam')
+ self.parser.add_argument('--no_lsgan', action='store_true', help='if true, do *not* use least square GAN, if false, use vanilla GAN')
+ self.parser.add_argument('--lambda_A', type=float, default=10.0, help='weight for cycle loss (A -> B -> A)')
+ self.parser.add_argument('--lambda_B', type=float, default=10.0, help='weight for cycle loss (B -> A -> B)')
+ self.parser.add_argument('--pool_size', type=int, default=0, help='the size of image buffer that stores previously generated images')
+ self.parser.add_argument('--preprocessing', type=str, default='resize_and_crop', help='resizing/cropping strategy')
+ self.isTrain = True