forked from yang-song/score_sde_pytorch
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65cb649
commit a2fd23d
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/ml_downscaling_emulator/score_sde_pytorch/configs/deterministic/ukcp_local_pr_debug.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# coding=utf-8 | ||
# Copyright 2020 The Google Research Authors. | ||
# Modifications copyright 2024 Henry Addison | ||
# | ||
# 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 | ||
"""Debug config for training in a deterministic fashion.""" | ||
|
||
from ml_downscaling_emulator.score_sde_pytorch.configs.deterministic.default_configs import get_default_configs | ||
|
||
def get_config(): | ||
config = get_default_configs() | ||
|
||
# training | ||
training = config.training | ||
training.n_epochs = 2 | ||
training.snapshot_freq = 5 | ||
training.eval_freq = 100 | ||
training.log_freq = 50 | ||
training.batch_size = 2 | ||
|
||
# data | ||
data = config.data | ||
data.dataset_name = 'debug-sample' | ||
data.time_inputs=True | ||
|
||
# model | ||
model = config.model | ||
model.name = 'cunet' | ||
|
||
return config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
config_name="ukcp_local_pr_debug" | ||
|
||
workdir="output/test/deterministic/${config_name}/test-run" | ||
config_path="src/ml_downscaling_emulator/score_sde_pytorch/configs/deterministic/${config_name}.py" | ||
|
||
loc_spec_channels=0 | ||
|
||
rm -rf ${workdir} | ||
WANDB_EXPERIMENT_NAME="test" python bin/main.py --workdir ${workdir} --config ${config_path} --mode train --config.model.loc_spec_channels=${loc_spec_channels} | ||
|
||
num_samples=2 | ||
eval_batch_size=32 | ||
checkpoint="epoch_${epoch}" | ||
|
||
rm -rf "${workdir}/samples/${checkpoint}/${dataset}" | ||
python bin/predict.py ${workdir} --dataset ${dataset} --checkpoint ${checkpoint} --batch-size ${eval_batch_size} --num-samples ${num_samples} --ensemble-member 01 |