olpy/classifiers/scw2.py
def _get_alpha(self, m_t, v_t):
        """Computes the alpha for the CW/SCW algorithms.
        
        The `alpha` variable is used to determine the magnitude of
        update that needs to be applied to the weights.

        Args:
            m_t (:obj:`float`): Represents whether there was an error in
                prediction or not. 1 for no error, -1 otherwise.
            v_t (:obj:`float`): Represents how far the point was from its
                actual value.

        Returns:
            float: the value for `alpha`.
        """
        n_t = v_t + 1 / (2 * self._C)
        return max(0, ((-(2 * m_t * n_t + self._phi ** 2 * m_t * v_t) +
                       math.sqrt((self._phi ** 4 * m_t ** 2 * v_t * 2 + 4 
                                  * n_t * v_t * self._phi ** 2 
                                  * (n_t + v_t * self._phi * 2)))) 
                        / (2 * (n_t ** 2 + n_t * v_t * self._phi ** 2))))
Computes the alpha for the CW/SCW algorithms.
        
        The `alpha` variable is used to determine the magnitude of
        update that needs to be applied to the weights.

        Args:
            m_t (:obj:`float`): Represents whether there was an error in
                prediction or not. 1 for no error, -1 otherwise.
            v_t (:obj:`float`): Represents how far the point was from its
                actual value.

        Returns:
            float: the value for `alpha`.
        
Computes the alpha for the CW/SCW algorithms.
The `alpha` variable is used to determine the magnitude of
update that needs to be applied to the weights.
Computes the alpha for the CW / SCW algorithms . The ` alpha ` variable is used to determine the magnitude of update that needs to be applied to the weights .
def _get_alpha(self, m_t, v_t):
        n_t = v_t + 1 / (2 * self._C)
        return max(0, ((-(2 * m_t * n_t + self._phi ** 2 * m_t * v_t) +
                       math.sqrt((self._phi ** 4 * m_t ** 2 * v_t * 2 + 4 
                                  * n_t * v_t * self._phi ** 2 
                                  * (n_t + v_t * self._phi * 2)))) 
                        / (2 * (n_t ** 2 + n_t * v_t * self._phi ** 2))))
def _get_alpha ( self , m_t , v_t ) : n_t = v_t + 1 / ( 2 * self . _C ) return max ( 0 , ( ( - ( 2 * m_t * n_t + self . _phi ** 2 * m_t * v_t ) + math . sqrt ( ( self . _phi ** 4 * m_t ** 2 * v_t * 2 + 4 * n_t * v_t * self . _phi ** 2 * ( n_t + v_t * self . _phi * 2 ) ) ) ) / ( 2 * ( n_t ** 2 + n_t * v_t * self . _phi ** 2 ) ) ) )
Computes the alpha for the CW/SCW algorithms.
Computes the alpha for the CW / SCW algorithms .
"""Computes the alpha for the CW/SCW algorithms.
        
        The `alpha` variable is used to determine the magnitude of
        update that needs to be applied to the weights.

        Args:
            m_t (:obj:`float`): Represents whether there was an error in
                prediction or not. 1 for no error, -1 otherwise.
            v_t (:obj:`float`): Represents how far the point was from its
                actual value.

        Returns:
            float: the value for `alpha`.
        """
the value for `alpha`.
the value for ` alpha ` .
float
self
m_t
v_t
m_t (
`float`): Represents whether there was an error in
prediction or not. 1 for no error, -1 otherwise.
` float ` ) : Represents whether there was an error in prediction or not . 1 for no error - 1 otherwise .
v_t (
`float`): Represents how far the point was from its
actual value.
` float ` ) : Represents how far the point was from its actual value .