math_util ========= .. py:module:: topmost.models.hierarchical.HyperMiner.manifolds.math_util .. autoapi-nested-parse:: Math utils functions. Module Contents --------------- .. autoapisummary:: topmost.models.hierarchical.HyperMiner.manifolds.math_util.Tan topmost.models.hierarchical.HyperMiner.manifolds.math_util.Tanh topmost.models.hierarchical.HyperMiner.manifolds.math_util.TanC topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArTan topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArTanh topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArTanC topmost.models.hierarchical.HyperMiner.manifolds.math_util.Cos topmost.models.hierarchical.HyperMiner.manifolds.math_util.Cosh topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArCos topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArCosh topmost.models.hierarchical.HyperMiner.manifolds.math_util.Sin topmost.models.hierarchical.HyperMiner.manifolds.math_util.Sinh topmost.models.hierarchical.HyperMiner.manifolds.math_util.SinC topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArSin topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArSinh topmost.models.hierarchical.HyperMiner.manifolds.math_util.ArSinC .. py:function:: Tan(x) Computes tangent of x element-wise. :param x: A tensor. :type x: tensor :returns: A tensor. Has the same type as x. .. py:function:: Tanh(x) Computes hyperbolic tangent of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type as x. :rtype: A tensor .. py:function:: TanC(x, c) A unified tangent and inverse tangent function for different signs of curvatures. This function is used in k-Stereographic model, a unification of constant curvature manifolds. Please refer to https://arxiv.org/abs/2007.07698 for more details. First-order expansion is used in order to calculate gradients correctly when c is zero. :param x: A tensor. :type x: tensor :param c: Manifold curvature. :type c: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: ArTan(x) Computes inverse tangent of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type as x. :rtype: A tensor .. py:function:: ArTanh(x) Computes inverse hyperbolic tangent of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type as x. :rtype: A tensor .. py:function:: ArTanC(x, c) A unified hyperbolic tangent and inverse hyperbolic tangent function for different signs of curvatures. This function is used in k-Stereographic model, a unification of constant curvature manifolds. Please refer to https://arxiv.org/abs/2007.07698 for more details. First-order expansion is used in order to calculate gradients correctly when c is zero. :param x: A tensor. :type x: tensor :param c: Manifold curvature. :type c: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: Cos(x) Computes cosine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: Cosh(x) Computes hyperbolic cosine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: ArCos(x) Computes inverse cosine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: ArCosh(x) Computes inverse hyperbolic cosine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: Sin(x) Computes sine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: Sinh(x) Computes hyperbolic sine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: SinC(x, c) A unified sine and inverse sine function for different signs of curvatures. This function is used in k-Stereographic model, a unification of constant curvature manifolds. Please refer to https://arxiv.org/abs/2007.07698 for more details. First-order expansion is used in order to calculate gradients correctly when c is zero. :param x: A tensor. :type x: tensor :param c: Manifold curvature. :type c: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: ArSin(x) Computes inverse sine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: ArSinh(x) Computes inverse hyperbolic sine of x element-wise. :param x: A tensor. :type x: tensor :returns: Has the same type of x. :rtype: A tensor .. py:function:: ArSinC(x, c) A unified hyperbolic sine and inverse hyperbolic sine function for different signs of curvatures. This function is used in k-Stereographic model, a unification of constant curvature manifolds. Please refer to https://arxiv.org/abs/2007.07698 for more details. First-order expansion is used in order to calculate gradients correctly when c is zero. :param x: A tensor. :type x: tensor :param c: Manifold curvature. :type c: tensor :returns: Has the same type of x. :rtype: A tensor