singan_sr.yaml 1.4 KB
Newer Older
B
BrilliantYuKaimin 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
total_iters: 100000
output_dir: output_dir
export_model: null

model:
  name: SinGANModel
  generator:
    name: SinGANGenerator
    nfc_init: 32
    min_nfc_init: 32
    noise_zero_pad: True
  discriminator:
    name: SinGANDiscriminator
    nfc_init: 32
    min_nfc_init: 32
  gan_criterion:
    name: GANLoss
    gan_mode: wgangp
    loss_weight: 1.0
  recon_criterion:
    name: MSELoss
    loss_weight: 100.0
  gp_criterion:
    name: GradientPenalty
    loss_weight: 0.1
  train_image: data/singan/stone.png
  scale_factor: 0.793701 # (1/2)^(1/3)
  min_size: 18
  is_finetune: False

dataset:
  train:
    name: EmptyDataset
  test:
    name: SingleDataset
    dataroot: data/singan
    num_workers: 0
    batch_size: 1
    preprocess:
      - name: LoadImageFromFile
        key: A
      - name: Transforms
        input_keys: [A]
        pipeline:
          - name: Transpose
          - name: Normalize
            mean: [127.5, 127.5, 127.5]
            std: [127.5, 127.5, 127.5]

lr_scheduler:
  name: MultiStepDecay
  learning_rate: 0.0005
  milestones: [9600]
  gamma: 0.1

optimizer:
  optimizer_G:
    name: Adam
    beta1: 0.5
    beta2: 0.999
  optimizer_D:
    name: Adam
    beta1: 0.5
    beta2: 0.999

log_config:
  interval: 100
  visiual_interval: 2000

snapshot_config:
  interval: 10000

validate:
  interval: -1
  save_img: True
  metrics:
    fid: # metric name, can be arbitrary
      name: FID
      batch_size: 1