Skip to content

Commit f4a4827

Browse files
authored
Expose early stopping hyper-parameters for all tasks (#1241)
1 parent 232ed03 commit f4a4827

File tree

20 files changed

+478
-32
lines changed

20 files changed

+478
-32
lines changed

QUICK_START_GUIDE.md

+19
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ usage: ote train template params [-h]
173173
[--learning_parameters.learning_rate LEARNING_RATE]
174174
[--learning_parameters.learning_rate_warmup_iters LEARNING_RATE_WARMUP_ITERS]
175175
[--learning_parameters.num_iters NUM_ITERS]
176+
[--learning_parameters.enable_early_stopping ENABLE_EARLY_STOPPING]
177+
[--learning_parameters.early_stop_patience EARLY_STOP_PATIENCE]
178+
[--learning_parameters.early_stop_iteration_patience EARLY_STOP_ITERATION_PATIENCE]
176179
[--postprocessing.confidence_threshold CONFIDENCE_THRESHOLD]
177180
[--postprocessing.result_based_confidence_threshold RESULT_BASED_CONFIDENCE_THRESHOLD]
178181
[--nncf_optimization.enable_quantization ENABLE_QUANTIZATION]
@@ -205,6 +208,22 @@ optional arguments:
205208
default_value: 300
206209
max_value: 100000
207210
min_value: 1
211+
--learning_parameters.enable_early_stopping ENABLE_EARLY_STOPPING
212+
header: Enable early stopping of the training
213+
type: BOOLEAN
214+
default_value: True
215+
--learning_parameters.early_stop_patience EARLY_STOP_PATIENCE
216+
header: Patience for early stopping
217+
type: INTEGER
218+
default_value: 10
219+
max_value: 50
220+
min_value: 0
221+
--learning_parameters.early_stop_iteration_patience EARLY_STOP_ITERATION_PATIENCE
222+
header: Iteration patience for early stopping
223+
type: INTEGER
224+
default_value: 0
225+
max_value: 1000
226+
min_value: 0
208227
--postprocessing.confidence_threshold CONFIDENCE_THRESHOLD
209228
header: Confidence threshold
210229
type: FLOAT

external/model-preparation-algorithm/configs/classification/configuration.yaml

+54-3
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,68 @@ learning_parameters:
121121
enable_early_stopping:
122122
affects_outcome_of: TRAINING
123123
default_value: true
124-
description: Adaptive early exit from training when accuracy isn't changed or decreased for several epochs.
124+
description: Early exit from training when validation accuracy isn't changed or decreased for several epochs.
125125
editable: true
126-
header: Enable adaptive early stopping of the training
126+
header: Enable early stopping of the training
127127
type: BOOLEAN
128128
ui_rules:
129129
action: DISABLE_EDITING
130130
operator: AND
131131
rules: []
132132
type: UI_RULES
133-
visible_in_ui: false
133+
visible_in_ui: true
134134
warning: null
135+
early_stop_start:
136+
affects_outcome_of: TRAINING
137+
default_value: 3
138+
editable: true
139+
header: Start epoch for early stopping
140+
max_value: 1000
141+
min_value: 0
142+
type: INTEGER
143+
ui_rules:
144+
action: DISABLE_EDITING
145+
operator: AND
146+
rules: []
147+
type: UI_RULES
148+
value: 3
149+
visible_in_ui: false
150+
early_stop_patience:
151+
affects_outcome_of: TRAINING
152+
default_value: 8
153+
description: Training will stop if the model does not improve within the number of epochs of patience.
154+
editable: true
155+
header: Patience for early stopping
156+
max_value: 50
157+
min_value: 0
158+
type: INTEGER
159+
ui_rules:
160+
action: DISABLE_EDITING
161+
operator: AND
162+
rules: []
163+
type: UI_RULES
164+
value: 8
165+
visible_in_ui: true
166+
warning: This is applied exclusively when early stopping is enabled.
167+
early_stop_iteration_patience:
168+
affects_outcome_of: TRAINING
169+
default_value: 0
170+
description:
171+
Training will stop if the model does not improve within the number of iterations of patience.
172+
This ensures the model is trained enough with the number of iterations of patience before early stopping.
173+
editable: true
174+
header: Iteration patience for early stopping
175+
max_value: 1000
176+
min_value: 0
177+
type: INTEGER
178+
ui_rules:
179+
action: DISABLE_EDITING
180+
operator: AND
181+
rules: []
182+
type: UI_RULES
183+
value: 0
184+
visible_in_ui: true
185+
warning: This is applied exclusively when early stopping is enabled.
135186
type: PARAMETER_GROUP
136187
visible_in_ui: true
137188
pot_parameters:

external/model-preparation-algorithm/configs/classification/efficientnet_b0_cls_incr/hpo_config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ hp_space:
44
learning_parameters.learning_rate:
55
param_type: qloguniform
66
range:
7-
- 0.0014
8-
- 0.035
9-
- 0.0001
7+
- 0.00098
8+
- 0.0245
9+
- 0.00001
1010
learning_parameters.batch_size:
1111
param_type: qloguniform
1212
range:

external/model-preparation-algorithm/configs/classification/efficientnet_b0_cls_incr/model.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
'../../../submodule/models/classification/ote_efficientnet_b0.yaml',
33
]
44

5-
runner = dict(max_epochs=20)
65
fp16 = dict(loss_scale=512.)

external/model-preparation-algorithm/configs/classification/efficientnet_b0_cls_incr/template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ hyper_parameters:
3232
num_workers:
3333
default_value: 0
3434
learning_rate:
35-
default_value: 0.007
35+
default_value: 0.0049
3636
auto_hpo_state: POSSIBLE
3737
learning_rate_warmup_iters:
3838
default_value: 0

external/model-preparation-algorithm/configs/classification/efficientnet_v2_s_cls_incr/model.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
'../../../submodule/models/classification/ote_efficientnet_v2_s.yaml',
33
]
44

5-
runner = dict(max_epochs=20)
65
fp16 = dict(loss_scale=512.)

external/model-preparation-algorithm/configs/classification/efficientnet_v2_s_cls_incr/template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ hyper_parameters:
3232
num_workers:
3333
default_value: 0
3434
learning_rate:
35-
default_value: 0.007
35+
default_value: 0.0071
3636
auto_hpo_state: POSSIBLE
3737
learning_rate_warmup_iters:
3838
default_value: 0

external/model-preparation-algorithm/configs/classification/mobilenet_v3_large_1_cls_incr/hpo_config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ hp_space:
44
learning_parameters.learning_rate:
55
param_type: qloguniform
66
range:
7-
- 0.0008
7+
- 0.00029
88
- 0.1
9-
- 0.0001
9+
- 0.00001
1010
learning_parameters.batch_size:
1111
param_type: qloguniform
1212
range:

external/model-preparation-algorithm/configs/classification/mobilenet_v3_large_1_cls_incr/model.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
'../../../submodule/models/classification/ote_mobilenet_v3_large.yaml',
33
]
44

5-
runner = dict(max_epochs=20)
65
fp16 = dict(loss_scale=512.)

external/model-preparation-algorithm/configs/classification/mobilenet_v3_large_1_cls_incr/template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ hyper_parameters:
3232
num_workers:
3333
default_value: 0
3434
learning_rate:
35-
default_value: 0.016
35+
default_value: 0.0058
3636
auto_hpo_state: POSSIBLE
3737
learning_rate_warmup_iters:
38-
default_value: 100
38+
default_value: 10
3939
num_iters:
4040
default_value: 90
4141
nncf_optimization:

external/model-preparation-algorithm/configs/detection/configuration.yaml

+79
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,85 @@ learning_parameters:
119119
value: 0
120120
visible_in_ui: true
121121
warning: null
122+
enable_early_stopping:
123+
affects_outcome_of: TRAINING
124+
default_value: true
125+
description: Early exit from training when validation accuracy isn't changed or decreased for several epochs.
126+
editable: true
127+
header: Enable early stopping of the training
128+
type: BOOLEAN
129+
ui_rules:
130+
action: DISABLE_EDITING
131+
operator: AND
132+
rules: []
133+
type: UI_RULES
134+
visible_in_ui: true
135+
warning: null
136+
early_stop_start:
137+
affects_outcome_of: TRAINING
138+
default_value: 3
139+
editable: true
140+
header: Start epoch for early stopping
141+
max_value: 1000
142+
min_value: 0
143+
type: INTEGER
144+
ui_rules:
145+
action: DISABLE_EDITING
146+
operator: AND
147+
rules: []
148+
type: UI_RULES
149+
value: 3
150+
visible_in_ui: false
151+
early_stop_patience:
152+
affects_outcome_of: TRAINING
153+
default_value: 10
154+
description: Training will stop if the model does not improve within the number of epochs of patience.
155+
editable: true
156+
header: Patience for early stopping
157+
max_value: 50
158+
min_value: 0
159+
type: INTEGER
160+
ui_rules:
161+
action: DISABLE_EDITING
162+
operator: AND
163+
rules: []
164+
type: UI_RULES
165+
value: 10
166+
visible_in_ui: true
167+
warning: This is applied exclusively when early stopping is enabled.
168+
early_stop_iteration_patience:
169+
affects_outcome_of: TRAINING
170+
default_value: 0
171+
description:
172+
Training will stop if the model does not improve within the number of iterations of patience.
173+
This ensures the model is trained enough with the number of iterations of patience before early stopping.
174+
editable: true
175+
header: Iteration patience for early stopping
176+
max_value: 1000
177+
min_value: 0
178+
type: INTEGER
179+
ui_rules:
180+
action: DISABLE_EDITING
181+
operator: AND
182+
rules: []
183+
type: UI_RULES
184+
value: 0
185+
visible_in_ui: true
186+
warning: This is applied exclusively when early stopping is enabled.
187+
use_adaptive_interval:
188+
affects_outcome_of: TRAINING
189+
default_value: true
190+
description: Depending on the size of iteration per epoch, adaptively update the validation interval and related values.
191+
editable: true
192+
header: Use adaptive validation interval
193+
type: BOOLEAN
194+
ui_rules:
195+
action: DISABLE_EDITING
196+
operator: AND
197+
rules: []
198+
type: UI_RULES
199+
visible_in_ui: true
200+
warning: This will automatically control the patience and interval when early stopping is enabled.
122201
type: PARAMETER_GROUP
123202
visible_in_ui: true
124203
postprocessing:

external/model-preparation-algorithm/configs/instance-segmentation/configuration.yaml

+79
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,85 @@ learning_parameters:
119119
value: 0
120120
visible_in_ui: true
121121
warning: null
122+
enable_early_stopping:
123+
affects_outcome_of: TRAINING
124+
default_value: true
125+
description: Early exit from training when validation accuracy isn't changed or decreased for several epochs.
126+
editable: true
127+
header: Enable early stopping of the training
128+
type: BOOLEAN
129+
ui_rules:
130+
action: DISABLE_EDITING
131+
operator: AND
132+
rules: []
133+
type: UI_RULES
134+
visible_in_ui: true
135+
warning: null
136+
early_stop_start:
137+
affects_outcome_of: TRAINING
138+
default_value: 3
139+
editable: true
140+
header: Start epoch for early stopping
141+
max_value: 1000
142+
min_value: 0
143+
type: INTEGER
144+
ui_rules:
145+
action: DISABLE_EDITING
146+
operator: AND
147+
rules: []
148+
type: UI_RULES
149+
value: 3
150+
visible_in_ui: false
151+
early_stop_patience:
152+
affects_outcome_of: TRAINING
153+
default_value: 10
154+
description: Training will stop if the model does not improve within the number of epochs of patience.
155+
editable: true
156+
header: Patience for early stopping
157+
max_value: 50
158+
min_value: 0
159+
type: INTEGER
160+
ui_rules:
161+
action: DISABLE_EDITING
162+
operator: AND
163+
rules: []
164+
type: UI_RULES
165+
value: 10
166+
visible_in_ui: true
167+
warning: This is applied exclusively when early stopping is enabled.
168+
early_stop_iteration_patience:
169+
affects_outcome_of: TRAINING
170+
default_value: 0
171+
description:
172+
Training will stop if the model does not improve within the number of iterations of patience.
173+
This ensures the model is trained enough with the number of iterations of patience before early stopping.
174+
editable: true
175+
header: Iteration patience for early stopping
176+
max_value: 1000
177+
min_value: 0
178+
type: INTEGER
179+
ui_rules:
180+
action: DISABLE_EDITING
181+
operator: AND
182+
rules: []
183+
type: UI_RULES
184+
value: 0
185+
visible_in_ui: true
186+
warning: This is applied exclusively when early stopping is enabled.
187+
use_adaptive_interval:
188+
affects_outcome_of: TRAINING
189+
default_value: true
190+
description: Depending on the size of iteration per epoch, adaptively update the validation interval and related values.
191+
editable: true
192+
header: Use adaptive validation interval
193+
type: BOOLEAN
194+
ui_rules:
195+
action: DISABLE_EDITING
196+
operator: AND
197+
rules: []
198+
type: UI_RULES
199+
visible_in_ui: true
200+
warning: This will automatically control the patience and interval when early stopping is enabled.
122201
type: PARAMETER_GROUP
123202
visible_in_ui: true
124203
postprocessing:

0 commit comments

Comments
 (0)