WeightInitializer

class WeightInitializer

Bases: object

Base class that every weight inititualization.

This is the base class that all other weight initializers use, funciton init should be implemented that it returns a Tensor with the initialized weights.

Example:

class CustomWeightInitializer(WeightInitializer):
    def init(self, dimension: Tuple) -> Tensor:
        x = ... x must be a Tensor of dimensions given to the function
        return x
__init__()

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

init(dimension)

Initializes the weights.

init(dimension: Tuple) → numpy.ndarray

Initializes the weights.

Parameters

dimension (Tuple) – dimensions of weights in a network (input, output)

Returns

Tensor with dimensions of (input, output), when implemented

Return type

Tensor

Raises

NotImplementedError