Skip to content

one_remainder

Bases: constant_remainder

The one remainder function.

As a special case of constant remainder, the zero remainder returns constant one vector as the remainder term. This class inherits from the constant remainder class.

...

Notes

The zero remainder function \(\pi: {R}^m \to {R}^n\) just projects all inputs to a constant one vector, i.e., $$ \begin{equation} \pi(\mathbf{x}) = \mathbf{1}^n \in {R}^n. \end{equation} $$

By default, the remainder term will also be processed with the optional activation functions.

Attributes:

Name Type Description
name str, default = 'one_remainder'

Name of the one remainder function.

Methods:

Name Description
__init__

It initializes the zero remainder function.

Source code in tinybig/remainder/basic_remainder.py
class one_remainder(constant_remainder):
    r"""
    The one remainder function.

    As a special case of constant remainder, the zero remainder returns constant one vector as the remainder term.
    This class inherits from the constant remainder class.

    ...

    Notes
    ----------
    The zero remainder function $\pi: {R}^m \to {R}^n$ just projects all inputs to a constant one vector, i.e.,
    $$
        \begin{equation}
            \pi(\mathbf{x}) =  \mathbf{1}^n \in {R}^n.
        \end{equation}
    $$

    By default, the remainder term will also be processed with the optional activation functions.

    Attributes
    ----------
    name: str, default = 'one_remainder'
        Name of the one remainder function.

    Methods
    ----------
    __init__
        It initializes the zero remainder function.
    """
    def __init__(self, name='one_remainder', *args, **kwargs):
        """
        The initialization method of the one remainder function.

        It initializes a one remainder function object.
        This method will also call the initialization method of the base class as well.

        Parameters
        ----------
        name: str, default = 'one_remainder'
            Name of the one remainder function.

        Returns
        ----------
        object
            The one remainder function object.
        """
        super().__init__(name=name, c=1.0, *args, **kwargs)

__init__(name='one_remainder', *args, **kwargs)

The initialization method of the one remainder function.

It initializes a one remainder function object. This method will also call the initialization method of the base class as well.

Parameters:

Name Type Description Default
name

Name of the one remainder function.

'one_remainder'

Returns:

Type Description
object

The one remainder function object.

Source code in tinybig/remainder/basic_remainder.py
def __init__(self, name='one_remainder', *args, **kwargs):
    """
    The initialization method of the one remainder function.

    It initializes a one remainder function object.
    This method will also call the initialization method of the base class as well.

    Parameters
    ----------
    name: str, default = 'one_remainder'
        Name of the one remainder function.

    Returns
    ----------
    object
        The one remainder function object.
    """
    super().__init__(name=name, c=1.0, *args, **kwargs)