neuralmonkey.model.gradient_blocking module¶
Module that blocks gradient propagation to model parts.
-
class
neuralmonkey.model.gradient_blocking.SpatialStatefulView(blocked_object: neuralmonkey.model.stateful.SpatialStateful) → None¶ Bases:
neuralmonkey.model.stateful.SpatialStateful-
__init__(blocked_object: neuralmonkey.model.stateful.SpatialStateful) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
spatial_mask¶ Return mask for the spatial_states.
A 3D Tensor of shape (batch, width, height) of type float32 which masks the spatial states that they can be of different shapes. The mask should only contain ones or zeros.
-
spatial_states¶ Return object states in space.
A 4D Tensor of shape (batch, width, height, state_size) which contains the states of the object in space (e.g. final layer of a convolution network processing an image.
-
-
class
neuralmonkey.model.gradient_blocking.SpatialStatefulWithOutputView(blocked_object: neuralmonkey.model.stateful.SpatialStatefulWithOutput) → None¶ Bases:
neuralmonkey.model.stateful.SpatialStatefulWithOutput,neuralmonkey.model.gradient_blocking.SpatialStatefulView,neuralmonkey.model.gradient_blocking.StatefulView-
__init__(blocked_object: neuralmonkey.model.stateful.SpatialStatefulWithOutput) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
neuralmonkey.model.gradient_blocking.StatefulView(blocked_object: neuralmonkey.model.stateful.Stateful) → None¶ Bases:
neuralmonkey.model.stateful.Stateful-
__init__(blocked_object: neuralmonkey.model.stateful.Stateful) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
output¶ Return the object output.
A 2D Tensor of shape (batch, state_size) which contains the resulting state of the object.
-
-
class
neuralmonkey.model.gradient_blocking.TemporalStatefulView(blocked_object: neuralmonkey.model.stateful.TemporalStateful) → None¶ Bases:
neuralmonkey.model.stateful.TemporalStateful-
__init__(blocked_object: neuralmonkey.model.stateful.TemporalStateful) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
temporal_mask¶ Return mask for the temporal_states.
A 2D Tensor of shape (batch, time) of type float32 which masks the temporal states so each sequence can have a different length. It should only contain ones or zeros.
-
temporal_states¶ Return object states in time.
A 3D Tensor of shape (batch, time, state_size) which contains the states of the object in time (e.g. hidden states of a recurrent encoder.
-
-
class
neuralmonkey.model.gradient_blocking.TemporalStatefulWithOutputView(blocked_object: neuralmonkey.model.stateful.TemporalStatefulWithOutput) → None¶ Bases:
neuralmonkey.model.stateful.TemporalStatefulWithOutput,neuralmonkey.model.gradient_blocking.TemporalStatefulView,neuralmonkey.model.gradient_blocking.StatefulView-
__init__(blocked_object: neuralmonkey.model.stateful.TemporalStatefulWithOutput) → None¶ Initialize self. See help(type(self)) for accurate signature.
-