activation_relu | R Documentation |
With default values, this returns the standard ReLU activation:
max(x, 0)
, the element-wise maximum of 0 and the input tensor.
Modifying default parameters allows you to use non-zero thresholds, change the max value of the activation, and to use a non-zero multiple of the input for values below the threshold.
activation_relu(x, negative_slope = 0, max_value = NULL, threshold = 0)
x |
Input tensor. |
negative_slope |
A |
max_value |
A |
threshold |
A |
A tensor with the same shape and dtype as input x
.
x <- c(-10, -5, 0, 5, 10) activation_relu(x)
## tf.Tensor([ 0. 0. 0. 5. 10.], shape=(5), dtype=float32)
activation_relu(x, negative_slope = 0.5)
## tf.Tensor([-5. -2.5 0. 5. 10. ], shape=(5), dtype=float32)
activation_relu(x, max_value = 5)
## tf.Tensor([0. 0. 0. 5. 5.], shape=(5), dtype=float32)
activation_relu(x, threshold = 5)
## tf.Tensor([-0. -0. 0. 0. 10.], shape=(5), dtype=float32)
Other activations:
activation_celu()
activation_elu()
activation_exponential()
activation_gelu()
activation_glu()
activation_hard_shrink()
activation_hard_sigmoid()
activation_hard_tanh()
activation_leaky_relu()
activation_linear()
activation_log_sigmoid()
activation_log_softmax()
activation_mish()
activation_relu6()
activation_selu()
activation_sigmoid()
activation_silu()
activation_soft_shrink()
activation_softmax()
activation_softplus()
activation_softsign()
activation_sparse_plus()
activation_sparsemax()
activation_squareplus()
activation_tanh()
activation_tanh_shrink()
activation_threshold()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.