Config¶
danling.runner.config
¶
Config
¶
Bases: Config
Config
is a Config
that contains all states of a Runner
.
Config
is designed to store all critical information of a Run so that you can resume a run
from a state and corresponding weights or even restart a run from a state.
Config
is also designed to be serialisable and hashable, so that you can save it to a file.
Config
is saved in checkpoint together with weights by default.
Since Config
is a Config
, you can access its attributes by
state["key"]
or state.key
.
General:
Name | Type | Description |
---|---|---|
run_name |
str
|
Defaults to |
run_id |
str
|
hex of |
run_uuid |
(UUID, property)
|
|
experiment_name |
str
|
Defaults to |
experiment_id |
str
|
git hash of the current HEAD.
Defaults to |
experiment_uuid |
(UUID, property)
|
UUID of |
Reproducibility:
Name | Type | Description |
---|---|---|
seed |
int
|
Defaults to |
deterministic |
bool
|
Ensure deterministic operations.
Defaults to |
Progress:
Name | Type | Description |
---|---|---|
iters |
int
|
The number of data samples processed.
equals to |
steps |
int
|
The number of |
epochs |
int
|
The number of complete passes over the datasets. |
iter_end |
int
|
End running iter.
Note that |
step_end |
int
|
End running step.
Note that |
epoch_end |
int
|
End running epoch.
Note that |
In general you should only use one of iter_end
, step_end
, epoch_end
to indicate the length of running.
IO:
Name | Type | Description |
---|---|---|
project_root |
str
|
The root directory for all experiments.
Defaults to |
project_root
is the root directory of all Experiments, and should be consistent across the Project.
dir
is the directory of a certain Run.
There is no attributes/properties for Group and Experiment.
checkpoint_dir_name
is relative to dir
, and is passed to generate checkpoint_dir
(checkpoint_dir = os.path.join(dir, checkpoint_dir_name)
).
In practice, checkpoint_dir_name
is rarely called.
logging:
Name | Type | Description |
---|---|---|
log |
bool
|
Whether to log the outputs.
Defaults to |
tensorboard |
bool
|
Whether to use |
log_interval |
int
|
Interval of printing logs.
Defaults to |
save_interval |
int
|
Interval of saving intermediate checkpoints.
Defaults to |
Notes
Config
is a Config
, so you can access its attributes by state["name"]
or state.name
.
See Also
BaseRunner
: The base runner class.
Source code in danling/runner/config.py
Python | |
---|---|
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 157 158 159 160 161 |
|