self_supervision_benchmark/modeling/colorization/alexnet_colorize_finetune_linear.py [237:266]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    resize_c5 = model.AveragePool(
        relu5, relu5 + '_s1k8_resize', kernel=8, stride=1, pad=0
    )
    bn_c5 = model.SpatialBN(
        resize_c5, resize_c5 + '_bn', 256, 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_c5 + '_s'], bn_c5 + '_s', value=1.0
        )
        model.param_init_net.ConstantFill(
            [bn_c5 + '_b'], bn_c5 + '_b', value=0.0
        )
    fc_conv5 = model.FC(
        bn_c5, 'fc_c5', 256 * 6 * 6, num_classes,
        weight_init=('GaussianFill', {'std': 0.01}),
        bias_init=('ConstantFill', {'value': 0.0}),
    )
    model.net.Alias(fc_conv5, 'pred_c5')
    if not cfg.MODEL.EXTRACT_FEATURES_ONLY:
        model.Accuracy([fc_conv5, labels], 'accuracy_c5')
        if split == 'train':
            softmax, loss_c5 = model.SoftmaxWithLoss(
                ['pred_c5', labels], ['softmax_c5', 'loss_c5'], scale=scale
            )
        elif split in ['test', 'val']:
            softmax = model.Softmax('pred_c5', 'softmax_c5', engine='CUDNN')
            loss_c5 = None
        losses.append(loss_c5)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



self_supervision_benchmark/modeling/supervised/caffenet_bvlc_supervised_finetune_linear.py [205:234]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    resize_c5 = model.AveragePool(
        relu5, relu5 + '_s1k8_resize', kernel=8, stride=1, pad=0
    )
    bn_c5 = model.SpatialBN(
        resize_c5, resize_c5 + '_bn', 256, 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_c5 + '_s'], bn_c5 + '_s', value=1.0
        )
        model.param_init_net.ConstantFill(
            [bn_c5 + '_b'], bn_c5 + '_b', value=0.0
        )
    fc_conv5 = model.FC(
        bn_c5, 'fc_c5', 256 * 6 * 6, num_classes,
        weight_init=('GaussianFill', {'std': 0.01}),
        bias_init=('ConstantFill', {'value': 0.0}),
    )
    model.net.Alias(fc_conv5, 'pred_c5')
    if not cfg.MODEL.EXTRACT_FEATURES_ONLY:
        model.Accuracy([fc_conv5, labels], 'accuracy_c5')
        if split == 'train':
            softmax, loss_c5 = model.SoftmaxWithLoss(
                ['pred_c5', labels], ['softmax_c5', 'loss_c5'], scale=scale
            )
        elif split in ['test', 'val']:
            softmax = model.Softmax('pred_c5', 'softmax_c5', engine='CUDNN')
            loss_c5 = None
        losses.append(loss_c5)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



