[CHEX] revise the loss of model to LabelSmoothLoss ()

revise the loss of model to LabelSmoothLoss

Co-authored-by: zhangzhongyu <zhangzhongyu@pjlab.org.cn>
chex
zhongyu zhang 2022-12-29 19:32:16 +08:00 committed by GitHub
parent 577d3d6b04
commit 16200a5c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions
configs/chex/resnet50

View File

@ -16,10 +16,15 @@ architecture.update({
architecture.update({
'head':
dict(
type='MultiLabelLinearClsHead',
type='LinearClsHead',
num_classes=1000,
in_channels=2048,
loss=dict(type='CrossEntropyLoss', use_soft=True, loss_weight=1.0),
loss=dict(
type='LabelSmoothLoss',
label_smooth_val=0.1,
num_classes=1000,
reduction='mean',
loss_weight=1.0),
topk=(1, 5))
})
@ -71,5 +76,8 @@ param_scheduler = [
# train setting
train_cfg = dict(by_epoch=True, max_epochs=250, val_interval=1)
# configure default hooks
default_hooks = dict(logger=dict(type='LoggerHook', interval=10))
default_hooks = dict(
# TODO: reset it to 100.
# print log every 10 iterations to quickly debug.
logger=dict(type='LoggerHook', interval=10)
)