In Caffe we can set learning rate as 0 by using ‘lr_mult: 0’ . It means only the mean/var are calculating , but no parameter is learnt in training.

layer {
    name: "bn_conv1"
    type: "BatchNorm"
    bottom: "data"
    top: "bn_conv1"
    batch_norm_param {
        use_global_stats: false
    }
    param {
        lr_mult: 0
    }
    param {
        lr_mult: 0
    }
    param {
        lr_mult: 0
    }
    include {
        phase: TRAIN
    }
}

layer {
    name: "scale_conv1"
    type: "Scale"
    bottom: "bn_conv1"
    top: "bn_conv1"
    scale_param {
        bias_term: true
    }
}


In Pytorch, Is  “affine=False”  the same as “lr_mult:0”?
·
 nn.BatchNorm3d(num_features=64, momentum=0.999, affine=False)