# Path: mla/neuralnet/initializations.py
# def get_initializer(name):
#     """Returns initialization function by the name."""
#     try:
#         return globals()[name]
#     except Exception:
#         raise ValueError("Invalid initialization function.")


import numpy as np
from mla.neuralnet.initializations import get_initializer
class Parameters(object):
    def __init__(self, init="glorot_uniform", scale=0.5, bias=1.0, regularizers=None, constraints=None):
        """A container for layer's parameters.

        Parameters
        ----------
        init : str, default 'glorot_uniform'.
            The name of the weight initialization function.
        scale : float, default 0.5
        bias : float, default 1.0
            Initial values for bias.
        regularizers : dict
            Weight regularizers.
            >>> {'W' : L2()}
        constraints : dict
            Weight constraints.
            >>> {'b' : MaxNorm()}
        """
        if constraints is None:
            self.constraints = {}
        else:
            self.constraints = constraints

        if regularizers is None:
            self.regularizers = {}
        else:
            self.regularizers = regularizers

        self.initial_bias = bias
        self.scale = scale

# Path: mla/neuralnet/initializations.py
# def get_initializer(name):
#     """Returns initialization function by the name."""
#     try:
#         return globals()[name]
#     except Exception:
#         raise ValueError("Invalid initialization function.")


# Path: mla/neuralnet/parameters.py
import numpy as np
from mla.neuralnet.initializations import get_initializer

class Parameters(object):
    def __init__(self, init="glorot_uniform", scale=0.5, bias=1.0, regularizers=None, constraints=None):
        """A container for layer's parameters.

        Parameters
        ----------
        init : str, default 'glorot_uniform'.
            The name of the weight initialization function.
        scale : float, default 0.5
        bias : float, default 1.0
            Initial values for bias.
        regularizers : dict
            Weight regularizers.
            >>> {'W' : L2()}
        constraints : dict
            Weight constraints.
            >>> {'b' : MaxNorm()}
        """
        if constraints is None:
            self.constraints = {}
        else:
            self.constraints = constraints

        if regularizers is None:
            self.regularizers = {}
        else:
            self.regularizers = regularizers

        self.initial_bias = bias
        self.scale = scale

        self.init = get_initializer(init)