Module light_labyrinth.hyperparams.weights_init

The light_labyrinth.hyperparams.weights_init module includes WeightsInit class that allows to initialize model's weights before training.

Expand source code
"""
The `light_labyrinth.hyperparams.weights_init` module includes `WeightsInit` class
that allows to initialize model's weights before training.
"""

from ._weights_initialization import LightLabyrinthWeightsInit

__all__ = ["LightLabyrinthWeightsInit"]

Classes

class LightLabyrinthWeightsInit (value, names=None, *, module=None, qualname=None, type=None, start=1)

This class allows to initialize Light Labyrinth model's weights either with zeros or randomly.

Examples

>>> from light_labyrinth.hyperparams.weights_init import LightLabyrinthWeightsInit
>>> from light_labyrinth.dim2 import LightLabyrinthClassifier
>>> model = LightLabyrinthClassifier(3, 3,
...                             weights_init=LightLabyrinthWeightsInit.Random)
Expand source code
class LightLabyrinthWeightsInit(Enum):
    """
    This class allows to initialize Light Labyrinth model's weights either
    with zeros or randomly.

    Examples
    --------
    >>> from light_labyrinth.hyperparams.weights_init import LightLabyrinthWeightsInit
    >>> from light_labyrinth.dim2 import LightLabyrinthClassifier
    >>> model = LightLabyrinthClassifier(3, 3,
    ...                             weights_init=LightLabyrinthWeightsInit.Random)
    """
    Default = 0
    """
    """
    Random = 1
    """
    Initializes model's weights randomly -- initial weights are drawn from the uniform distribution [-1,1].
    """
    Zeros = 2
    """
    Initializes model's weights with zeros.
    """

Ancestors

  • enum.Enum

Class variables

var Default
var Random

Initializes model's weights randomly – initial weights are drawn from the uniform distribution [-1,1].

var Zeros

Initializes model's weights with zeros.