def standardize(layer, offset, scale, shared_axes='auto'):
 layer = BiasLayer(layer, (- offset), shared_axes)
 layer.params[layer.b].remove('trainable')
 layer = ScaleLayer(layer, (floatX(1.0) / scale), shared_axes)
 layer.params[layer.scales].remove('trainable')
 return layer

def standardize ( layer , offset , scale , shared_axes = 'auto' ) : layer = BiasLayer ( layer , ( - offset ) , shared_axes ) layer . params [ layer . b ] . remove ( 'trainable' ) layer = ScaleLayer ( layer , ( floatX ( 1.0 ) / scale ) , shared_axes ) layer . params [ layer . scales ] . remove ( 'trainable' ) return layer
convenience function for standardizing inputs by applying a fixed offset and scale .