Skip to content

Commit 48ced5e

Browse files
author
junyanz
committed
add comments: networks.py
1 parent d22bb50 commit 48ced5e

File tree

8 files changed

+213
-87
lines changed

8 files changed

+213
-87
lines changed

models/base_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BaseModel(ABC):
1616
"""
1717

1818
def __init__(self, opt):
19-
"""Initailize the BaseModel class.
19+
"""Initialize the BaseModel class.
2020
2121
Parameters:
2222
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions

models/colorization_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def modify_commandline_options(parser, is_train=True):
3030
return parser
3131

3232
def __init__(self, opt):
33-
"""Initailize the class.
33+
"""Initialize the class.
3434
3535
Parameters:
3636
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions

models/cycle_gan_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def modify_commandline_options(parser, is_train=True):
4545
return parser
4646

4747
def __init__(self, opt):
48-
"""Initailize the CycleGAN class.
48+
"""Initialize the CycleGAN class.
4949
5050
Parameters:
5151
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions

models/networks.py

Lines changed: 204 additions & 78 deletions
Large diffs are not rendered by default.

models/pix2pix_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def modify_commandline_options(parser, is_train=True):
3838
return parser
3939

4040
def __init__(self, opt):
41-
"""Initailize the pix2pix class.
41+
"""Initialize the pix2pix class.
4242
4343
Parameters:
4444
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions
@@ -57,7 +57,7 @@ def __init__(self, opt):
5757
self.netG = networks.define_G(opt.input_nc, opt.output_nc, opt.ngf, opt.netG, opt.norm,
5858
not opt.no_dropout, opt.init_type, opt.init_gain, self.gpu_ids)
5959

60-
if self.isTrain: # define a discriminator
60+
if self.isTrain: # define a discriminator; conditional GANs need to take both input and output images; Therefore, #channels for D is input_nc + output_nc
6161
self.netD = networks.define_D(opt.input_nc + opt.output_nc, opt.ndf, opt.netD,
6262
opt.n_layers_D, opt.norm, opt.init_type, opt.init_gain, self.gpu_ids)
6363

models/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def modify_commandline_options(parser, is_train=True):
2929
return parser
3030

3131
def __init__(self, opt):
32-
"""Initailize the pix2pix class.
32+
"""Initialize the pix2pix class.
3333
3434
Parameters:
3535
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions

options/base_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def initialize(self, parser):
2828
parser.add_argument('--model', type=str, default='cycle_gan', help='chooses which model to use. [cycle_gan | pix2pix | test | colorization]')
2929
parser.add_argument('--input_nc', type=int, default=3, help='# of input image channels: 3 for RGB and 1 for grayscale')
3030
parser.add_argument('--output_nc', type=int, default=3, help='# of output image channels: 3 for RGB and 1 for grayscale')
31-
parser.add_argument('--ngf', type=int, default=64, help='# of gen filters in first conv layer')
32-
parser.add_argument('--ndf', type=int, default=64, help='# of discrim filters in first conv layer')
31+
parser.add_argument('--ngf', type=int, default=64, help='# of gen filters in the last conv layer')
32+
parser.add_argument('--ndf', type=int, default=64, help='# of discrim filters in the first conv layer')
3333
parser.add_argument('--netD', type=str, default='basic', help='specify discriminator architecture [basic | n_layers | pixel]. The basic model is a 70x70 PatchGAN. n_layers allows you to specify the layers in the discriminator')
3434
parser.add_argument('--netG', type=str, default='resnet_9blocks', help='specify generator architecture [resnet_9blocks | resnet_6blocks | unet_256 | unet_128]')
3535
parser.add_argument('--n_layers_D', type=int, default=3, help='only used if netD==n_layers')

options/train_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def initialize(self, parser):
3333
parser.add_argument('--lr', type=float, default=0.0002, help='initial learning rate for adam')
3434
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.')
3535
parser.add_argument('--pool_size', type=int, default=50, help='the size of image buffer that stores previously generated images')
36-
parser.add_argument('--lr_policy', type=str, default='lambda', help='learning rate policy. [lambda | step | plateau | cosine]')
36+
parser.add_argument('--lr_policy', type=str, default='linear', help='learning rate policy. [linear | step | plateau | cosine]')
3737
parser.add_argument('--lr_decay_iters', type=int, default=50, help='multiply by a gamma every lr_decay_iters iterations')
3838

3939
self.isTrain = True

0 commit comments

Comments
 (0)