class documentation

class BaseLayer: (source)

Known subclasses: shamboflow.layers.Dense

Constructor: BaseLayer(name, trainable)

View In Hierarchy

The base class for layers to inherit from.

A layer is an object that is a part of the neural network. It performs calculations on neurons or neurons present in it commonly. It can also not have computable neurons, instead can also be used to filter data from previous layers.

Attributes
name:
The name of the layer
trainable:
Is the layer trainable
is_built:
Is the layer built and initialized
Method __init__ Constructor for the base layer class
Method build Method to build and initialize the layer.
Method compute Method to compute various parameter
Instance Variable activation Activation function used by the layer
Instance Variable activation_str The name of the activation function
Instance Variable bias_array Bias values of the layer
Instance Variable error_array Error values of the layer
Instance Variable is_built has the layer been built and compiled
Instance Variable leakyrelu_slope Slope value if using leakyrelu activation function
Instance Variable midway Output value before applying avtivation function
Instance Variable name Name of the layer
Instance Variable output_array Output matrix of the layer
Instance Variable trainable Is the layer trainable
def __init__(self, name: str, trainable: bool = True): (source)

Constructor for the base layer class

Args
name:
Name of the layer
trainable:
Is the layer trainable. Default is True
def build(self): (source)

Method to build and initialize the layer.

This method is to be overidden by child classes to build them by their own logic.

def compute(self): (source)

Method to compute various parameter

This method is to be implemented in inherited classes

activation = (source)

Activation function used by the layer

activation_str: str = (source)

The name of the activation function

bias_array: np.ndarray = (source)

Bias values of the layer

error_array: np.ndarray = (source)

Error values of the layer

is_built: bool = (source)

has the layer been built and compiled

leakyrelu_slope: float = (source)

Slope value if using leakyrelu activation function

midway: np.ndarray = (source)

Output value before applying avtivation function

Name of the layer

output_array: np.ndarray = (source)

Output matrix of the layer

trainable: bool = (source)

Is the layer trainable