rztdl.dl.components.layers.primitive package

Submodules

rztdl.dl.components.layers.primitive.activation module

@created on: 17/12/19,
@author: Umesh Kumar,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.dl.components.layers.primitive.activation.Activation(name: str, activation: rztdl.dl.helpers.activations.Activation = <rztdl.dl.helpers.activations.Linear object>, inputs: typing.Union[str, tensorflow.python.framework.ops.Tensor] = None, outputs: str = None)[source]

Bases: tensorflow.python.keras.layers.core.Activation, rztdl.dl.components.layers.layer.Layer

Activation class

Parameters:
  • name (str) – Name of the Instance
  • activation (Activation) – Activaion
  • inputs (Union[str, Tensor, None]) – Input to activation layer
  • outputs (Optional[str]) – Activation Layer Output
create(inputs)[source]
validate(inputs)[source]

rztdl.dl.components.layers.primitive.batch_normalization module

@created on: 1/24/20, @author: Vivek A Gupta,

Description:

..todo:

.. py:class:: BatchNormalization(name: str, inputs: typing.Union[str, tensorflow.python.framework.ops.Tensor] = None, outputs: str = None, scopes: typing.Union[str, typing.List[str]] = None, axis: int = -1, momentum: float = 0.99, epsilon: float = 0.001, center: bool = False, scale: bool = False, beta_initializer: rztdl.dl.helpers.initializers.Initializer = None, gamma_initializer: rztdl.dl.helpers.initializers.Initializer = None, moving_mean_initializer: rztdl.dl.helpers.initializers.Initializer = None, moving_variance_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.Ones object>, beta_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, gamma_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, beta_constraint: int = None, gamma_constraint: int = None, trainable: bool = True)
module:rztdl.dl.components.layers.primitive.batch_normalization

Bases: tensorflow.python.keras.layers.normalization_v2.BatchNormalization, rztdl.dl.components.layers.layer.Layer

Batch Normalization

type name:str
param name:Name of the layer
type inputs:Union[str, Tensor, None]
param inputs:Inputs
type outputs:Optional[str]
param outputs:Outputs
type scopes:Union[str, List[str], None]
param scopes:Scopes
type axis:int
param axis:Integer, the axis that should be normalized (typically the features axis). For instance, after a

Conv2D layer with data_format=”channels_first”, set axis=1 in BatchNormalization. :type momentum: float :param momentum: Momentum for the moving average. :type epsilon: float :param epsilon: Small float added to variance to avoid dividing by zero. :type center: bool :param center: If True, add offset of beta to normalized tensor. If False, beta is ignored. :type scale: bool :param scale: If True, multiply by gamma. If False, gamma is not used. When the next layer is linear (also e.g. nn.relu), this can be disabled since the scaling will be done by the next layer. :type beta_initializer: Optional[Initializer] :param beta_initializer: Initializer for the beta weight. :type gamma_initializer: Optional[Initializer] :param gamma_initializer: Initializer for the gamma weight. :type moving_mean_initializer: Optional[Initializer] :param moving_mean_initializer: Initializer for the moving mean. :type moving_variance_initializer: Initializer :param moving_variance_initializer: Initializer for the moving variance. :type beta_regularizer: Optional[Regularizer] :param beta_regularizer: Optional regularizer for the beta weight. :type gamma_regularizer: Optional[Regularizer] :param gamma_regularizer: Optional regularizer for the gamma weight. :type beta_constraint: Optional[int] :param beta_constraint: Optional constraint for the beta weight. :type gamma_constraint: Optional[int] :param gamma_constraint: Optional constraint for the gamma weight. :type trainable: bool :param trainable: Boolean, if True the variables will be marked as trainable.

BatchNormalization.create(inputs)[source]
BatchNormalization.parameter_validation(name, center, scale, beta_params, gamma_params)[source]
BatchNormalization.validate(inputs)[source]

rztdl.dl.components.layers.primitive.dense module

@created on: 16/12/19,
@author: Umesh Kumar,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.dl.components.layers.primitive.dense.Dense(units: int, name: str, kernel_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.GlorotUniform object>, bias_initializer: rztdl.dl.helpers.initializers.Initializer = <rztdl.dl.helpers.initializers.Zeros object>, activation: rztdl.dl.helpers.activations.Activation = <rztdl.dl.helpers.activations.Linear object>, inputs: typing.Union[str, tensorflow.python.framework.ops.Tensor] = None, outputs: str = None, dropout_rate: float = 0.0, scopes: typing.Union[str, typing.List[str]] = None, kernel_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, bias_regularizer: rztdl.dl.helpers.regularizers.Regularizer = None, kernel_constraint: rztdl.dl.helpers.constraints.Constraint = None, bias_constraint: rztdl.dl.helpers.constraints.Constraint = None, trainable: bool = True, normalization: rztdl.dl.helpers.normalizers.Normalizer = None)[source]

Bases: tensorflow.python.keras.layers.core.Dense, rztdl.dl.components.layers.layer.Layer

Dense layer

Parameters:
  • units (int) – No of units
  • name (str) – Layer Name
  • kernel_initializer (Initializer) – Kernel Weight Initializer
  • bias_initializer (Initializer) – Bias Initializer
  • activation (Activation) – Activation Function
  • kernel_regularizer (Optional[Regularizer]) – Regularizer function applied to the kernel weights matrix.
  • bias_regularizer (Optional[Regularizer]) – Regularizer function applied to the bias vector.
  • kernel_constraint (Optional[Constraint]) – Constraint function applied to the kernel weights matrix.
  • bias_constraint (Optional[Constraint]) – Constraint function applied to the bias vector.
  • inputs (Union[str, Tensor, None]) – Input Tensor to Dense layer
  • outputs (Optional[str]) – Output Tensor of Dense layer
  • dropout_rate (float) – Rate of Dropout apply on output
  • scopes (Union[str, List[str], None]) – list of Tags which can be used to train only specific layers during train
  • trainable (bool) – IF layer has to be trained
  • normalization (Optional[Normalizer]) – Normalization to be used
parameter_validation(bias_initializer, kernel_constraint, bias_constraint)[source]
validate(inputs)[source]

rztdl.dl.components.layers.primitive.dropout module

@created on: 30/12/19,
@author: Umesh Kumar,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.dl.components.layers.primitive.dropout.Dropout(name: str, rate: float, noise_shape: int = None, seed: int = None, inputs: typing.Union[str, tensorflow.python.framework.ops.Tensor] = None, outputs: str = None)[source]

Bases: tensorflow.python.keras.layers.core.Dropout, rztdl.dl.components.layers.layer.Layer

Dropout Layer

Parameters:
  • name (str) – Layer name
  • rate (float) – Dropout rate
  • noise_shape (Optional[int]) – 1D integer tensor representing the shape of the binary dropout mask that will be multiplied with the input
  • seed (Optional[int]) – Random Seed
  • inputs (Union[str, Tensor, None]) – Input Tensor
  • outputs (Optional[str]) – Output Tensor
create(inputs)[source]
validate(inputs)[source]

rztdl.dl.components.layers.primitive.input module

@created on: 12/13/19, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.dl.components.layers.primitive.input.Input(shape: typing.List[int], name: str, outputs: str = None)[source]

Bases: rztdl.dl.components.layers.layer.Layer

Input layer : Used to feed data to model

Parameters:
  • shape (List[int]) – Shape of data to be fed to the layer (Don’t provide batch size)
  • name (str) – Name
  • outputs (Optional[str]) – Output dent from Input layer
create()[source]
parameter_validation(**kwargs)[source]
validate(inputs)[source]

rztdl.dl.components.layers.primitive.multi_output_layer module

@created on: 1/7/20, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.dl.components.layers.primitive.multi_output_layer.MultiIOLayer(name: str, parameters: dict, inputs, outputs)[source]

Bases: rztdl.dl.components.custom_component.CustomComponent

call(inputs, **kwargs)[source]
validate(**inputs)[source]
class rztdl.dl.components.layers.primitive.multi_output_layer.MyDenseLayer(num_outputs, name, a_out, b_out, inputs=None)[source]

Bases: tensorflow.python.keras.engine.base_layer.Layer, rztdl.dl.components.component.RZTComponent

build(input_shape)[source]
call(inputs, **kwargs)[source]
create(inputs)[source]
get_config()[source]
parameter_validation(**kwargs)[source]
validate(**kwargs)[source]

Module contents

@created on: 2019-12-03, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status: