Skip to content

Commit

Permalink
rename mm to mr
Browse files Browse the repository at this point in the history
  • Loading branch information
kuc2477 committed Feb 28, 2019
1 parent 51b7e4a commit 7d976dc
Show file tree
Hide file tree
Showing 31 changed files with 203 additions and 203 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you are willing to use this code or cite the paper, please refer the followin
$ pip install -r requirements.txt
```

## Preprocessing
## Preprocessing
### Cityscapes
We expect the original Cityscapes dataset to be located at `data/cityscapes/original`. Please refer to [Cityscapes Dataset](http://www.cityscapes-dataset.net/) and [mcordts/cityscapesScripts](https://github.com/mcordts/cityscapesScripts) for details.
```bash
Expand Down Expand Up @@ -82,17 +82,17 @@ $ python ./scripts/preprocess_celeba.py \

### MR-GAN
```bash
$ python main.py --train --mode mr --config ./configs/{model}-{dataset}-{distribution}-{method}.yaml --log-dir ./logs/mr
$ python main.py --mode mr --config ./configs/{model}-{dataset}-{distribution}-{method}.yaml --log-dir ./logs/mr
```

### Proxy MR-GAN
Train a predictor first and determine the checkpoint where the validation loss is minimized.
```bash
$ python main.py --train --mode pred --config configs/{model}-{dataset}-{distribution}-{method}.yaml --log-dir ./logs/predictor
$ python main.py --mode pred --config configs/{model}-{dataset}-{distribution}-{method}.yaml --log-dir ./logs/predictor
```
Use the checkpoint as `--pred-ckpt` to train the generator.
Use the checkpoint as `--pred-ckpt` to train the generator.
```bash
$ python main.py --train --mode mr --config configs/{model}-{dataset}-{distribution}-{method}.yaml --log-dir ./logs/pmr --pred-ckpt ./logs/predictor/ckpt/{step}-p.pt
$ python main.py --mode mr --config configs/{model}-{dataset}-{distribution}-{method}.yaml --log-dir ./logs/pmr --pred-ckpt ./logs/predictor/ckpt/{step}-p.pt
```


Expand Down
10 changes: 5 additions & 5 deletions configs/glcic-celeba_128x128-gaussian-pmr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ model:
recon_weight: 100
gan_weight: 1.0
pred:
mm:
mm_1st_weight: 1000.
mm_2nd_weight: 1000.
mr:
mr_1st_weight: 1000.
mr_2nd_weight: 1000.
gan_weight: 1.0
mle_weight: 0.0

Expand All @@ -52,8 +52,8 @@ g_pretrain_step: 0
d_pretrain_step: 0

batch_size: 16
num_mm: 8
num_mm_samples: 12
num_mr: 8
num_mr_samples: 12

d_updates_per_step: 1
g_updates_per_step: 3
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-gaussian-mr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 10.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-gaussian-mr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 10.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-gaussian-pmr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 10.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 10.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 0.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-gaussian-pmr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 10.0
mm_2nd_weight: 10.0
mr:
mr_1st_weight: 10.0
mr_2nd_weight: 10.0
gan_weight: 1.0
mle_weight: 0.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-laplace-mr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 10.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-laplace-mr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 10.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-laplace-pmr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 1.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 1.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 0.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-cityscapes_256x256-laplace-pmr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 1.0
mm_2nd_weight: 1.0
mr:
mr_1st_weight: 1.0
mr_2nd_weight: 1.0
gan_weight: 1.0
mle_weight: 0.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-maps_256x256-gaussian-mr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 100.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-maps_256x256-gaussian-mr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 10.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-maps_256x256-gaussian-pmr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 300.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 300.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 0.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-maps_256x256-gaussian-pmr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 1000.0
mm_2nd_weight: 1000.0
mr:
mr_1st_weight: 1000.0
mr_2nd_weight: 1000.0
gan_weight: 1.0
mle_weight: 0.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-maps_256x256-laplace-mr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 10.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-maps_256x256-laplace-mr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 0.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 0.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 1.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
10 changes: 5 additions & 5 deletions configs/pix2pix-maps_256x256-laplace-pmr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ model:
recon_weight: 100.
gan_weight: 1.
pred:
mm:
mm_1st_weight: 10.0
mm_2nd_weight: 0.0
mr:
mr_1st_weight: 10.0
mr_2nd_weight: 0.0
gan_weight: 1.0
mle_weight: 0.0
recon_weight: 0.0 # this converts optimize_g to BASE mode

batch_size: 16
num_mm: 8
num_mm_samples: 10
num_mr: 8
num_mr_samples: 10

d_updates_per_step: 1
g_updates_per_step: 1
Expand Down
Loading

0 comments on commit 7d976dc

Please sign in to comment.