From 2a5103eb8d5da029c47ec900afb321a648504017 Mon Sep 17 00:00:00 2001 From: Henry Addison Date: Fri, 9 Feb 2024 21:42:03 +0000 Subject: [PATCH] remove unused configs for configurations from original repo --- .../configs/default_celeba_configs.py | 72 ------------ .../configs/default_cifar10_configs.py | 72 ------------ .../configs/default_lsun_configs.py | 72 ------------ .../subvpsde/cifar10_ddpm_continuous.py | 55 --------- .../subvpsde/cifar10_ddpmpp_continuous.py | 66 ----------- .../cifar10_ddpmpp_deep_continuous.py | 67 ----------- .../subvpsde/cifar10_ncsnpp_continuous.py | 65 ----------- .../cifar10_ncsnpp_deep_continuous.py | 67 ----------- .../vesde/bedroom_ncsnpp_continuous.py | 64 ---------- .../configs/vesde/celeba_ncsnpp.py | 61 ---------- .../vesde/celebahq_256_ncsnpp_continuous.py | 68 ----------- .../vesde/celebahq_ncsnpp_continuous.py | 110 ------------------ .../configs/vesde/church_ncsnpp_continuous.py | 65 ----------- .../configs/vesde/cifar10_ddpm.py | 50 -------- .../configs/vesde/cifar10_ncsnpp.py | 60 ---------- .../vesde/cifar10_ncsnpp_continuous.py | 59 ---------- .../vesde/cifar10_ncsnpp_deep_continuous.py | 61 ---------- .../vesde/ffhq_256_ncsnpp_continuous.py | 68 ----------- .../configs/vesde/ffhq_ncsnpp_continuous.py | 110 ------------------ .../configs/vesde/ncsn/__init__.py | 0 .../configs/vesde/ncsn/celeba.py | 57 --------- .../configs/vesde/ncsn/celeba_124.py | 56 --------- .../configs/vesde/ncsn/celeba_1245.py | 56 --------- .../configs/vesde/ncsn/celeba_5.py | 57 --------- .../configs/vesde/ncsn/cifar10.py | 57 --------- .../configs/vesde/ncsn/cifar10_124.py | 56 --------- .../configs/vesde/ncsn/cifar10_1245.py | 62 ---------- .../configs/vesde/ncsn/cifar10_5.py | 57 --------- .../configs/vesde/ncsnv2/__init__.py | 0 .../configs/vesde/ncsnv2/bedroom.py | 63 ---------- .../configs/vesde/ncsnv2/celeba.py | 62 ---------- .../configs/vesde/ncsnv2/cifar10.py | 56 --------- .../configs/vpsde/cifar10_ddpmpp.py | 66 ----------- .../vpsde/cifar10_ddpmpp_continuous.py | 66 ----------- .../vpsde/cifar10_ddpmpp_deep_continuous.py | 67 ----------- .../configs/vpsde/cifar10_ncsnpp.py | 65 ----------- .../vpsde/cifar10_ncsnpp_continuous.py | 65 ----------- .../vpsde/cifar10_ncsnpp_deep_continuous.py | 67 ----------- .../configs/vpsde/ddpm/bedroom.py | 61 ---------- .../configs/vpsde/ddpm/celebahq.py | 63 ---------- .../configs/vpsde/ddpm/church.py | 61 ---------- .../configs/vpsde/ddpm/cifar10.py | 55 --------- .../configs/vpsde/ddpm/cifar10_continuous.py | 55 --------- .../vpsde/ddpm/cifar10_unconditional.py | 55 --------- 44 files changed, 2697 deletions(-) delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_celeba_configs.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_cifar10_configs.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_lsun_configs.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpm_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_deep_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_deep_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/bedroom_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celeba_ncsnpp.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_256_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/church_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ddpm.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_deep_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_256_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/__init__.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_124.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_1245.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_5.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_124.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_1245.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_5.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/__init__.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/bedroom.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/celeba.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/cifar10.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_deep_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_deep_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/bedroom.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/celebahq.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/church.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_continuous.py delete mode 100644 src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_unconditional.py diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_celeba_configs.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_celeba_configs.py deleted file mode 100644 index 1fa5b806c..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_celeba_configs.py +++ /dev/null @@ -1,72 +0,0 @@ -import ml_collections -import torch - - -def get_default_configs(): - config = ml_collections.ConfigDict() - # training - config.training = training = ml_collections.ConfigDict() - config.training.batch_size = 128 - training.n_iters = 1300001 - training.snapshot_freq = 50000 - training.log_freq = 50 - training.eval_freq = 100 - ## store additional checkpoints for preemption in cloud computing environments - training.snapshot_freq_for_preemption = 10000 - ## produce samples at each snapshot. - training.snapshot_sampling = True - training.likelihood_weighting = False - training.continuous = True - training.reduce_mean = False - - # sampling - config.sampling = sampling = ml_collections.ConfigDict() - sampling.n_steps_each = 1 - sampling.noise_removal = True - sampling.probability_flow = False - sampling.snr = 0.17 - - # evaluation - config.eval = evaluate = ml_collections.ConfigDict() - evaluate.begin_ckpt = 1 - evaluate.end_ckpt = 26 - evaluate.batch_size = 1024 - evaluate.enable_sampling = True - evaluate.num_samples = 50000 - evaluate.enable_loss = True - evaluate.enable_bpd = False - evaluate.bpd_dataset = 'test' - - # data - config.data = data = ml_collections.ConfigDict() - data.dataset = 'CELEBA' - data.image_size = 64 - data.random_flip = True - data.uniform_dequantization = False - data.centered = False - data.num_channels = 3 - - # model - config.model = model = ml_collections.ConfigDict() - model.sigma_max = 90. - model.sigma_min = 0.01 - model.num_scales = 1000 - model.beta_min = 0.1 - model.beta_max = 20. - model.dropout = 0.1 - model.embedding_type = 'fourier' - - # optimization - config.optim = optim = ml_collections.ConfigDict() - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 2e-4 - optim.beta1 = 0.9 - optim.eps = 1e-8 - optim.warmup = 5000 - optim.grad_clip = 1. - - config.seed = 42 - config.device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu') - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_cifar10_configs.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_cifar10_configs.py deleted file mode 100644 index 287cddebf..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_cifar10_configs.py +++ /dev/null @@ -1,72 +0,0 @@ -import ml_collections -import torch - - -def get_default_configs(): - config = ml_collections.ConfigDict() - # training - config.training = training = ml_collections.ConfigDict() - config.training.batch_size = 128 - training.n_iters = 1300001 - training.snapshot_freq = 50000 - training.log_freq = 50 - training.eval_freq = 100 - ## store additional checkpoints for preemption in cloud computing environments - training.snapshot_freq_for_preemption = 10000 - ## produce samples at each snapshot. - training.snapshot_sampling = True - training.likelihood_weighting = False - training.continuous = True - training.reduce_mean = False - - # sampling - config.sampling = sampling = ml_collections.ConfigDict() - sampling.n_steps_each = 1 - sampling.noise_removal = True - sampling.probability_flow = False - sampling.snr = 0.16 - - # evaluation - config.eval = evaluate = ml_collections.ConfigDict() - evaluate.begin_ckpt = 9 - evaluate.end_ckpt = 26 - evaluate.batch_size = 1024 - evaluate.enable_sampling = False - evaluate.num_samples = 50000 - evaluate.enable_loss = True - evaluate.enable_bpd = False - evaluate.bpd_dataset = 'test' - - # data - config.data = data = ml_collections.ConfigDict() - data.dataset = 'CIFAR10' - data.image_size = 32 - data.random_flip = True - data.centered = False - data.uniform_dequantization = False - data.num_channels = 3 - - # model - config.model = model = ml_collections.ConfigDict() - model.sigma_min = 0.01 - model.sigma_max = 50 - model.num_scales = 1000 - model.beta_min = 0.1 - model.beta_max = 20. - model.dropout = 0.1 - model.embedding_type = 'fourier' - - # optimization - config.optim = optim = ml_collections.ConfigDict() - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 2e-4 - optim.beta1 = 0.9 - optim.eps = 1e-8 - optim.warmup = 5000 - optim.grad_clip = 1. - - config.seed = 42 - config.device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu') - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_lsun_configs.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_lsun_configs.py deleted file mode 100644 index ca079dda7..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/default_lsun_configs.py +++ /dev/null @@ -1,72 +0,0 @@ -import ml_collections -import torch - - -def get_default_configs(): - config = ml_collections.ConfigDict() - # training - config.training = training = ml_collections.ConfigDict() - config.training.batch_size = 64 - training.n_iters = 2400001 - training.snapshot_freq = 50000 - training.log_freq = 50 - training.eval_freq = 100 - ## store additional checkpoints for preemption in cloud computing environments - training.snapshot_freq_for_preemption = 5000 - ## produce samples at each snapshot. - training.snapshot_sampling = True - training.likelihood_weighting = False - training.continuous = True - training.reduce_mean = False - - # sampling - config.sampling = sampling = ml_collections.ConfigDict() - sampling.n_steps_each = 1 - sampling.noise_removal = True - sampling.probability_flow = False - sampling.snr = 0.075 - - # evaluation - config.eval = evaluate = ml_collections.ConfigDict() - evaluate.begin_ckpt = 50 - evaluate.end_ckpt = 96 - evaluate.batch_size = 512 - evaluate.enable_sampling = True - evaluate.num_samples = 50000 - evaluate.enable_loss = True - evaluate.enable_bpd = False - evaluate.bpd_dataset = 'test' - - # data - config.data = data = ml_collections.ConfigDict() - data.dataset = 'LSUN' - data.image_size = 256 - data.random_flip = True - data.uniform_dequantization = False - data.centered = False - data.num_channels = 3 - - # model - config.model = model = ml_collections.ConfigDict() - model.sigma_max = 378 - model.sigma_min = 0.01 - model.num_scales = 2000 - model.beta_min = 0.1 - model.beta_max = 20. - model.dropout = 0. - model.embedding_type = 'fourier' - - # optimization - config.optim = optim = ml_collections.ConfigDict() - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 2e-4 - optim.beta1 = 0.9 - optim.eps = 1e-8 - optim.warmup = 5000 - optim.grad_clip = 1. - - config.seed = 42 - config.device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu') - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpm_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpm_continuous.py deleted file mode 100644 index 8e9bd5c7c..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpm_continuous.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training DDPM with sub-VP SDE.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - - # training - training = config.training - training.sde = 'subvpsde' - training.continuous = True - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_continuous.py deleted file mode 100644 index 6ce7ed075..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_continuous.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSNv3 on CIFAR-10 with continuous sigmas.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'subvpsde' - training.continuous = True - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = False - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'none' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.embedding_type = 'positional' - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_deep_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_deep_continuous.py deleted file mode 100644 index dfc5c3437..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ddpmpp_deep_continuous.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSNv3 on CIFAR-10 with continuous sigmas.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'subvpsde' - training.continuous = True - training.reduce_mean = True - training.n_iters = 950001 - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 8 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = False - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'none' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.embedding_type = 'positional' - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_continuous.py deleted file mode 100644 index 49d94b720..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_continuous.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10 with sub-VP SDE.""" -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'subvpsde' - training.continuous = True - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.embedding_type = 'positional' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_deep_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_deep_continuous.py deleted file mode 100644 index 6fb856272..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/subvpsde/cifar10_ncsnpp_deep_continuous.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'subvpsde' - training.continuous = True - training.n_iters = 950001 - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.fourier_scale = 16 - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 8 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.embedding_type = 'positional' - model.init_scale = 0.0 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/bedroom_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/bedroom_ncsnpp_continuous.py deleted file mode 100644 index 9ef25e58a..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/bedroom_ncsnpp_continuous.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on bedroom with VE SDE.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # data - data = config.data - data.category = 'bedroom' - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 1, 2, 2, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'output_skip' - model.progressive_input = 'input_skip' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celeba_ncsnpp.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celeba_ncsnpp.py deleted file mode 100644 index 4ab338fd0..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celeba_ncsnpp.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CelebA with SMLD.""" - -from configs.default_celeba_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = True - model.sigma_begin = 90 - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0.0 - model.conv_size = 3 - model.embedding_type = 'positional' - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_256_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_256_ncsnpp_continuous.py deleted file mode 100644 index 59d11d668..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_256_ncsnpp_continuous.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on Church with VE SDE.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # data - data = config.data - data.dataset = 'CelebAHQ' - data.image_size = 256 - data.tfrecords_path = '/home/yangsong/ncsc/celebahq/r08.tfrecords' - - - # model - model = config.model - model.name = 'ncsnpp' - model.sigma_max = 348 - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 1, 2, 2, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'output_skip' - model.progressive_input = 'input_skip' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_ncsnpp_continuous.py deleted file mode 100644 index 31a37693b..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/celebahq_ncsnpp_continuous.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CelebAHQ with VE SDE.""" - -import ml_collections -import torch - - -def get_config(): - config = ml_collections.ConfigDict() - # training - config.training = training = ml_collections.ConfigDict() - training.batch_size = 8 - training.n_iters = 2400001 - training.snapshot_freq = 50000 - training.log_freq = 50 - training.eval_freq = 100 - training.snapshot_freq_for_preemption = 5000 - training.snapshot_sampling = True - training.sde = 'vesde' - training.continuous = True - training.likelihood_weighting = False - training.reduce_mean = False - - # sampling - config.sampling = sampling = ml_collections.ConfigDict() - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - sampling.probability_flow = False - sampling.snr = 0.15 - sampling.n_steps_each = 1 - sampling.noise_removal = True - - # eval - config.eval = evaluate = ml_collections.ConfigDict() - evaluate.batch_size = 1024 - evaluate.num_samples = 50000 - evaluate.begin_ckpt = 1 - evaluate.end_ckpt = 96 - - # data - config.data = data = ml_collections.ConfigDict() - data.dataset = 'CelebAHQ' - data.image_size = 1024 - data.centered = False - data.random_flip = True - data.uniform_dequantization = False - data.num_channels = 3 - data.tfrecords_path = '/atlas/u/yangsong/celeba_hq/-r10.tfrecords' - - # model - config.model = model = ml_collections.ConfigDict() - model.name = 'ncsnpp' - model.scale_by_sigma = True - model.sigma_max = 1348 - model.num_scales = 2000 - model.ema_rate = 0.9999 - model.sigma_min = 0.01 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 16 - model.ch_mult = (1, 2, 4, 8, 16, 32, 32, 32) - model.num_res_blocks = 1 - model.attn_resolutions = (16,) - model.dropout = 0. - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'output_skip' - model.progressive_input = 'input_skip' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - model.embedding_type = 'fourier' - - # optim - config.optim = optim = ml_collections.ConfigDict() - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 2e-4 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 5000 - optim.grad_clip = 1. - - config.seed = 42 - config.device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu') - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/church_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/church_ncsnpp_continuous.py deleted file mode 100644 index f133dcf54..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/church_ncsnpp_continuous.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on Church with VE SDE.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # data - data = config.data - data.category = 'church_outdoor' - - # model - model = config.model - model.name = 'ncsnpp' - model.sigma_max = 380 - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 1, 2, 2, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'output_skip' - model.progressive_input = 'input_skip' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ddpm.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ddpm.py deleted file mode 100644 index 81387d941..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ddpm.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Train the original DDPM model with SMLD.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp.py deleted file mode 100644 index 8cc8f7a15..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10 with SMLD.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0.0 - model.embedding_type = 'positional' - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_continuous.py deleted file mode 100644 index 0b9f2faae..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_continuous.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10 with VE SDE.""" -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_deep_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_deep_continuous.py deleted file mode 100644 index 910e93e22..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/cifar10_ncsnpp_deep_continuous.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10 with VE SDE.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = True - training.n_iters = 950001 - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # model - model = config.model - model.name = 'ncsnpp' - model.fourier_scale = 16 - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 8 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0.0 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_256_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_256_ncsnpp_continuous.py deleted file mode 100644 index 265a584f8..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_256_ncsnpp_continuous.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on Church with VE SDE.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - - # data - data = config.data - data.dataset = 'FFHQ' - data.image_size = 256 - data.tfrecords_path = '/home/yangsong/ncsc/ffhq/ffhq-r08.tfrecords' - - - # model - model = config.model - model.name = 'ncsnpp' - model.sigma_max = 348 - model.scale_by_sigma = True - model.ema_rate = 0.999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 1, 2, 2, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'output_skip' - model.progressive_input = 'input_skip' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_ncsnpp_continuous.py deleted file mode 100644 index cf2dd7c41..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ffhq_ncsnpp_continuous.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on FFHQ with VE SDEs.""" - -import ml_collections -import torch - -def get_config(): - config = ml_collections.ConfigDict() - # training - config.training = training = ml_collections.ConfigDict() - training.batch_size = 8 - training.n_iters = 2400001 - training.snapshot_freq = 50000 - training.log_freq = 50 - training.eval_freq = 100 - training.snapshot_freq_for_preemption = 5000 - training.snapshot_sampling = True - training.sde = 'vesde' - training.continuous = True - training.likelihood_weighting = False - training.reduce_mean = True - - # sampling - config.sampling = sampling = ml_collections.ConfigDict() - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'langevin' - sampling.probability_flow = False - sampling.snr = 0.15 - sampling.n_steps_each = 1 - sampling.noise_removal = True - - # eval - config.eval = evaluate = ml_collections.ConfigDict() - evaluate.batch_size = 1024 - evaluate.num_samples = 50000 - evaluate.begin_ckpt = 1 - evaluate.end_ckpt = 96 - - # data - config.data = data = ml_collections.ConfigDict() - data.dataset = 'FFHQ' - data.image_size = 1024 - data.centered = False - data.random_flip = True - data.uniform_dequantization = False - data.num_channels = 3 - # Plug in your own path to the tfrecords file. - data.tfrecords_path = '/raid/song/ffhq-dataset/ffhq/ffhq-r10.tfrecords' - - # model - config.model = model = ml_collections.ConfigDict() - model.name = 'ncsnpp' - model.scale_by_sigma = True - model.sigma_max = 1348 - model.num_scales = 2000 - model.ema_rate = 0.9999 - model.sigma_min = 0.01 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 16 - model.ch_mult = (1, 2, 4, 8, 16, 32, 32, 32) - model.num_res_blocks = 1 - model.attn_resolutions = (16,) - model.dropout = 0. - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'output_skip' - model.progressive_input = 'input_skip' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - model.embedding_type = 'fourier' - - # optim - config.optim = optim = ml_collections.ConfigDict() - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 2e-4 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 5000 - optim.grad_clip = 1. - - config.seed = 42 - config.device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu') - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/__init__.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba.py deleted file mode 100644 index 903775a15..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for reproducing NCSNv1 on CelebA.""" - -from configs.default_celeba_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.loss = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 100 - sampling.snr = 0.316 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.sigma_max = 1 - model.num_scales = 10 - model.ema_rate = 0. - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_124.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_124.py deleted file mode 100644 index c40ef7cf8..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_124.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSN with technique 1,2,4 only.""" - -from configs.default_celeba_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 5 - sampling.snr = 0.128 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.num_scales = 500 - model.ema_rate = 0. - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_1245.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_1245.py deleted file mode 100644 index d7463ae5f..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_1245.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSN with technique 1245 only.""" - -from configs.default_celeba_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 5 - sampling.snr = 0.128 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.num_scales = 500 - model.ema_rate = 0.999 - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_5.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_5.py deleted file mode 100644 index a3a6fd9ea..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/celeba_5.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSNv1 model with technique 5 only.""" - -from configs.default_celeba_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 100 - sampling.snr = 0.316 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.sigma_max = 1. - model.num_scales = 10 - model.ema_rate = 0.999 - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10.py deleted file mode 100644 index b887d6881..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for reproducing NCSNv1 on CIFAR-10.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 100 - sampling.snr = 0.316 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.sigma_max = 1 - model.num_scales = 10 - model.ema_rate = 0. - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_124.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_124.py deleted file mode 100644 index 423094fab..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_124.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSN with technique 1,2,4 only.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 5 - sampling.snr = 0.176 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.num_scales = 232 - model.ema_rate = 0. - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_1245.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_1245.py deleted file mode 100644 index 19bff349a..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_1245.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSN with technique 1,2,4,5 only.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # shared configs for sample generation - step_size = 0.0000062 - n_steps_each = 5 - ckpt_id = 300000 - final_only = True - noise_removal = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 5 - sampling.snr = 0.176 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.num_scales = 232 - model.ema_rate = 0.999 - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_5.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_5.py deleted file mode 100644 index c641a2a18..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsn/cifar10_5.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSN with technique 5 only.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.snr = 0.316 - sampling.n_steps_each = 100 - # model - model = config.model - model.name = 'ncsn' - model.scale_by_sigma = False - model.sigma_max = 1 - model.num_scales = 10 - model.ema_rate = 0.999 - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-3 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/__init__.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/bedroom.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/bedroom.py deleted file mode 100644 index 893e61437..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/bedroom.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSNv2 on bedroom.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.batch_size = 128 - training.sde = 'vesde' - training.continuouse = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 3 - sampling.snr = 0.095 - # data - data = config.data - data.category = 'bedroom' - data.image_size = 128 - # model - model = config.model - model.name = 'ncsnv2_128' - model.scale_by_sigma = True - model.sigma_max = 190 - model.num_scales = 1086 - model.ema_rate = 0.9999 - model.sigma_min = 0.01 - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-4 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/celeba.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/celeba.py deleted file mode 100644 index d7b79aaae..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/celeba.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSNv2 on CelebA.""" - -from configs.default_celeba_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # shared configs for sample generation - step_size = 0.0000033 - n_steps_each = 5 - ckpt_id = 210000 - final_only = True - noise_removal = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 5 - sampling.snr = 0.128 - # model - model = config.model - model.name = 'ncsnv2_64' - model.scale_by_sigma = True - model.num_scales = 500 - model.ema_rate = 0.999 - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-4 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/cifar10.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/cifar10.py deleted file mode 100644 index 5d87c5eac..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vesde/ncsnv2/cifar10.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for training NCSNv2 on CIFAR-10.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vesde' - training.continuous = False - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'none' - sampling.corrector = 'ald' - sampling.n_steps_each = 5 - sampling.snr = 0.176 - # model - model = config.model - model.name = 'ncsnv2_64' - model.scale_by_sigma = True - model.num_scales = 232 - model.ema_rate = 0.999 - model.normalization = 'InstanceNorm++' - model.nonlinearity = 'elu' - model.nf = 128 - model.interpolation = 'bilinear' - # optim - optim = config.optim - optim.weight_decay = 0 - optim.optimizer = 'Adam' - optim.lr = 1e-4 - optim.beta1 = 0.9 - optim.amsgrad = False - optim.eps = 1e-8 - optim.warmup = 0 - optim.grad_clip = -1. - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp.py deleted file mode 100644 index ccdcef4ab..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSNv3 on CIFAR-10 with continuous sigmas.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vpsde' - training.continuous = False - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'ancestral_sampling' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = False - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'none' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.embedding_type = 'positional' - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_continuous.py deleted file mode 100644 index 1936916b9..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_continuous.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSNv3 on CIFAR-10 with continuous sigmas.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vpsde' - training.continuous = True - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = False - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'none' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.embedding_type = 'positional' - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_deep_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_deep_continuous.py deleted file mode 100644 index 3cf7fd3c9..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ddpmpp_deep_continuous.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSNv3 on CIFAR-10 with continuous sigmas.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vpsde' - training.continuous = True - training.reduce_mean = True - training.n_iters = 950001 - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 8 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = False - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'none' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0. - model.embedding_type = 'positional' - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp.py deleted file mode 100644 index bee2f10b9..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10 with DDPM.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vpsde' - training.continuous = False - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'reverse_diffusion' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.init_scale = 0.0 - model.embedding_type = 'positional' - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_continuous.py deleted file mode 100644 index 8ea9fe495..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_continuous.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10 with VP SDE.""" -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vpsde' - training.continuous = True - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 4 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.embedding_type = 'positional' - model.init_scale = 0. - model.fourier_scale = 16 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_deep_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_deep_continuous.py deleted file mode 100644 index 59eb95971..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/cifar10_ncsnpp_deep_continuous.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training NCSN++ on CIFAR-10.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - # training - training = config.training - training.sde = 'vpsde' - training.continuous = True - training.n_iters = 950001 - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ncsnpp' - model.fourier_scale = 16 - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 8 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - model.fir = True - model.fir_kernel = [1, 3, 3, 1] - model.skip_rescale = True - model.resblock_type = 'biggan' - model.progressive = 'none' - model.progressive_input = 'residual' - model.progressive_combine = 'sum' - model.attention_type = 'ddpm' - model.embedding_type = 'positional' - model.init_scale = 0.0 - model.conv_size = 3 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/bedroom.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/bedroom.py deleted file mode 100644 index 9a8405867..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/bedroom.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for reproducing the results of DDPM on bedrooms.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - - # training - training = config.training - training.sde = 'vpsde' - training.continuous = False - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'ancestral_sampling' - sampling.corrector = 'none' - - # data - data = config.data - data.category = 'bedroom' - data.centered = True - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = False - model.num_scales = 1000 - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 1, 2, 2, 4, 4) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - - # optim - optim = config.optim - optim.lr = 2e-5 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/celebahq.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/celebahq.py deleted file mode 100644 index 29eba365b..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/celebahq.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for reproducing the results of DDPM on bedrooms.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - - # training - training = config.training - training.sde = 'vpsde' - training.continuous = False - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'ancestral_sampling' - sampling.corrector = 'none' - - # data - data = config.data - data.dataset = 'CelebAHQ' - data.centered = True - data.tfrecords_path = '/atlas/u/yangsong/celeba_hq/-r10.tfrecords' - data.image_size = 256 - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = False - model.num_scales = 1000 - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 1, 2, 2, 4, 4) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - - # optim - optim = config.optim - optim.lr = 2e-5 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/church.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/church.py deleted file mode 100644 index 24c4593a3..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/church.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for reproducing the results of DDPM on church_outdoor.""" - -from configs.default_lsun_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - - # training - training = config.training - training.sde = 'vpsde' - training.continuous = False - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'ancestral_sampling' - sampling.corrector = 'none' - - # data - data = config.data - data.category = 'church_outdoor' - data.centered = True - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = False - model.num_scales = 1000 - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 1, 2, 2, 4, 4) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - - # optim - optim = config.optim - optim.lr = 2e-5 - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10.py deleted file mode 100644 index 043cce757..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Config file for reproducing the results of DDPM on cifar-10.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - - # training - training = config.training - training.sde = 'vpsde' - training.continuous = False - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'ancestral_sampling' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_continuous.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_continuous.py deleted file mode 100644 index ee3d04186..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_continuous.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training DDPM with VP SDE.""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - - # training - training = config.training - training.sde = 'vpsde' - training.continuous = True - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'euler_maruyama' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = True - - return config diff --git a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_unconditional.py b/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_unconditional.py deleted file mode 100644 index e24722bda..000000000 --- a/src/ml_downscaling_emulator/score_sde_pytorch_hja22/configs/vpsde/ddpm/cifar10_unconditional.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# Copyright 2020 The Google Research Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Lint as: python3 -"""Training DDPM on CIFAR-10 without explicitly conditioning on time steps. (NCSNv2 technique 3)""" - -from configs.default_cifar10_configs import get_default_configs - - -def get_config(): - config = get_default_configs() - - # training - training = config.training - training.sde = 'vpsde' - training.continuous = False - training.reduce_mean = True - - # sampling - sampling = config.sampling - sampling.method = 'pc' - sampling.predictor = 'ancestral_sampling' - sampling.corrector = 'none' - - # data - data = config.data - data.centered = True - - # model - model = config.model - model.name = 'ddpm' - model.scale_by_sigma = False - model.ema_rate = 0.9999 - model.normalization = 'GroupNorm' - model.nonlinearity = 'swish' - model.nf = 128 - model.ch_mult = (1, 2, 2, 2) - model.num_res_blocks = 2 - model.attn_resolutions = (16,) - model.resamp_with_conv = True - model.conditional = False - - return config