ConvolutionAware

class lib.model.initializers.ConvolutionAware(eps_std: float = 0.05, seed: int | None = None, initialized: bool = False)

Bases: Initializer

Initializer that generates orthogonal convolution filters in the Fourier space. If this initializer is passed a shape that is not 3D or 4D, orthogonal initialization will be used.

Adapted, fixed and optimized from: https://github.com/keras-team/keras-contrib/blob/master/keras_contrib/initializers/convaware.py

Parameters:
  • eps_std (float) – The Standard deviation for the random normal noise used to break symmetry in the inverse Fourier transform. Default: 0.05

  • seed (int | None) – Used to seed the random generator. Default: None

  • initialized (bool) – This should always be set to False. To avoid Keras re-calculating the values every time the model is loaded, this parameter is internally set on first time initialization. Default:False

Return type:

The modified kernel weights

References

Armen Aghajanyan, https://arxiv.org/abs/1702.06295

Methods Summary

__call__(shape[, dtype])

Call function for the ICNR initializer.

clone()

from_config(config)

Instantiates an initializer from a configuration dictionary.

get_config()

Return the Convolutional Aware Initializer configuration.

Methods Documentation

__call__(shape: list[int] | tuple[int, ...], dtype: str | None = None) Tensor

Call function for the ICNR initializer.

Parameters:
  • shape (list[int] | tuple[int, ...]) – The required shape for the output tensor

  • dtype (str | None) – The data type for the tensor

Return type:

The modified kernel weights

clone()
classmethod from_config(config)

Instantiates an initializer from a configuration dictionary.

Example:

`python initializer = RandomUniform(-1, 1) config = initializer.get_config() initializer = RandomUniform.from_config(config) `

Parameters:

config – A Python dictionary, the output of get_config().

Returns:

An Initializer instance.

get_config() dict[str, Any]

Return the Convolutional Aware Initializer configuration.

Return type:

The configuration for Convolutional Aware Initialization

__call__(shape: list[int] | tuple[int, ...], dtype: str | None = None) Tensor

Call function for the ICNR initializer.

Parameters:
  • shape (list[int] | tuple[int, ...]) – The required shape for the output tensor

  • dtype (str | None) – The data type for the tensor

Return type:

The modified kernel weights

get_config() dict[str, Any]

Return the Convolutional Aware Initializer configuration.

Return type:

The configuration for Convolutional Aware Initialization