def _get_conv_weights_bc01(layer):

    assert isinstance(layer, (MaxoutConvC01B, ConvElemwise))
    weights = layer.get_params()[0].get_value()

    if isinstance(layer, MaxoutConvC01B):
        c01b = Conv2DSpace(shape=weights.shape[1:3],
                           num_channels=weights.shape[0],
                           axes=('c', 0, 1, 'b'))

        bc01 = Conv2DSpace(shape=c01b.shape,
                           num_channels=c01b.num_channels,
                           axes=('b', 'c', 0, 1))

        weights = c01b.np_format_as(weights, bc01)
    elif isinstance(layer, ConvElemwise):
        weights = weights[:, :, ::-1, ::-1]  # reverse 0, 1 axes

    return weights
Returns a conv. layer's weights in BC01 format.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/scripts/browse_conv_weights.py/_get_conv_weights_bc01