nh_run

neuralhydrology.nh_run.continue_run(run_dir: Path, config_file: Path = None, gpu: int = None)

Continue model training.

Parameters:
  • run_dir (Path) – Path to the run directory.

  • config_file (Path, optional) – Path to an additional config file. Each config argument in this file will overwrite the original run config.

  • gpu (int, optional) – GPU id to use. Will override config argument ‘device’. A value smaller than zero indicates CPU.

neuralhydrology.nh_run.eval_run(run_dir: Path, period: str, epoch: int = None, gpu: int = None)

Start evaluating a trained model.

Parameters:
  • run_dir (Path) – Path to the run directory.

  • period ({'train', 'validation', 'test'}) – The period to evaluate.

  • epoch (int, optional) – Define a specific epoch to use. By default, the weights of the last epoch are used.

  • gpu (int, optional) – GPU id to use. Will override config argument ‘device’. A value less than zero indicates CPU.

neuralhydrology.nh_run.finetune(config_file: Path = None, gpu: int = None)

Finetune a pre-trained model.

Parameters:
  • config_file (Path, optional) – Path to an additional config file. Each config argument in this file will overwrite the original run config. The config file for finetuning must contain the argument base_run_dir, pointing to the folder of the pre-trained model, as well as ‘finetune_modules’ to indicate which model parts will be trained during fine-tuning.

  • gpu (int, optional) – GPU id to use. Will override config argument ‘device’. A value smaller than zero indicates CPU.

neuralhydrology.nh_run.start_run(config_file: Path, gpu: int = None)

Start training a model.

Parameters:
  • config_file (Path) – Path to a configuration file (.yml), defining the settings for the specific run.

  • gpu (int, optional) – GPU id to use. Will override config argument ‘device’. A value smaller than zero indicates CPU.