Upload schedule_1x.py with huggingface_hub
Browse files- schedule_1x.py +28 -0
schedule_1x.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# training schedule for 1x
|
| 2 |
+
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=12, val_interval=1)
|
| 3 |
+
val_cfg = dict(type='ValLoop')
|
| 4 |
+
test_cfg = dict(type='TestLoop')
|
| 5 |
+
|
| 6 |
+
# learning rate
|
| 7 |
+
param_scheduler = [
|
| 8 |
+
dict(
|
| 9 |
+
type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500),
|
| 10 |
+
dict(
|
| 11 |
+
type='MultiStepLR',
|
| 12 |
+
begin=0,
|
| 13 |
+
end=12,
|
| 14 |
+
by_epoch=True,
|
| 15 |
+
milestones=[8, 11],
|
| 16 |
+
gamma=0.1)
|
| 17 |
+
]
|
| 18 |
+
|
| 19 |
+
# optimizer
|
| 20 |
+
optim_wrapper = dict(
|
| 21 |
+
type='OptimWrapper',
|
| 22 |
+
optimizer=dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001))
|
| 23 |
+
|
| 24 |
+
# Default setting for scaling LR automatically
|
| 25 |
+
# - `enable` means enable scaling LR automatically
|
| 26 |
+
# or not by default.
|
| 27 |
+
# - `base_batch_size` = (8 GPUs) x (2 samples per GPU).
|
| 28 |
+
auto_scale_lr = dict(enable=False, base_batch_size=16)
|