mygrad.arccosh#
- class mygrad.arccosh(x: ArrayLike, out: Tensor | ndarray | None = None, *, where: Mask = True, dtype: DTypeLikeReals = None, constant: bool | None = None)#
Inverse hyperbolic cosine, element-wise.
This docstring was adapted from that of numpy.arccosh [3]
- Parameters:
- xArrayLike
Input tensor.
- outOptional[Union[Tensor, ndarray]]
A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated tensor is returned.
- constantOptional[bool]
If
True
, this tensor is treated as a constant, and thus does not facilitate back propagation (i.e.constant.grad
will always returnNone
). Defaults toFalse
for float-type data. Defaults toTrue
for integer-type data. Integer-type tensors must be constant.- whereMask
This condition is broadcast over the input. At locations where the condition is True, the
out
tensor will be set to the ufunc result. Elsewhere, theout
tensor will retain its original value. Note that if an uninitialized out tensor is created via the defaultout=None
, locations within it where the condition is False will remain uninitialized.- dtypeOptional[DTypeLikeReals]
The dtype of the resulting tensor.
- Returns:
- arccoshTensor
Tensor of the same shape as x.
Notes
arccosh is a multivalued function: for each x there are infinitely many numbers z such that cosh(z) = x. The convention is to return the z whose imaginary part lies in [-pi, pi] and the real part in
[0, inf]
.For real-valued input data types, arccosh always returns real output. For each value that cannot be expressed as a real number or infinity, it yields
nan
and sets the invalid floating point error flag.References
[1]M. Abramowitz and I.A. Stegun, “Handbook of Mathematical Functions”, 10th printing, 1964, pp. 86. http://www.math.sfu.ca/~cbm/aands/
[2]Wikipedia, “Inverse hyperbolic function”, https://en.wikipedia.org/wiki/Arccosh
[3]Retrieved from https://numpy.org/doc/stable/reference/generated/numpy.arccosh.html
Examples
>>> import mygrad as mg >>> mg.arccosh([mg.e, 10.0]) Tensor([ 1.65745445, 2.99322285]) >>> mg.arccosh(1) Tensor(0.0)
(Source code, png, hires.png, pdf)
- Attributes:
- identity
- signature
Methods
accumulate
([axis, dtype, out, constant])Not implemented
at
(indices[, b, constant])Not implemented
outer
(b, *[, dtype, out])Not Implemented
reduce
([axis, dtype, out, keepdims, ...])Not Implemented
reduceat
(indices[, axis, dtype, out])Not Implemented
resolve_dtypes
(dtypes, *[, signature, ...])Find the dtypes NumPy will use for the operation.
- __init__(*args, **kwargs)#
Methods
__init__
(*args, **kwargs)accumulate
([axis, dtype, out, constant])Not implemented
at
(indices[, b, constant])Not implemented
outer
(b, *[, dtype, out])Not Implemented
reduce
([axis, dtype, out, keepdims, ...])Not Implemented
reduceat
(indices[, axis, dtype, out])Not Implemented
resolve_dtypes
(dtypes, *[, signature, ...])Find the dtypes NumPy will use for the operation.
Attributes
identity
nargs
nin
nout
ntypes
signature
types