Example #1
0
    def __init__(self):
        """
        Tanh constructor
        """

        Module.__init__(self)
        self.s = None
Example #2
0
    def __init__(self):
        """
        LossCrossEntropy constructor
        """

        Module.__init__(self)
        self.y = None
        self.target = None
        self.target_onehot = None
Example #3
0
    def __init__(self):
        """
        LossMSE constructor
        """

        Module.__init__(self)
        self.y = None
        self.target = None
        self.e = None
        self.n = None
Example #4
0
    def __init__(self, alpha=0.01):
        """
        LeakyReLU constructor

        :param alpha: non-negative float

        :raises ValueError, if `alpha` is not a non-negative float
        """

        if not isinstance(alpha, float) or alpha < 0:
            raise ValueError("LeakyReLU alpha must be a non-negative float")

        Module.__init__(self)
        self.alpha = alpha
        self.s = None
Example #5
0
    def __init__(self):
        """ Sigmoid constructor """

        Module.__init__(self)
        self.s = None