animeganv2_pretrain.yaml 1.8 KB
Newer Older
郑启航 已提交
1 2 3 4 5 6 7 8 9
epochs: 2
output_dir: output_dir

model:
  name: AnimeGANV2PreTrainModel
  generator:
    name: AnimeGenerator
  discriminator:
    name: AnimeDiscriminator
L
LielinJiang 已提交
10 11 12 13 14
  gan_criterion:
    name: GANLoss
    gan_mode: lsgan
  con_weight: 1
  pretrain_ckpt: null
郑启航 已提交
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

dataset:
  train:
    name: AnimeGANV2Dataset
    num_workers: 4
    batch_size: 4
    dataroot: data/animedataset
    style: Hayao
    transform_real:
      - name: Transpose
      - name: Normalize
        mean: [127.5, 127.5, 127.5]
        std: [127.5, 127.5, 127.5]
    transform_anime:
      - name: Add
        value: [-4.4346957, -8.665916, 13.100612]
      - name: Transpose
      - name: Normalize
        mean: [127.5, 127.5, 127.5]
        std: [127.5, 127.5, 127.5]
    transform_gray:
      - name: Grayscale
        num_output_channels: 3
      - name: Transpose
      - name: Normalize
        mean: [127.5, 127.5, 127.5]
        std: [127.5, 127.5, 127.5]
  test:
    name: SingleDataset
    dataroot: data/animedataset/test/test_photo
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
    preprocess:
      - name: LoadImageFromFile
        key: A
      - name: Transforms
        input_keys: [A]
        pipeline:
          - name: ResizeToScale
            size: [256, 256]
            scale: 32
            interpolation: bilinear
          - name: Transpose
          - name: Normalize
            mean: [127.5, 127.5, 127.5]
            std: [127.5, 127.5, 127.5]
            keys: [image, image]
郑启航 已提交
60 61

lr_scheduler:
L
LielinJiang 已提交
62
  name: LinearDecay
郑启航 已提交
63 64 65
  learning_rate: 0.0002
  start_epoch: 100
  decay_epochs: 100
L
LielinJiang 已提交
66 67 68 69 70 71 72 73 74 75 76 77 78 79
  # will get from real dataset
  iters_per_epoch: 1

optimizer:
  optimizer_G:
    name: Adam
    net_names:
      - netG
    beta1: 0.5
  optimizer_D:
    name: Adam
    net_names:
      - netD
    beta1: 0.5
郑启航 已提交
80 81 82 83 84 85 86

log_config:
  interval: 100
  visiual_interval: 100

snapshot_config:
  interval: 5