_base_ = [
    '../_base_/models/bisenetv2.py',
    '../_base_/datasets/publicdataset_autolaparo.py',
    '../_base_/default_runtime.py',
    # '../_base_/schedules/schedule_300e_val1_check10.py', # TODO
    '../_base_/schedules/schedule_300e_val1_check10_SGD.py',
]

norm_cfg = dict(
    type='BN',
)

crop_size = (512, 512)

data_preprocessor = dict(
    size=(512, 512),
    mean=[
        123.62464353460942,
        85.34836259209033,
        82.31539425671558,
    ],
    std=[
        47.172211618459315,
        47.08256715323592,
        48.135121265163605,
    ],
    bgr_to_rgb=False,
)

model = dict(
    data_preprocessor=dict(
        size=(512, 512),
        mean=[
            123.62464353460942,
            85.34836259209033,
            82.31539425671558,
        ],
        std=[
            47.172211618459315,
            47.08256715323592,
            48.135121265163605,
        ],
        bgr_to_rgb=False,
    ),
    decode_head=dict(
        type='FCNHead',
        loss_decode=dict(
            type='CrossEntropyLoss',
            use_sigmoid=False,
            loss_weight=1.0,
        ),
        num_classes=10,
    ),
    auxiliary_head=[
        dict(
            type='FCNHead',
            in_channels=16,
            channels=16,
            num_convs=2,
            num_classes=10,
            in_index=1,
            norm_cfg=dict(
                type='BN',
            ),
            concat_input=False,
            align_corners=False,
            loss_decode=dict(
                type='CrossEntropyLoss',
                use_sigmoid=False,
                loss_weight=0.4,
                reduction='none',
            ),
        ),
        dict(
            type='FCNHead',
            in_channels=32,
            channels=64,
            num_convs=2,
            num_classes=10,
            in_index=2,
            norm_cfg=dict(
                type='BN',
            ),
            concat_input=False,
            align_corners=False,
            loss_decode=dict(
                type='CrossEntropyLoss',
                use_sigmoid=False,
                loss_weight=0.4,
                reduction='none',
            ),
        ),
        dict(
            type='FCNHead',
            in_channels=64,
            channels=256,
            num_convs=2,
            num_classes=10,
            in_index=3,
            norm_cfg=dict(
                type='BN',
            ),
            concat_input=False,
            align_corners=False,
            loss_decode=dict(
                type='CrossEntropyLoss',
                use_sigmoid=False,
                loss_weight=0.4,
                reduction='none',
            ),
        ),
        dict(
            type='FCNHead',
            in_channels=128,
            channels=1024,
            num_convs=2,
            num_classes=10,
            in_index=4,
            norm_cfg=dict(
                type='BN',
            ),
            concat_input=False,
            align_corners=False,
            loss_decode=dict(
                type='CrossEntropyLoss',
                use_sigmoid=False,
                loss_weight=0.4,
                reduction='none',
            ),
        ),
    ],
)

# TODO
optimizer = dict(type='SGD', lr=0.05, momentum=0.9, weight_decay=0.0005)
optim_wrapper = dict(type='OptimWrapper', optimizer=optimizer)

param_scheduler = [
    dict(
        type='LinearLR',
        start_factor=1e-06,
        by_epoch=True,
        begin=0,
        end=10,
    ),
    dict(
        type='PolyLR',
        power=0.9,
        begin=10,
        end=300,
        eta_min=1e-05,
        by_epoch=True,
    ),
]

