neupy.layers.Transpose

class neupy.layers.Transpose[source]

Transposes input. Permutes the dimensions according to perm.

Parameters:
perm : tuple or list

A permutation of the dimensions of the input tensor. Layer cannot transpose batch dimension and using 0 in the list of permuted dimensions is not allowed.

name : str or None

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

Examples

>>> from neupy.layers import *
>>> conn = Input((7, 11)) > Transpose((2, 1))
>>> conn.input_shape
(7, 11)
>>> conn.output_shape
(11, 7)
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.
options = {'name': Option(class_name='BaseLayer', value=Property(name="name")), 'perm': Option(class_name='Transpose', value=TypedListProperty(name="perm"))}[source]
output(input_value)[source]

Return output base on the input value.

Parameters:
input_value
output_shape[source]
perm = None[source]
validate(input_shape)[source]

Validate input shape value before assigning it.

Parameters:
input_shape : tuple with int