Instruction of Config Files

October 14, 2021 · View on GitHub

Introduction of Parameters

Takelapstyle_rev_first.yaml as an example.

Global

FieldUsageDefault
total_iterstotal training steps30000
min_maxnumeric range of tensor(for image storage)(0., 1.)
output_dirpath of the output./output_dir
snapshot_config: intervalinterval for saving model parameters5000

Model

FieldUsageDefault
namename of the modelLapStyleRevFirstModel
revnet_generatorset the revnet generatorRevisionNet
revnet_discriminatorset the revnet discriminatorLapStyleDiscriminator
draftnet_encodeset the draftnet encoderEncoder
draftnet_decodeset the draftnet decoderDecoderNet
calc_style_emd_lossset the style loss 1CalcStyleEmdLoss
calc_content_relt_lossset the content loss 1CalcContentReltLoss
calc_content_lossset the content loss 2CalcContentLoss
calc_style_lossset the style loss 2CalcStyleLoss
gan_criterion: nameset the GAN lossGANLoss
gan_criterion: gan_modeset the modal parameter of GAN lossvanilla
content_layersset the network layer that calculates content loss 2['r11', 'r21', 'r31', 'r41', 'r51']
style_layersset the network layer that calculates style loss 2['r11', 'r21', 'r31', 'r41', 'r51']
content_weightset the weight of total content loss1.0
style_weighset the weight of total style loss3.0

Dataset (train & test)

FieldUsageDefault
namename of the datasetLapStyleDataset
content_rootpath of the datasetdata/coco/train2017/
style_rootpath of the target style imagedata/starrynew.png
load_sizeimage size after resizing the input image280
crop_sizeimage size after random cropping256
num_workersnumber of worker process16
batch_sizesize of the data sample for one training session5

Lr_scheduler

FieldUsageDefault
namename of the learning strategyNonLinearDecay
learning_rateinitial learning rate1e-4
lr_decaydecay rate of the learning rate5e-5

Optimizer

FieldUsageDefault
nameclass name of the optimizerAdam
net_namesthe network under the optimizernet_rev
beta1set beta1, parameter of the optimizer0.9
beta2set beta2, parameter of the optimizer0.999

Validate

FieldUsageDefault
intervalvalidation interval500
save_imgwhether to save image while validatingfalse

Log_config

FieldUsageDefault
intervallog printing interval10
visiual_intervalinterval for saving the generated images during training500