job
zeus._legacy.job
Defines the Job specification dataclass.
Job
dataclass
Job specification tuple.
Attributes:
Name | Type | Description |
---|---|---|
dataset |
str
|
Name of the dataset. |
network |
str
|
Name of the DNN model. |
optimizer |
str
|
Name of the optimizer, e.g. Adam. |
target_metric |
float
|
Target validation metric. |
max_epochs |
int
|
Maximum number of epochs to train before terminating. |
default_bs |
int | None
|
Initial batch size (b0) provided by the user. |
default_lr |
float | None
|
Learning rate corresponding to the default batch size. |
workdir |
str | None
|
Working directory in which to launch the job command. |
command |
list[str] | None
|
Job command template. See |
Source code in zeus/_legacy/job.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 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 |
|
__str__
__str__()
Generate a more conside representation of the object.
Source code in zeus/_legacy/job.py
38 39 40 41 42 43 |
|
to_logdir
to_logdir()
Generate a logdir name that explains this job.
Source code in zeus/_legacy/job.py
45 46 47 48 49 50 51 |
|
filter_df
filter_df(df)
Pick out the rows corresponding to this job from the DataFrame.
Source code in zeus/_legacy/job.py
53 54 55 56 57 58 59 60 |
|
gen_command
gen_command(batch_size, learning_rate, seed, rec_i)
Format the job command with given arguments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_size |
int
|
Batch size to use for this job launch. |
required |
learning_rate |
float
|
Learning rate to use for this job launch. |
required |
seed |
int
|
Random seed to use for this job launch. |
required |
rec_i |
int
|
Recurrence number of this job launch. |
required |
Source code in zeus/_legacy/job.py
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 |
|
scale_lr
scale_lr(batch_size)
Scale the learning rate for the given batch size.
Assumes that self.default_bs
and self.default_lr
were given.
Then, self.default_lr
is scaled for the given batch_size
using
square root scaling for adaptive optimizers (e.g. Adam, Adadelta,
AdamW) and linear scaling for others (e.g. SGD).
Source code in zeus/_legacy/job.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|