system
System
¶
A class which tracks state information while the fe.Estimator is running.
This class is intentionally not @traceable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network |
BaseNetwork
|
The network instance being used by the current fe.Estimator. |
required |
pipeline |
Pipeline
|
The pipeline instance being used by the current fe.Estimator. |
required |
traces |
List[Union[Trace, Scheduler[Trace]]]
|
The traces provided to the current fe.Estimator. |
required |
mode |
Optional[str]
|
The current execution mode (or None for warmup). |
None
|
num_devices |
int
|
How many GPUs are available for training. |
get_num_gpus()
|
log_steps |
Optional[int]
|
Log every n steps (0 to disable train logging, None to disable all logging). |
None
|
total_epochs |
int
|
How many epochs training is expected to run for. |
0
|
train_steps_per_epoch |
Optional[int]
|
Whether training iterations will be cut short or extended to complete N steps (or use None if they will run to completion) |
None
|
eval_steps_per_epoch |
Optional[int]
|
Whether evaluation iterations will be cut short or extended to complete N steps (or use None if they will run to completion) |
None
|
eval_log_steps |
Sequence[int]
|
The list of steps on which evaluation progress logs need to be printed. |
()
|
system_config |
Optional[List[FeSummaryTable]]
|
A description of the initialization parameters defining the associated estimator. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
mode |
Optional[str]
|
What is the current execution mode of the estimator ('train', 'eval', 'test'), None if warmup. |
ds_id |
str
|
The current dataset id, Empty string if there is only one dataset in each mode. |
exp_id |
int
|
A unique identifier for current training experiment. |
global_step |
Optional[int]
|
How many training steps have elapsed. |
num_devices |
int
|
How many GPUs are available for training. |
log_steps |
Optional[int]
|
Log every n steps (0 to disable train logging, None to disable all logging). |
total_epochs |
int
|
How many epochs training is expected to run for. |
epoch_idx |
int
|
The current epoch index for the training (starting from 1). |
batch_idx |
Optional[int]
|
The current batch index within an epoch (starting from 1). |
stop_training |
bool
|
A flag to signal that training should abort. |
network |
BaseNetwork
|
A reference to the network being used. |
pipeline |
Pipeline
|
A reference to the pipeline being used. |
traces |
List[Union[Trace, Scheduler[Trace]]]
|
The traces being used. |
train_steps_per_epoch |
Optional[int]
|
Training will be cut short or extended to complete N steps even if loader is not yet exhausted. If None, all data will be used. |
eval_steps_per_epoch |
Optional[int]
|
Evaluation will be cut short or extended to complete N steps even if loader is not yet exhausted. If None, all data will be used. |
eval_log_steps_request |
List[int]
|
The list of steps on which the user wants eval log printing. |
eval_log_steps |
Tuple[List[int], int]
|
The steps on which eval logs will be printed, The total number of eval steps in this epoch. |
summary |
Summary
|
An object to write experiment results to. |
experiment_time |
str
|
A timestamp indicating when this model was trained. |
custom_graphs |
Dict[str, List[Summary]]
|
A place to store extra graphs which are too complicated for the primary history. |
Source code in fastestimator/fastestimator/summary/system.py
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 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 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 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 |
|
add_graph
¶
Write custom summary graphs into the System.
This can be useful for things like the LabelTracker trace to interact with Traceability reports.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph_name |
str
|
The name of the graph (so that you can override it later if desired). |
required |
graph |
Union[Summary, List[Summary]]
|
The custom summary to be tracked. |
required |
Source code in fastestimator/fastestimator/summary/system.py
load_state
¶
Load training state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
load_dir |
str
|
The directory from which to reload the state. |
required |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If necessary files can not be found. |
Source code in fastestimator/fastestimator/summary/system.py
reset
¶
Reset the current System
for a new round of training, including a new Summary
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
summary_name |
Optional[str]
|
The name of the experiment. The |
None
|
system_config |
Optional[str]
|
A description of the initialization parameters defining the associated estimator. |
None
|
Source code in fastestimator/fastestimator/summary/system.py
reset_for_test
¶
Partially reset the current System
object for a new round of testing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
summary_name |
Optional[str]
|
The name of the experiment. If not provided, the system will re-use the previous summary name. |
None
|
Source code in fastestimator/fastestimator/summary/system.py
save_state
¶
Load training state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
save_dir |
str
|
The directory into which to save the state |
required |
Source code in fastestimator/fastestimator/summary/system.py
update_batch_idx
¶
update_global_step
¶
write_summary
¶
Write an entry into the Summary
object (iff the experiment was named).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key to write into the summary object. |
required |
value |
Any
|
The value to write into the summary object. |
required |
Source code in fastestimator/fastestimator/summary/system.py
pickle_mirroredstrategy
¶
A custom reduce function to use when Pickle encounters a tf MirroredStrategy.
This relies on the fact that the tf strategy will already be set before the System.load_state method gets called.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
MirroredStrategy
|
The MirroredStrategy instance. |
required |
Returns:
Type | Description |
---|---|
Tuple[Callable, Tuple]
|
The mechanism to construct a new instance of the MirroredStrategy. See Python docs on the reduce method. |