Advertisement
BobTheHunted

train_bthnrm.yml

Feb 14th, 2021
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 5.01 KB | None | 0 0
  1. name: bth_normalmap_colab
  2. use_tb_logger: true
  3. model: srragan
  4. scale: 1
  5. gpu_ids: [0]
  6. use_amp: true
  7. use_swa: false
  8.  
  9. # Dataset options:
  10. datasets:
  11.   train:
  12.     name: DIV2K
  13.     mode: LRHROTF
  14.     dataroot_HR: '/content/BasicSR/bthnrm/hr'
  15.     dataroot_LR: '/content/BasicSR/bthnrm/lr'
  16.     subset_file: null
  17.     use_shuffle: true
  18.     znorm: false
  19.     n_workers: 4
  20.     batch_size: 4
  21.     virtual_batch_size: 4
  22.     HR_size: 128
  23.     image_channels: 3
  24.  
  25.     lr_downscale: false
  26.     lr_downscale_types: ["nearest"]
  27.  
  28.     hr_downscale: false
  29.     hr_downscale_types: ["nearest"]
  30.  
  31.     # Rotations augmentations:
  32.     use_flip: true
  33.     use_rot: true
  34.     hr_rrot: false
  35.  
  36.     # Noise and blur augmentations:
  37.     lr_blur: false # true | false
  38.     lr_blur_types: {gaussian: 1, clean: 3} # select from: "average","box","gaussian","bilateral","clean" ##blur options #median and motion aren't working yet
  39.     noise_data: ../noise_patches/normal/ # location of the noise patches extracted from real images to use for noise injection with noise option "patches"
  40.     lr_noise: false # true | false
  41.     lr_noise_types: {gaussian: 1, JPEG: 1, clean: 4} # select from: "gaussian", "JPEG", "quantize", "poisson", "dither", "s&p", "speckle", "patches", "clean"
  42.     lr_noise2: false # true | false
  43.     lr_noise_types2: {dither: 2, clean: 2} # select from: "gaussian", "JPEG", "quantize", "poisson", "dither", "s&p", "speckle", "patches", "clean"
  44.     hr_noise: false # true | false
  45.     hr_noise_types: {gaussian: 1, clean: 4} # select from: "gaussian", "JPEG", "quantize", "poisson", "dither", "s&p", "speckle", "clean"
  46.  
  47.   val:
  48.     name: val_set14_part
  49.     mode: LRHROTF
  50.     dataroot_HR: '/content/BasicSR/bthnrm/hr_val'
  51.     dataroot_LR: '/content/BasicSR/bthnrm/lr_val'
  52.  
  53. path:
  54.     strict: false
  55.     root: '/content/drive/My Drive/Models/'
  56.     pretrain_model_G: '/content/BasicSR/experiments/pretrained_models/1xESRGAN.pth'
  57.     resume_state: '/content/drive/My Drive/Models/experiments/bth_normalmap_colab/training_state/latest.state'
  58.  
  59. # Generator:
  60. network_G:
  61.     strict: false # true | false # whether to load the model in strict mode or not
  62.     # ESRGAN:
  63.     which_model_G: RRDB_net # RRDB_net (original ESRGAN arch) | MRRDB_net (modified/"new" arch) | sr_resnet
  64.     norm_type: null
  65.     mode: CNA
  66.     nf: 64 # number of discrim filters in the first conv layer
  67.     nb: 23 # number of RRDB blocks
  68.     nr: 3 #  number of residual layers in each RRDB block
  69.     in_nc: 3 # of input image channels: 3 for RGB and 1 for grayscale
  70.     out_nc: 3 # of output image channels: 3 for RGB and 1 for grayscale
  71.     gc: 32
  72.     group: 1
  73.     convtype: Conv2D # Conv2D | PartialConv2D | DeformConv2D | Conv3D
  74.     net_act: leakyrelu # swish | leakyrelu
  75.     gaussian: true # true | false
  76.     plus: false # true | false
  77.  
  78. # Discriminator:
  79. network_D:
  80.     strict: true # true | false # whether to load the model in strict mode or not
  81.     # ESRGAN (default)| PPON:
  82.     which_model_D: discriminator_vgg # discriminator_vgg_128 | discriminator_vgg | discriminator_vgg_128_fea (feature extraction) | discriminator_vgg_fea (feature extraction) | patchgan | multiscale
  83.     norm_type: batch
  84.     act_type: leakyrelu
  85.     mode: CNA # CNA | NAC
  86.     nf: 64
  87.     in_nc: 3
  88.     nlayer: 3 # only for patchgan and multiscale
  89.     num_D: 3 # only for multiscale
  90.  
  91. # Training options:
  92. train:
  93.     lr_G: 0.0001 # 2e-4 # starting lr_g #Test, default: 1e-4
  94.     weight_decay_G: 0
  95.     beta1_G: 0.9
  96.     lr_D: 0.0001 # 2e-4 # starting lr_d #Test, default: 1e-4
  97.     weight_decay_D: 0
  98.     beta1_D: 0.9
  99.  
  100.     # For MultiStepLR (ESRGAN, default):
  101.     lr_scheme: MultiStepLR
  102.     lr_steps_rel: [0.1, 0.2, 0.4, 0.6] # to use lr steps relative to % of training niter instead of fixed lr_steps
  103.     lr_gamma: 0.5 # lr change at every step (multiplied by)
  104.  
  105.     # For SWA scheduler
  106.     swa_start_iter: 375000 #Just reference: 75% of 500000. Can be any value, including 0 to start right away with a pretrained model.
  107.     # swa_start_iter_rel: 0.75 # to use swa_start_iter relative to % of training niter instead of fixed swa_start_iter
  108.     swa_lr: 1e-4 #Has to be ~order of magnitude of a stable lr for the regular scheduler
  109.     swa_anneal_epochs: 10
  110.     swa_anneal_strategy: "cos"
  111.  
  112.     # Losses:
  113.     pixel_criterion: l1 # "l1" | "l2" | "cb" | "elastic" | "relativel1" | "l1cosinesim" | "clipl1" #pixel loss
  114.     pixel_weight: 1e-2 # 1e-2 | 1
  115.     feature_criterion: l1 # "l1" | "l2" | "cb" | "elastic" #feature loss (VGG feature network)
  116.     feature_weight: 1
  117.     cx_weight: 0.5
  118.     cx_type: contextual
  119.     cx_vgg_layers: {conv_3_2: 1, conv_4_2: 1}
  120.     gan_type: 'vanilla'
  121.     gan_weight: 5e-3
  122.  
  123. # Other training options:
  124.     manual_seed: 0
  125.     niter: 5e5
  126.     # warmup_iter: -1  # number of warm up iterations, -1 for no warm up
  127.     val_freq: 500 # 5e3
  128.     # overwrite_val_imgs: true
  129.     # val_comparison: true
  130.     metrics: 'psnr,ssim,lpips' # select from: "psnr,ssim,lpips" or a combination separated by comma ","
  131.  
  132. logger:
  133.     print_freq: 200
  134.     save_checkpoint_freq: !!float 5e3
  135.     overwrite_chkp: false
  136.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement