Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance training schedule for multi-label classification #1212

Merged
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
_base_ = [
'../../../submodule/models/classification/ote_efficientnet_b0_multilabel.yaml',
]

runner = dict(max_epochs=90)
fp16 = dict(loss_scale=512.)

custom_hooks = [
dict(
type='LazyEarlyStoppingHook',
start=0,
patience=10,
iteration_patience=0,
metric='mAP',
interval=1,
priority=75,
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ hyper_parameters:
learning_rate:
default_value: 0.007
auto_hpo_state: POSSIBLE
learning_rate_warmup_iters:
default_value: 0
num_iters:
default_value: 20
algo_backend:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
_base_ = [
'../../../submodule/models/classification/ote_efficientnet_v2_s_multilabel.yaml',
]

runner = dict(max_epochs=90)
fp16 = dict(loss_scale=512.)

custom_hooks = [
dict(
type='LazyEarlyStoppingHook',
start=0,
patience=10,
iteration_patience=0,
metric='mAP',
interval=1,
priority=75,
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ hyper_parameters:
learning_rate:
default_value: 0.007
auto_hpo_state: POSSIBLE
learning_rate_warmup_iters:
default_value: 0
num_iters:
default_value: 20
algo_backend:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
_base_ = [
'../../../submodule/models/classification/ote_mobilenet_v3_large_multilabel.yaml',
]

runner = dict(max_epochs=90)
fp16 = dict(loss_scale=512.)

custom_hooks = [
dict(
type='LazyEarlyStoppingHook',
start=0,
patience=10,
iteration_patience=0,
metric='mAP',
interval=1,
priority=75,
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ def _init_model_cfg(self):
else:
cfg_path = os.path.join(base_dir, 'model.py')
cfg = MPAConfig.fromfile(cfg_path)

# To initialize different HP for multi-label classification / Support HP change via CLI & UI
if self._multilabel:
template = MPAConfig.fromfile(self.template_file_path)
template_params = template.hyper_parameters.parameter_overrides.learning_parameters
if template_params.num_iters.default_value != self._hyperparams.learning_parameters.num_iters:
cfg.pop('runner', False)
goodsong81 marked this conversation as resolved.
Show resolved Hide resolved

cfg.model.multilabel = self._multilabel
cfg.model.hierarchical = self._hierarchical
if self._hierarchical:
Expand Down