activation_hardshrink | R Documentation |
Hard shrink function.
activation_hardshrink(x, lower = -0.5, upper = 0.5)
x |
A 'Tensor'. Must be one of the following types: 'float16', 'float32', 'float64'. |
lower |
'float', lower bound for setting values to zeros. |
upper |
'float', upper bound for setting values to zeros. Returns: A 'Tensor'. Has the same type as 'x'. |
Computes hard shrink function: 'x if x < lower or x > upper else 0'.
A 'Tensor'. Has the same type as 'x'.
'x if x < lower or x > upper else 0'.
## Not run: library(keras) library(tfaddons) model = keras_model_sequential() %>% layer_conv_2d(filters = 10, kernel_size = c(3,3),input_shape = c(28,28,1), activation = activation_hardshrink) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.