Experiment Grid
SRToolkit.experiments.experiment_grid
Job-based experiment runner for symbolic regression experiments.
Provides three public classes:
- ExperimentInfo — lightweight metadata (seed, paths) for a single run.
- ExperimentJob — one atomic experiment: a single dataset × approach × seed triple. Can be run in-process or dispatched to a CLI worker.
- ExperimentGrid — a full cross-product grid of datasets and approaches. Manages serialization, parallelism via HPC command files, progress tracking, and result loading.
ExperimentInfo
dataclass
ExperimentInfo(seed: int, result_path: str, top_k: int = 20, adapted_state_path: Optional[str] = None)
Metadata for a single experiment run.
Holds all job-specific information not contained in the dataset or approach
config: the random seed, the path where the result should be written, how many top
expressions to keep, and — for approaches with adaptation_scope="once" — where
the pre-adapted state is stored.
ExperimentGrid builds these in memory inside
build_job — both
create_jobs and the run_job CLI
derive the seed and result path from the grid plus the (dataset, approach, seed)
identifiers, so no per-job info files are written to disk.
Examples:
>>> info = ExperimentInfo(seed=42, result_path="/results/exp_42.json")
>>> info.seed
42
>>> info.top_k
20
>>> d = info.to_dict()
>>> ExperimentInfo.from_dict(d) == info
True
Attributes:
| Name | Type | Description |
|---|---|---|
seed |
int
|
Random seed passed to the evaluator and the approach's |
result_path |
str
|
File path where the result JSON will be written. If a directory is
passed to ExperimentJob, the filename
|
top_k |
int
|
Number of top-ranked expressions to retain in the result. Default |
adapted_state_path |
Optional[str]
|
Base path to the pre-adapted state for |
to_dict
Serialise to a JSON-safe dictionary.
Returns:
| Type | Description |
|---|---|
dict
|
A flat dictionary with keys |
Source code in SRToolkit/experiments/experiment_grid.py
from_dict
classmethod
Restore an ExperimentInfo from a dictionary produced by to_dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
d
|
dict
|
Dictionary with keys |
required |
Returns:
| Type | Description |
|---|---|
ExperimentInfo
|
The reconstructed ExperimentInfo. |
Source code in SRToolkit/experiments/experiment_grid.py
ExperimentJob
ExperimentJob(dataset: Union[SR_dataset, str, dict], approach: Union[SR_approach, str, dict], info: Union[ExperimentInfo, str, dict], callbacks: Optional[Union[SRCallbacks, List[SRCallbacks], dict, List[dict]]] = None)
A single atomic experiment: one dataset × one approach × one seed.
An ExperimentJob is built from three components:
- dataset: the dataset to evaluate on — an
SR_datasetinstance, a path to aSR_dataset.to_dict()JSON file, or the dict itself. - approach: the SR approach — an
SR_approachinstance, a path to anApproachConfig.to_dict()JSON file, or the dict itself. - info: job metadata — an ExperimentInfo instance,
a path to an
ExperimentInfo.to_dict()JSON file, or the dict itself.
For Python use, you can pass instances directly::
job = ExperimentJob(my_dataset, my_approach,
ExperimentInfo(seed=0, result_path="/out/"))
job.run()
Within a grid you rarely build these by hand —
ExperimentGrid.build_job assembles
one from the grid's stored configs, which is also how the run_job CLI executes a
single (dataset, approach, seed) triple from just the grid.json file.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset_name |
str
|
Name of the dataset, resolved at construction time. |
approach_name |
str
|
Name of the approach, resolved at construction time. |
seed |
Random seed (from |
|
result_path |
File path where the experiment result is saved (from |
|
info |
The ExperimentInfo for this job. |
|
is_complete |
bool
|
|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Union[SR_dataset, str, dict]
|
The dataset. One of:
|
required |
approach
|
Union[SR_approach, str, dict]
|
The SR approach. One of:
|
required |
info
|
Union[ExperimentInfo, str, dict]
|
Job metadata. One of:
|
required |
callbacks
|
Optional[Union[SRCallbacks, List[SRCallbacks], dict, List[dict]]]
|
Optional callbacks to attach during
run. Accepts a single
SRCallbacks instance, a list
of instances, a single serialised callback dict, or a list of dicts.
Instances are serialised to dicts immediately so that
run always reconstructs fresh
instances (no shared state between jobs). Defaults to |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in SRToolkit/experiments/experiment_grid.py
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | |
is_complete
property
True if the result file at result_path already exists on disk.
run
Execute this experiment and save the result to result_path.
Handles adaptation according to SR_approach.adaptation_scope:
"never": no adaptation."once": loads pre-adapted state from ExperimentInfo'sadapted_state_pathif a path is set and the file exists, otherwise adapts (and saves if a path is set)."experiment": adapts fresh every run.
The result is saved via
SR_results.save to result_path.
Source code in SRToolkit/experiments/experiment_grid.py
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | |
ExperimentGrid
ExperimentGrid(datasets: Union[SR_dataset, List[Union[SR_dataset, SR_benchmark]], SR_benchmark], approaches: Union[SR_approach, List[SR_approach]], num_experiments: int, results_dir: str, initial_seed: int = 0, top_k: int = 20, adapted_states: Optional[Dict[str, Dict[str, str]]] = None, callbacks: Optional[Union[SRCallbacks, List[SRCallbacks]]] = None)
Defines and manages a grid of symbolic regression experiments across multiple datasets and approaches.
Each experiment is an independent
ExperimentJob that runs one approach on one
dataset with one seed. Jobs can be executed locally (iterate and call
.run()) or on HPC clusters (generate a commands file with
save_commands).
The grid spec is persisted via save and
reloaded via load. Results are saved
per-experiment to results_dir/{dataset}/{approach}/exp_{seed}.json,
so parallel workers never write to the same file.
Seed scheme: job i (0-indexed) receives seed = initial_seed + i.
Examples:
>>> from SRToolkit.dataset import Nguyen
>>> from SRToolkit.approaches import ProGED
>>> from SRToolkit.experiments import ExperimentGrid
>>> bench = Nguyen()
>>> approach = ProGED()
>>> grid = ExperimentGrid(bench, approach, num_experiments=3,
... results_dir="/tmp/sr_run")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datasets
|
Union[SR_dataset, List[Union[SR_dataset, SR_benchmark]], SR_benchmark]
|
One or more datasets to run experiments on. Accepts a single
SR_dataset, a
SR_benchmark (all
datasets in the benchmark are included), or a list containing
|
required |
approaches
|
Union[SR_approach, List[SR_approach]]
|
One or more SR approaches. Accepts a single SR_approach or a list of them. |
required |
num_experiments
|
int
|
Number of independent experiments per (dataset, approach) pair. |
required |
results_dir
|
str
|
Root directory where all results and grid metadata are stored. |
required |
initial_seed
|
int
|
Seed for the first experiment. Subsequent experiments use
|
0
|
top_k
|
int
|
Number of top expressions to highlight per experiment. |
20
|
adapted_states
|
Optional[Dict[str, Dict[str, str]]]
|
Optional mapping |
None
|
callbacks
|
Optional[Union[SRCallbacks, List[SRCallbacks]]]
|
Optional callback or list of callbacks forwarded to every job
created by create_jobs.
Callbacks are serialised to dicts immediately so that each job reconstructs
fresh instances in run (no shared
state between jobs). They are inlined into the grid recipe by
to_dict, so they travel inside
|
None
|
Source code in SRToolkit/experiments/experiment_grid.py
add_approach
Add an approach to the grid.
The approach's config is serialised immediately (its adaptation_scope is
recorded alongside) so the grid never caches a live instance. Safe to call after
from_dict to extend a loaded grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
approach
|
SR_approach
|
The SR_approach to add. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If an approach with the same |
Source code in SRToolkit/experiments/experiment_grid.py
add_dataset
Add a dataset, or every dataset in a benchmark, to the grid.
Each dataset is serialised immediately to its config dict (no data arrays embedded). Safe to call after from_dict to extend a loaded grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Union[SR_dataset, SR_benchmark]
|
An SR_dataset or an SR_benchmark (all of its datasets are added). |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a dataset name already exists in the grid, or if |
Source code in SRToolkit/experiments/experiment_grid.py
materialize_data
Materialise every dataset's data into the local cache, once, in this process.
Reconstructing each dataset via
SR_dataset.from_dict triggers
its data_source to download or sample the arrays into the shared data cache (a
no-op for datasets already cached). Because this runs single-process, it is
race-free — the intended counterpart to running it before parallel workers, which
then only read the cache rather than each materialising the same dataset.
save_commands calls this by
default, so the data is obtained once on the machine that writes the commands
(which, on a cluster, is typically the only node with network access for
UrlSource datasets).
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If a |
Source code in SRToolkit/experiments/experiment_grid.py
adapt_one
Adapt a single (approach, dataset) pair and persist its state.
This is the unit the per-pair adaptation commands in prepare.txt invoke (via the
adapt CLI with --dataset/--approach), so independent pairs can adapt in
parallel across a cluster. It loads the dataset, calls
adapt, and saves the state via
save_adapted_state.
Silently returns (no-op) when there is nothing to do: the approach is not
"once"-scope, or has no registered state path for this dataset. By default it also
no-ops when the state file already exists; pass force=True to re-adapt and overwrite
it (e.g. after the adaptation logic or the dataset changed, or to replace a corrupt
state). Because the dataset is named explicitly here, force is unambiguous even when
several datasets share one state path — it adapts on this dataset and overwrites.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
approach_name
|
str
|
Name of an approach in this grid. |
required |
dataset_name
|
str
|
Name of a dataset in this grid. |
required |
force
|
bool
|
Re-adapt and overwrite an existing state file instead of skipping it.
Defaults to |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
KeyError
|
If |
Source code in SRToolkit/experiments/experiment_grid.py
adapt_if_missing
Pre-adapt all adaptation_scope="once" approaches where the state file is absent.
For each (approach, dataset) pair whose state file does not yet exist on disk, this method loads the dataset, calls adapt once, then persists the state via save_adapted_state. Pairs whose state file already exists are skipped.
Approaches whose adaptation_scope is not "once", or that have no entry in
the adapted_states mapping passed at construction, are skipped entirely.
This adapts every pair sequentially in this process. To distribute the work, use
save_commands, which emits one
adapt_one command per pair into
prepare.txt.
Source code in SRToolkit/experiments/experiment_grid.py
build_job
Construct the single ExperimentJob for one (dataset, approach, seed) triple, using this grid's stored configs.
This is the unit of work both
create_jobs and the
run_job CLI build from, so a worker only needs the grid file plus the three
identifiers — no per-job config files on disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
Name of a dataset in this grid. |
required |
approach_name
|
str
|
Name of an approach in this grid. |
required |
seed
|
int
|
Random seed for the run. |
required |
Returns:
| Type | Description |
|---|---|
ExperimentJob
|
The corresponding ExperimentJob. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
ValueError
|
If |
Source code in SRToolkit/experiments/experiment_grid.py
create_jobs
Return the list of ExperimentJob instances for this grid.
Does not trigger adaptation — call
adapt_if_missing first if any
approach has adaptation_scope="once". It also does not materialise data:
running the returned jobs sequentially warms the cache lazily on first use, but if you
dispatch them in parallel yourself, call
materialize_data first so
workers don't race to materialise the same dataset.
(save_commands does both for you.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_completed
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
List[ExperimentJob]
|
List of jobs, one per (dataset, approach, seed) triple that has not yet completed. |
Source code in SRToolkit/experiments/experiment_grid.py
save_commands
save_commands(path: str, python_executable: str = 'python', skip_completed: bool = True, materialize_data: bool = True) -> Optional[str]
Write the experiment commands file (and, if needed, a prepare commands file).
Calls save first to persist the grid
to results_dir/grid.json. Every command line references that single file plus
the identifiers needed to rebuild the work — no per-dataset, per-approach, or
per-job files are written.
The output is split into (up to) two files so a run is correct on any platform without scheduler-specific dependency tricks — run the prepare file to completion, then the experiments file:
-
path— onerun_jobline per pending (dataset, approach, seed) triple::python -m SRToolkit.experiments run_job \ --grid /path/grid.json --dataset NG-1 --approach ProGED --seed 0
-
prepare_<name>(sibling ofpath) — written only when one or moreadaptation_scope="once"approaches still need state, one parallel-safe line per (approach, dataset) pair::python -m SRToolkit.experiments adapt \ --grid /path/grid.json --dataset NG-1 --approach ProGED
Data is materialised, once, in this process (materialize_data=True):
every dataset's data_source is resolved into the shared cache before any command
runs. This is single-process and therefore race-free, fetches each UrlSource
exactly once, and happens on the machine writing the commands — typically the only
node with network access on a cluster. Workers (adaptation and experiments) then
only read the warm cache.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
File path to write the experiment commands to. |
required |
python_executable
|
str
|
Python executable to use in the commands. |
'python'
|
skip_completed
|
bool
|
If |
True
|
materialize_data
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The path to the prepare commands file if one was written, otherwise |
Source code in SRToolkit/experiments/experiment_grid.py
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 | |
progress
Print a dataset × approach progress table to stdout.
Each cell shows done/total experiments completed for that pair, based on
the presence of the per-experiment exp_{seed}.json files on disk.
Example output::
Dataset ProGED EDHiE
----------- ------- ------
NG-1 5/5 3/5
NG-2 2/5 0/5
Source code in SRToolkit/experiments/experiment_grid.py
load_results
Load and merge all completed per-experiment results for a (dataset, approach) pair.
Examples:
>>> results = grid.load_results("Nguyen-1", "ProGED")
>>> len(results) # number of completed experiments
5
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_name
|
str
|
Name of the dataset. |
required |
approach_name
|
str
|
Name of the approach. |
required |
Returns:
| Type | Description |
|---|---|
SR_results
|
An SR_results object containing one EvalResult per completed experiment. Returns an empty |
Source code in SRToolkit/experiments/experiment_grid.py
to_dict
Serialize the grid to a single self-contained, JSON-safe dict — the recipe.
The returned dict inlines every dataset config, approach config, and callback
config alongside the run metadata (num_experiments, initial_seed,
top_k). It is the portable, one-file form of the grid: pass it (or a JSON
file holding it) straight to from_dict.
Unlike save, this carries no
results and no machine-local execution state: results_dir is supplied
at load time (anchored to the file's location) and the absolute
adapted_states paths are dropped — the per-approach adaptation_scope
already travels inside each approach config, so a recipient re-adapts to their
own paths.
Dataset configs are the full per-dataset recipe (data_source + samplers +
ground truth), not bare references, and contain no data arrays — those are
regenerated or downloaded from each dataset's data_source on first use. A
null-source dataset's data must already be present in the recipient's cache;
ship it via export otherwise.
Returns:
| Type | Description |
|---|---|
dict
|
A JSON-safe dict with |
Source code in SRToolkit/experiments/experiment_grid.py
from_dict
classmethod
from_dict(config: Union[dict, str, Path], results_dir: Optional[str] = None, adapted_states: Optional[Dict[str, Dict[str, str]]] = None) -> ExperimentGrid
Reconstruct an ExperimentGrid from a recipe produced by to_dict.
Every embedded config (approaches, callbacks, and the samplers / sources /
constraints nested inside each dataset config) is run through _auto_bind so
that *_class paths pointing at an installed .srtk bundle resolve
automatically. Dataset and approach instances are not created here — they
are reconstructed lazily when jobs run. As a courtesy, any *_class path that
cannot be imported on this machine triggers a warning naming the missing class;
the hard failure is deferred to job-run time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Union[dict, str, Path]
|
The recipe. One of:
|
required |
results_dir
|
Optional[str]
|
Where results are read from and written to. Overrides the
file-anchored default; required when |
None
|
adapted_states
|
Optional[Dict[str, Dict[str, str]]]
|
Optional mapping |
None
|
Returns:
| Type | Description |
|---|---|
ExperimentGrid
|
A fully configured |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the config is not an |
Source code in SRToolkit/experiments/experiment_grid.py
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 | |
export
export(path: Union[str, Path], include_results: bool = False, additional_bundles: Optional[List[Union[str, Path]]] = None, strict: bool = False) -> None
Write a self-contained, shareable .zip gathering everything a recipient needs.
Unlike to_dict (a recipe that
assumes the recipient can reach the data and code), export bundles the
dependencies that wouldn't otherwise travel into one archive whose entries are:
grid.json # the recipe (to_dict output), annotated with _bundle refs
data/<name>.zip # only for datasets whose data isn't otherwise reachable
bundles/<name>.srtk # only when custom (non-SRToolkit) classes are referenced
results/... # only when include_results=True
MANIFEST.md # inventory + recipient instructions
A dataset's data is archived when its source is null (data lives only in the
cache) or a seedless sample source (regeneration wouldn't reproduce the exact
numbers). url and seeded sample datasets are left referenced — the
recipient downloads or regenerates them.
Custom code. Any non-SRToolkit class referenced anywhere in the grid must be
covered by a .srtk bundle so the recipient can import it. Two sources are
used, in order:
- already-installed bundles — a referenced class whose import path falls under
an installed bundle is re-packed automatically from the installed source files
(carrying its declared
python_deps/srtk_min_version); additional_bundles—.srtkfiles you built yourself with pack for code that isn't installed as a bundle. Because you build them, multi-file implementations, dependencies, and the real version all travel correctly.exportnever tries to guess a bundle from a loose source file.
The recipe is annotated with _bundle / _version so the recipient's bind
machinery relocates each class on load. Any custom class covered by neither source
is not packed: it is listed in MANIFEST.md and a warning names each class
and its source file. Pass strict=True to raise instead of warning.
The bundles are not installed automatically.
from_export extracts them next to
the archive so the recipient can install each before running jobs (installing
executes third-party code and mutates the global bundle store, so it stays an
explicit step); class binding is deferred to job-run time, so install order doesn't
matter as long as it happens before the jobs run.
Load the result with from_export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, Path]
|
Destination |
required |
include_results
|
bool
|
If |
False
|
additional_bundles
|
Optional[List[Union[str, Path]]]
|
Optional list of |
None
|
strict
|
bool
|
If |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in SRToolkit/experiments/experiment_grid.py
1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 | |
from_export
classmethod
Load a grid from a .zip produced by
export.
The archive is unpacked and:
- any
data/*.ziparchives are imported into the local data cache (so the bundled datasets resolve without a network or samplers); - any
bundles/andMANIFEST.mdare written intoresults_dirso the recipient has the loose.srtkfiles toinstall(from_exportnever auto-installs — that runs third-party code and mutates the global bundle store); - the grid is rebuilt from
grid.jsonand any shippedresults/are copied intoresults_dirso progress and load_results see them.
Custom classes still need their .srtk bundle(s) installed before jobs run — the
returned grid is lazy and a warning names any that aren't importable yet. Class
binding happens at job-run time, so installing after this call (before running) is
fine. Install from <results_dir>/bundles/ per the extracted MANIFEST.md.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, Path]
|
A |
required |
results_dir
|
Optional[str]
|
Where this machine's runs read/write results, and where |
None
|
Returns:
| Type | Description |
|---|---|
ExperimentGrid
|
A fully configured |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If |
Source code in SRToolkit/experiments/experiment_grid.py
1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 | |
save
Persist the grid to a single results_dir/grid.json file.
The file is the to_dict recipe
plus the machine-local adapted_states paths (which to_dict omits, since
they don't travel between machines). This is the local-persistence counterpart to
the shareable export: it keeps your
run resumable in place, but is not meant for handing to someone else.
save_commands calls this
automatically, so a separate save() call is only needed when checkpointing the
grid without generating a commands file.
Source code in SRToolkit/experiments/experiment_grid.py
load
staticmethod
Load a grid from a grid.json written by
save.
Thin wrapper over from_dict that
also restores the local adapted_states paths. Dataset and approach instances
are not created at load time — they are reconstructed lazily when jobs run.
results_dir is taken from the directory containing path, not from any value
stored in the file, so a grid directory can be moved, mounted under a different
path, or copied elsewhere and still load (and write its results) correctly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the |
required |
Returns:
| Type | Description |
|---|---|
ExperimentGrid
|
A fully configured |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the file is not a supported |