rztdl.dl.components.layers.advanced package

Submodules

rztdl.dl.components.layers.advanced.embedding module

class rztdl.dl.components.layers.advanced.embedding.Embedding(name: str, input_dim: int, output_dim: int, embeddings_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.RandomUniform object>, embeddings_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, input_length: int = None, mask_zero: bool = False, scopes: typing.Union[str, typing.List[str]] = None, inputs: typing.Union[str, tensorflow.python.framework.ops.Tensor] = None, outputs: str = None, trainable: bool = True)[source]

Bases: tensorflow.python.keras.layers.embeddings.Embedding, rztdl.dl.components.layers.layer.Layer

Turns positive integers (indexes) into dense vectors of fixed size

Parameters:
  • name (str) – Name
  • outputs (Optional[str]) – Output of Embedding layer
  • inputs (Union[str, Tensor, None]) – Input to embedding layer
  • input_dim (int) – int > 0. Size of the vocabulary, i.e. maximum integer index + 1
  • output_dim (int) – int > 0. Dimension of the dense embedding.
  • embeddings_initializer (Initializer) – Initializer for the embeddings matrix
  • embeddings_regularizer (Optional[Regularizer]) – Regularizer function applied to the embeddings matrix.

# :param embeddings_constraint: Constraint function applied to the embeddings matrix. :type mask_zero: bool :param mask_zero: Whether or not the input value 0 is a special “padding” value that should be masked out :type input_length: Optional[int] :param input_length: Length of input sequences, when it is constant. :type scopes: Union[str, List[str], None] :param scopes: list of Tags which can be used to train only specific layers during train :type trainable: bool :param trainable: Indicates if layer should to be trained or not

parameter_validation(input_dim, output_dim, input_length)[source]
validate(*inputs, **kwargs)[source]

rztdl.dl.components.layers.advanced.gaussian_noise module

@created on: 2020-01-29,
@author: shubham,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.dl.components.layers.advanced.gaussian_noise.GaussianNoise(name: str, stddev: float, inputs: typing.Union[str, tensorflow.python.framework.ops.Tensor] = None, outputs: str = None)[source]

Bases: tensorflow.python.keras.layers.noise.GaussianNoise, rztdl.dl.components.layers.layer.Layer

Apply additive zero-centered Gaussian noise Useful in mitigating over-fitting

Parameters:
  • name (str) – Component name
  • stddev (float) – Float, standard deviation of the noise distribution
  • inputs (Union[str, Tensor, None]) – Input tensor/Input name
  • outputs (Optional[str]) – Output tensor name
create(inputs)[source]
parameter_validation()[source]
validate(inputs)[source]

rztdl.dl.components.layers.advanced.highway_conv module

@created on: 2020-02-04,
@author: shubham,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.dl.components.layers.advanced.highway_conv.HighwayConv(name: str, kernel_size: typing.Union[int, typing.List[int]] = (1, 1), strides: typing.Union[int, typing.List[int]] = (1, 1), data_format: rztdl.dl.constants.string_constants.DataFormat = <DataFormat.CHANNELS_LAST: 'CHANNELS_LAST'>, transform_kernel_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.GlorotUniform object>, highway_kernel_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.GlorotUniform object>, carry_bias_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.Constant object>, transform_bias_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.Zeros object>, highway_kernel_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, highway_bias_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, transform_kernel_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, transform_bias_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, highway_activity_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, highway_kernel_constraint: rztdl.dl.helpers.constraints.Constraint = None, highway_bias_constraint: rztdl.dl.helpers.constraints.Constraint = None, transform_activity_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, transform_kernel_constraint: rztdl.dl.helpers.constraints.Constraint = None, transform_bias_constraint: rztdl.dl.helpers.constraints.Constraint = None, dropout_rate: float = 0.0, inputs: typing.Union[str, tensorflow.python.framework.ops.Tensor] = None, outputs: str = None, scopes: typing.Union[str, typing.List[str]] = None, trainable: bool = True, normalization: rztdl.dl.helpers.normalizers.Normalizer = None)[source]

Bases: tensorflow.python.keras.engine.base_layer.Layer, rztdl.dl.components.layers.layer.Layer

Highway Conv layer

Parameters:
  • name (str) – Name of the component
  • kernel_size (Union[int, List[int]]) – height and width of the 2D convolution window
  • strides (Union[int, List[int]]) – specifies the strides of the convolution along the height and width
  • data_format (DataFormat) – ordering of the dimensions in the inputs. “CHANNELS_LAST”: (batch, height, width, channels) “CHANNEL_FIRST”: (batch, channels, height, width)
  • transform_kernel_initializer (Initializer) – Initializer for the kernel weights matrix for transform
  • highway_kernel_initializer (Initializer) – Initializer for the kernel weights matrix for highway
  • carry_bias_initializer (Initializer) – Carry bias initializer
  • transform_bias_initializer (Initializer) – Initializer for the kernel bias matrix of transform gate
  • highway_kernel_regularizer (Optional[Regularizer]) – Regularizer function applied to the kernel weights matrix of highway
  • highway_bias_regularizer (Optional[Regularizer]) – Regularizer function applied to the bias matrix of highway
  • transform_kernel_regularizer (Optional[Regularizer]) – Regularizer function applied to the kernel weights matrix of transform gate
  • transform_bias_regularizer (Optional[Regularizer]) – Regularizer function applied to the bias matrix of transform gate
  • highway_activity_regularizer (Optional[Regularizer]) – Regularizer function applied to the output of the highway (its “activation”)
  • highway_kernel_constraint (Optional[Constraint]) – Constraint function applied to the kernel matrix of highway
  • highway_bias_constraint (Optional[Constraint]) – Constraint function applied to the highway bias matrix
  • transform_activity_regularizer (Optional[Regularizer]) – Regularizer function applied to the output of the transform (its “activation”)
  • transform_kernel_constraint (Optional[Constraint]) – Constraint function applied to the kernel matrix of transform
  • transform_bias_constraint (Optional[Constraint]) – Constraint function applied to the transform bias matrix
  • dropout_rate (float) – Rate of Dropout apply on output
  • inputs (Union[str, Tensor, None]) – Input Tensor
  • outputs (Optional[str]) – Output Tensor
  • scopes (Union[str, List[str], None]) – list of Tags which can be used to train only specific layers during train
  • trainable (bool) – Indicates if layer should to be trained or not
  • normalization (Optional[Normalizer]) – Normalization to be used
create(inputs)[source]
parameter_validation(kernel_size, strides, highway_kernel_constraint, highway_bias_constraint, transform_kernel_constraint, transform_bias_constraint)[source]
validate(inputs)[source]

Module contents