_base_ = [
    '../_base_/models/vars_file.alg_base_dir',
    '../_base_/datasets/vars_file.dataset_file_name', #换成自己定义的数据集
    '../_base_/default_runtime.py',
    '../_base_/schedules/schedule_vars_file.schedule_k_timesk.py'
]
crop_size = (vars_file.crop_size_w, vars_file.crop_size_h)
data_preprocessor = dict(size=crop_size)
model = dict(
    pretrained='open-mmlab://vars_file.pretrained_model',
    backbone=dict(depth=vars_file.pretrained_depth),
    data_preprocessor=data_preprocessor,
    decode_head=dict(
        num_classes=vars_file.class_num, # TODO 设置不同分类种类
        loss_decode=dict(type='DiceLoss', use_sigmoid=False, loss_weight=1.0), # TODO 设置不同分类种类，它根据预测结果和真实标签的重叠区域来度量相似性
        # align_corners=True,
        # align_corners=False, # 在不用slide时
    ),
    auxiliary_head=dict(
        num_classes=vars_file.class_num, # TODO 设置不同分类种类
        loss_decode=dict(type='DiceLoss', use_sigmoid=False, loss_weight=1.0), # TODO 设置不同分类种类，它根据预测结果和真实标签的重叠区域来度量相似性
        # align_corners=True,
        # align_corners=False, # 在不用slide时
    ),
    # test_cfg=dict(mode='slide', crop_size=(vars_file.crop_size_w, vars_file.crop_size_h), stride=(vars_file.crop_size_w, vars_file.crop_size_w))
)

# optimizer（优化器设计）TODO
optim_wrapper = dict(
    type='OptimWrapper',
    _delete_=True,
    optimizer=dict(type='AdamW', lr=0.0001, weight_decay=0.0005),
    clip_grad=dict(max_norm=1, norm_type=2))

param_scheduler = [
    dict(
        type='LinearLR', start_factor=1e-6, by_epoch=False, begin=0, end=1500),
    dict(
        type='PolyLR',
        power=1.0,
        begin=1500,
        end=160000,
        eta_min=0.0,
        by_epoch=False,
    )
]

# optim_wrapper = dict(
#     _delete_=True,
#     type='OptimWrapper',
#     optimizer=dict(type='AdamW', lr=0.0005, weight_decay=0.05),
#     clip_grad=dict(max_norm=1, norm_type=2))
# # learning policy
# param_scheduler = [
#     dict(
#         type='LinearLR', start_factor=0.001, by_epoch=False, begin=0,
#         end=1000),
#     dict(
#         type='MultiStepLR',
#         begin=1000,
#         end=80000,
#         by_epoch=False,
#         milestones=[60000, 72000],
#     )
# ]