TanhLayer#

class usencrypt.ai.nn.layers.TanhLayer#

Hyperbolic tangent activation function in layer format for neural networks.

Parameters

name (str) – The layer’s string identifier.

Inheritance

Warning

The precision of this function is largely dependent on the precision of the usencrypt.exp() function. See the warnings for usencrypt.exp().

Examples

Like all layers, the hyperbolic tangent layer can be added to the top of a neural network architecture stack as follows:

>>> import usencrypt as ue
>>> net = ue.ai.nn.NeuralNetwork()
>>> net.add(ue.ai.nn.layers.FCLayer(input_size=4, output_size=3))
>>> net.add(ue.ai.nn.layers.TanhLayer())