Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tfb_tanh

Computes Y = tanh(X)


Description

Y = tanh(X), therefore Y in (-1, 1).

Usage

tfb_tanh(validate_args = FALSE, name = "tanh")

Arguments

validate_args

Logical, default FALSE. Whether to validate input with asserts. If validate_args is FALSE, and the inputs are invalid, correct behavior is not guaranteed.

name

name prefixed to Ops created by this class.

Details

This can be achieved by an affine transform of the Sigmoid bijector, i.e., it is equivalent to

tfb_chain(list(tfb_affine(shift = -1, scale = 2), tfb_sigmoid(), tfb_affine(scale = 2)))

However, using the Tanh bijector directly is slightly faster and more numerically stable.

Value

a bijector instance.

See Also


tfprobability

Interface to 'TensorFlow Probability'

v0.11.0.0
Apache License (>= 2.0)
Authors
Sigrid Keydana [aut, cre], Daniel Falbel [ctb], Kevin Kuo [ctb] (<https://orcid.org/0000-0001-7803-7901>), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.