TerraTorch-iterate
A tool for benchmarking and hyper-parameter optimization using TerraTorch.
Leverages MLFlow for experiment logging, optuna for hyperparameter optimization and ray for parallelization.
Installation
We recommend using python 3.10, 3.11 or 3.12 and also using a virtual environment for all commands in this guide.
Package installation
pip install terratorch-iterate
Suggested setup for development
pip install --upgrade pip setuptools wheel
pip install -e .
pip install -e ".[dev]"
pip install -e ".[test]"
pip install -e ".[utilities]"
Usage
This tool allows you to design a benchmark test for a backbone that exists in TerraTorch over:
-
Several tasks
-
Several hyperparameter configurations
To do this it relies on a configuration file where the benchmark is defined. This consists of:
-
experiment_name: MLFLow experiment to run the benchmark on. This is the highest level grouping of runs in MLFLow. -
run_name: Name of the parent (top-level) run under the experiment. NOTE: This item should not be included in the config if you wish to use the parameters extraction function inmlfow_utilsto compile results. -
defaults: Defaults that are set for all tasks. Can be overriden under each task. -
tasks: List of tasks to perform. Tasks specify parameters for the decoder, datamodule to be used and training parameters. -
n_trials: Number of trials to be carried out per task, in the case of hyperparameter tuning. -
save_models: Whether to save models. Defaults to False. (Setting this to true can take up a lot of space). Models will be logged as artifacts for each run in MLFlow. -
storage_uri: Location to use for storage for mlflow. -
optimization_space: Hyperparameter space to search over. Bayesian optimization tends to work well with a small number of hyperparameters.
See benchmark_v2_template.yaml in the git repo for an example.
Besides the --config argument, terratorch-iterate also has two other arguments:
- if users include
--hpoargument, then terratorch-iterate will optimize hyperparameters. Otherwise, it will rerun best experiment - if users include
--repeatargument, then terratorch-iterate will repeat the best experiment. Otherwise, terratorch-iterate will not rerun any experiment
If users want to optimize hyperparameters:
terratorch iterate --hpo --config <config-file>
For instance:
terratorch iterate --hpo --config configs/dofa_large_patch16_224_upernetdecoder_true_modified.yaml
If users want to rerun best experiment:
terratorch iterate --repeat --config <config-file>
For instance:
terratorch iterate --repeat --config configs/dofa_large_patch16_224_upernetdecoder_true_modified.yaml
To check the experiment results, use mlflow ui --host $(hostname -f) --port <port> --backend-store-uri <storage_uri>
Ray
You can also parallelize your runs over a ray cluster.
Check out instructions in the docs
Metadata
Release files for terratorch-iterate 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| terratorch_iterate-0.1.1.tar.gz | 39.2 kB | Without provenance | Details for terratorch_iterate-0.1.1.tar.gz |
Release files / terratorch_iterate-0.1.1.tar.gz
| Download URL | terratorch_iterate-0.1.1.tar.gz |
|---|---|
| Size | 39.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa7057374d347ab570a22823e85152bc20ee0c7311b5503694c0b2ec25bd2f86
|
|
BLAKE2b-256 checksum How to use checksums |
490ad834b9703ddad2eb5d0401ee1610fece6b561aacb851ff731df037671348
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.7
|
Security for terratorch-iterate 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.