Stepper¶
samudra.stepper
¶
Time-stepping primitives for training, validation, and inference.
Provides module-level functions that handle single-step forward passes
(train_batch, validate_batch) and multi-step autoregressive
rollouts (run_rollout).
validate_rollout(model, dataset, aggregators_by_step, epoch, *, num_model_steps, num_model_steps_forward)
¶
Run a bounded autoregressive validation rollout and record RMSE metrics.
aggregators_by_step maps a rollout horizon, in model steps, to the
aggregator that should record metrics for that horizon.
Source code in src/samudra/stepper.py
run_rollout(model, dataset, inf_aggregator, epoch, output_dir=None, model_path=None, num_model_steps_forward=200, save_zarr=False, data_layout=None, preprocessor=None)
¶
Performs inference, which is an auto-regressive rollout.
Source code in src/samudra/stepper.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | |