self_supervision_benchmark/modeling/colorization/alexnet_colorize_finetune_linear.py [51:80]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    resize_c1 = model.AveragePool(
        relu1, relu1 + '_s4k19_resize', kernel=19, stride=4, pad=0
    )
    bn_c1 = model.SpatialBN(
        resize_c1, resize_c1 + '_bn', 96, 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_c1 + '_s'], bn_c1 + '_s', value=1.0
        )
        model.param_init_net.ConstantFill(
            [bn_c1 + '_b'], bn_c1 + '_b', value=0.0
        )
    fc_conv1 = model.FC(
        bn_c1, 'fc_c1', 96 * 10 * 10, num_classes,
        weight_init=('GaussianFill', {'std': 0.01}),
        bias_init=('ConstantFill', {'value': 0.0}),
    )
    model.net.Alias(fc_conv1, 'pred_c1')
    if not cfg.MODEL.EXTRACT_FEATURES_ONLY:
        model.Accuracy([fc_conv1, labels], 'accuracy_c1')
        if split == 'train':
            softmax, loss_c1 = model.SoftmaxWithLoss(
                ['pred_c1', labels], ['softmax_c1', 'loss_c1'], scale=scale
            )
        elif split in ['test', 'val']:
            softmax = model.Softmax('pred_c1', 'softmax_c1', engine='CUDNN')
            loss_c1 = None
        losses.append(loss_c1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



self_supervision_benchmark/modeling/supervised/caffenet_bvlc_supervised_finetune_linear.py [41:70]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    resize_c1 = model.AveragePool(
        relu1, relu1 + '_s4k19_resize', kernel=19, stride=4, pad=0
    )
    bn_c1 = model.SpatialBN(
        resize_c1, resize_c1 + '_bn', 96, 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_c1 + '_s'], bn_c1 + '_s', value=1.0
        )
        model.param_init_net.ConstantFill(
            [bn_c1 + '_b'], bn_c1 + '_b', value=0.0
        )
    fc_conv1 = model.FC(
        bn_c1, 'fc_c1', 96 * 10 * 10, num_classes,
        weight_init=('GaussianFill', {'std': 0.01}),
        bias_init=('ConstantFill', {'value': 0.0}),
    )
    model.net.Alias(fc_conv1, 'pred_c1')
    if not cfg.MODEL.EXTRACT_FEATURES_ONLY:
        model.Accuracy([fc_conv1, labels], 'accuracy_c1')
        if split == 'train':
            softmax, loss_c1 = model.SoftmaxWithLoss(
                ['pred_c1', labels], ['softmax_c1', 'loss_c1'], scale=scale
            )
        elif split in ['test', 'val']:
            softmax = model.Softmax('pred_c1', 'softmax_c1', engine='CUDNN')
            loss_c1 = None
        losses.append(loss_c1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



