Experiment
Repeated Experiment.
Source code in abses/experiment.py
job_id
property
¶
Job id. Each job means a combination of the configuration. If the experiment is running in Hydra, it will return the hydra's job id.
is_hydra_job
staticmethod
¶
run ¶
运行模型一次
Source code in abses/experiment.py
batch_run ¶
Run the experiment multiple times.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg |
Configurations
|
The configuration of the experiment.
It can be either a string of the config file path,
or a dictionary of the config.
For an example:
|
required |
repeats |
Optional[int]
|
The number of repeats for the experiment. If not specified, it will use the default value 1 (No repeats). |
None
|
parallels |
Optional[int]
|
The number of processes running in parallel. If not specified, it will use the default value 1 (No parallel). |
None
|
display_progress |
bool
|
Whether to display the progress bar, default True. |
True
|
overrides |
Optional[Dict[str, str | Iterable[Number]]]
|
The dictionary of overrides for the experiment. If specified, the experiment will sweep all the possible values for the parameter. For examples: override = {model.key: ["cate1", "cate2"]} override = {nature.key: np.arange(10, 2)} The first override will lead to two different runs: - model.key = cate1 - model.key = cate2 The second override will lead to a series runs: - model.nature.key = 0.0 - model.nature.key = 2.0 - model.nature.key = 4.0 - model.nature.key = 6.0 - model.nature.key = 8.0 |
None
|
Example
Source code in abses/experiment.py
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
|
summary
classmethod
¶
clean
classmethod
¶
Clean the results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_exp |
bool
|
Whether to create a new experiment. If True, it will delete all the current settings. |
False
|
Source code in abses/experiment.py
new
classmethod
¶
Create a new experiment for the singleton class Experiment
.
This method will delete all currently available exp results and settings.
Then, it initialize a new instance of experiment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_cls |
Type[MainModel]
|
Using which model class to initialize the experiment. |
required |
Raises:
Type | Description |
---|---|
TypeError
|
If the model class |
Returns:
Type | Description |
---|---|
Experiment
|
An experiment. |
Source code in abses/experiment.py
get_model_vars_dataframe
classmethod
¶
Aggregation of model vars dataframe.