neupy.layers.LocalResponseNorm

class neupy.layers.LocalResponseNorm[source]

Local Response Normalization Layer.

Aggregation is purely across channels, not within channels, and performed “pixelwise”.

If the value of the \(i\) th channel is \(x_i\), the output is

\[x_i = \frac{x_i}{ (k + ( \alpha \sum_j x_j^2 ))^\beta }\]

where the summation is performed over this position on \(n\) neighboring channels.

Parameters:
alpha : float

Coefficient, see equation above

beta : float

Offset, see equation above

k : float

Exponent, see equation above

depth_radius : int

Number of adjacent channels to normalize over, must be odd.

name : str or None

Layer’s identifier. If name is equal to None than name will be generated automatically. Defaults to None.

Attributes:
input_shape : tuple

Returns layer’s input shape in the form of a tuple. Shape will not include batch size dimension.

output_shape : tuple

Returns layer’s output shape in the form of a tuple. Shape will not include batch size dimension.

training_state : bool

Defines whether layer in training state or not. Training state will enable some operations inside of the layers that won’t work otherwise.

parameters : dict

Parameters that networks uses during propagation. It might include trainable and non-trainable parameters.

graph : LayerGraph instance

Graphs that stores all relations between layers.

Methods

disable_training_state() Context manager that switches off trainig state.
initialize() Set up important configurations related to the layer.
alpha = None[source]
beta = None[source]
depth_radius = None[source]
k = None[source]
options = {'alpha': Option(class_name='LocalResponseNorm', value=NumberProperty(name="alpha")), 'beta': Option(class_name='LocalResponseNorm', value=NumberProperty(name="beta")), 'depth_radius': Option(class_name='LocalResponseNorm', value=IntProperty(name="depth_radius")), 'k': Option(class_name='LocalResponseNorm', value=NumberProperty(name="k")), 'name': Option(class_name='BaseLayer', value=Property(name="name"))}[source]
output(input_value)[source]

Return output base on the input value.

Parameters:
input_value
validate(input_shape)[source]

Validate input shape value before assigning it.

Parameters:
input_shape : tuple with int