mirror of
https://github.com/kritiksoman/GIMP-ML
synced 2024-11-06 03:20:34 +00:00
37 lines
3.2 KiB
Python
Executable File
37 lines
3.2 KiB
Python
Executable File
### 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='./checkpoints/label2face_512p', 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.00005, 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
|