From 1c68ed397e30909d43462fe598cdb5a07acb12bb Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 3 Apr 2024 16:27:39 +0200 Subject: [PATCH] Add arguments as a yaml --- map2map/common_args.yaml | 88 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 map2map/common_args.yaml diff --git a/map2map/common_args.yaml b/map2map/common_args.yaml new file mode 100644 index 0000000..0d0e18b --- /dev/null +++ b/map2map/common_args.yaml @@ -0,0 +1,88 @@ +arguments: + - 'in-norms': + type: str_list + help: 'comma-sep. list of input normalization functions' + - 'tgt-norms': + type: str_list + help: 'comma-sep. list of target normalization functions' + - 'crop': + type: int_tuple + help: 'size to crop the input and target data. Default is the field size. Comma-sep. list of 1 or d integers' + - 'crop-start': + type: int_tuple + help: 'starting point of the first crop. Default is the origin. Comma-sep. list of 1 or d integers' + - 'crop-stop': + type: int_tuple + help: 'stopping point of the last crop. Default is the opposite corner to the origin. Comma-sep. list of 1 or d integers' + - 'crop-step': + type: int_tuple + help: 'spacing between crops. Default is the crop size. Comma-sep. list of 1 or d integers' + - 'in-pad': + 'pad': 0 + type: int_tuple + help: 'size to pad the input data beyond the crop size, assuming periodic boundary condition. Comma-sep. list of 1, d, or dx2 integers, to pad equally along all axes, symmetrically on each, or by the specified size on every boundary, respectively' + - 'tgt-pad': + default: 0 + type: int_tuple + help: 'size to pad the target data beyond the crop size, assuming periodic boundary condition, useful for super-resolution. Comma-sep. list with the same format as in-pad' + - 'scale-factor': + default: 1 + type: int + help: 'upsampling factor for super-resolution, in which case crop and pad are sizes of the input resolution' + - 'model': + type: str + required: true + help: '(generator) model' + - 'criterion': + default: 'MSELoss' + type: str + help: 'loss function' + - 'load-state': + default: ckpt_link + type: str + help: 'path to load the states of model, optimizer, rng, etc. Default is the checkpoint. Start from scratch in case of empty string or missing checkpoint' + - 'load-state-non-strict': + action: 'store_false' + help: 'allow incompatible keys when loading model states' + dest: 'load_state_strict' + - 'batch-size': + 'batches': 0 + type: int + required: true + help: 'mini-batch size, per GPU in training or in total in testing' + - 'loader-workers': + default: 8 + type: int + help: 'number of subprocesses per data loader. 0 to disable multiprocessing' + - 'callback-at': + type: 'lambda s: os.path.abspath(s)' + help: 'directory of custorm code defining callbacks for models, norms, criteria, and optimizers. Disabled if not set. This is appended to the default locations, thus has the lowest priority' + - 'misc-kwargs': + default: '{}' + type: json.loads + help: 'miscellaneous keyword arguments for custom models and norms. Be careful with name collisions' + arguments: + - 'optimizer': + default: 'Adam' + type: str + help: 'optimizer for training' + - 'learning-rate': + default: 0.001 + type: float + help: 'learning rate for training' + - 'num-epochs': + default: 100 + type: int + help: 'number of training epochs' + - 'save-interval': + default: 10 + type: int + help: 'interval for saving checkpoints during training' + - 'log-interval': + default: 10 + type: int + help: 'interval for logging training progress' + - 'device': + default: 'cuda' + type: str + help: 'device for training (cuda or cpu)' \ No newline at end of file