test
darts.legacy_training.test
¶
Testing scripts for DARTS.
test_smp
¶
test_smp(
*,
train_data_dir: pathlib.Path,
run_id: str,
run_name: str,
model_ckp: pathlib.Path | None = None,
batch_size: int = 8,
artifact_dir: pathlib.Path = pathlib.Path(
"lightning_logs"
),
num_workers: int = 0,
device: int | str = "auto",
wandb_entity: str | None = None,
wandb_project: str | None = None,
) -> pytorch_lightning.Trainer
Run the testing of the SMP model.
The data structure of the training data expects the "preprocessing" step to be done beforehand, which results in the following data structure:
preprocessed-data/ # the top-level directory
├── config.toml
├── cross-val.zarr/ # this zarr group contains the dataarrays x and y for the training and validation
├── test.zarr/ # this zarr group contains the dataarrays x and y for the left-out-region test set
├── val-test.zarr/ # this zarr group contains the dataarrays x and y for the random selected validation set
└── labels.geojson
Parameters:
-
train_data_dir
(pathlib.Path
) –Path to the training data directory (top-level).
-
run_id
(str
) –ID of the run.
-
run_name
(str
) –Name of the run.
-
model_ckp
(pathlib.Path | None
, default:None
) –Path to the model checkpoint. If None, try to find the latest checkpoint in
artifact_dir / run_name / run_id / checkpoints
. Defaults to None. -
batch_size
(int
, default:8
) –Batch size. Defaults to 8.
-
artifact_dir
(pathlib.Path
, default:pathlib.Path('lightning_logs')
) –Directory to save artifacts. Defaults to Path("lightning_logs").
-
num_workers
(int
, default:0
) –Number of workers for the DataLoader. Defaults to 0.
-
device
(int | str
, default:'auto'
) –Device to use. Defaults to "auto".
-
wandb_entity
(str | None
, default:None
) –WandB entity. Defaults to None.
-
wandb_project
(str | None
, default:None
) –WandB project. Defaults to None.
Returns:
-
Trainer
(pytorch_lightning.Trainer
) –The trainer object used for training.
Source code in darts/src/darts/legacy_training/test.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|