self_supervision_benchmark/modeling/colorization/alexnet_colorize_finetune_linear.py [145:174]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    resize_c3 = model.AveragePool(
        relu3, relu3 + '_s1k9_resize', kernel=9, stride=1, pad=0
    )
    bn_c3 = model.SpatialBN(
        resize_c3, resize_c3 + '_bn', 384, epsilon=cfg.MODEL.BN_EPSILON,
        momentum=cfg.MODEL.BN_MOMENTUM, is_test=test_mode
    )
    if cfg.MODEL.BN_NO_SCALE_SHIFT:
        model.param_init_net.ConstantFill(
            [bn_c3 + '_s'], bn_c3 + '_s', value=1.0
        )
        model.param_init_net.ConstantFill(
            [bn_c3 + '_b'], bn_c3 + '_b', value=0.0
        )
    fc_conv3 = model.FC(
        bn_c3, 'fc_c3', 384 * 5 * 5, num_classes,
        weight_init=('GaussianFill', {'std': 0.01}),
        bias_init=('ConstantFill', {'value': 0.0}),
    )
    model.net.Alias(fc_conv3, 'pred_c3')
    if not cfg.MODEL.EXTRACT_FEATURES_ONLY:
        model.Accuracy([fc_conv3, labels], 'accuracy_c3')
        if split == 'train':
            softmax, loss_c3 = model.SoftmaxWithLoss(
                ['pred_c3', labels], ['softmax_c3', 'loss_c3'], scale=scale
            )
        elif split in ['test', 'val']:
            softmax = model.Softmax('pred_c3', 'softmax_c3', engine='CUDNN')
            loss_c3 = None
        losses.append(loss_c3)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



self_supervision_benchmark/modeling/supervised/caffenet_bvlc_supervised_finetune_linear.py [127:156]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    resize_c3 = model.AveragePool(
        relu3, relu3 + '_s1k9_resize', kernel=9, stride=1, pad=0
    )
    bn_c3 = model.SpatialBN(
        resize_c3, resize_c3 + '_bn', 384, epsilon=cfg.MODEL.BN_EPSILON,
        momentum=cfg.MODEL.BN_MOMENTUM, is_test=test_mode
    )
    if cfg.MODEL.BN_NO_SCALE_SHIFT:
        model.param_init_net.ConstantFill(
            [bn_c3 + '_s'], bn_c3 + '_s', value=1.0
        )
        model.param_init_net.ConstantFill(
            [bn_c3 + '_b'], bn_c3 + '_b', value=0.0
        )
    fc_conv3 = model.FC(
        bn_c3, 'fc_c3', 384 * 5 * 5, num_classes,
        weight_init=('GaussianFill', {'std': 0.01}),
        bias_init=('ConstantFill', {'value': 0.0}),
    )
    model.net.Alias(fc_conv3, 'pred_c3')
    if not cfg.MODEL.EXTRACT_FEATURES_ONLY:
        model.Accuracy([fc_conv3, labels], 'accuracy_c3')
        if split == 'train':
            softmax, loss_c3 = model.SoftmaxWithLoss(
                ['pred_c3', labels], ['softmax_c3', 'loss_c3'], scale=scale
            )
        elif split in ['test', 'val']:
            softmax = model.Softmax('pred_c3', 'softmax_c3', engine='CUDNN')
            loss_c3 = None
        losses.append(loss_c3)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



