tf.keras.layers.PReLU
Stay organized with collections
Save and categorize content based on your preferences.
Parametric Rectified Linear Unit.
Inherits From: Layer
tf.keras.layers.PReLU(
alpha_initializer='zeros', alpha_regularizer=None, alpha_constraint=None,
shared_axes=None, **kwargs
)
It follows:
f(x) = alpha * x for x < 0
,
f(x) = x for x >= 0
,
where alpha
is a learned array with the same shape as x.
Arbitrary. Use the keyword argument input_shape
(tuple of integers, does not include the samples axis)
when using this layer as the first layer in a model.
Output shape:
Same shape as the input.
Arguments |
alpha_initializer
|
Initializer function for the weights.
|
alpha_regularizer
|
Regularizer for the weights.
|
alpha_constraint
|
Constraint for the weights.
|
shared_axes
|
The axes along which to share learnable
parameters for the activation function.
For example, if the incoming feature maps
are from a 2D convolution
with output shape (batch, height, width, channels) ,
and you wish to share parameters across space
so that each filter only has one set of parameters,
set shared_axes=[1, 2] .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.layers.PReLU\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/keras/layers/PReLU) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/layers/advanced_activations.py#L72-L158) |\n\nParametric Rectified Linear Unit.\n\nInherits From: [`Layer`](../../../tf/keras/layers/Layer)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.layers.PReLU`](/api_docs/python/tf/keras/layers/PReLU), \\`tf.compat.v2.keras.layers.PReLU\\`\n\n\u003cbr /\u003e\n\n tf.keras.layers.PReLU(\n alpha_initializer='zeros', alpha_regularizer=None, alpha_constraint=None,\n shared_axes=None, **kwargs\n )\n\n#### It follows:\n\n`f(x) = alpha * x for x \u003c 0`,\n`f(x) = x for x \u003e= 0`,\nwhere `alpha` is a learned array with the same shape as x.\n\n#### Input shape:\n\nArbitrary. Use the keyword argument `input_shape`\n(tuple of integers, does not include the samples axis)\nwhen using this layer as the first layer in a model.\n\n#### Output shape:\n\nSame shape as the input.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `alpha_initializer` | Initializer function for the weights. |\n| `alpha_regularizer` | Regularizer for the weights. |\n| `alpha_constraint` | Constraint for the weights. |\n| `shared_axes` | The axes along which to share learnable parameters for the activation function. For example, if the incoming feature maps are from a 2D convolution with output shape `(batch, height, width, channels)`, and you wish to share parameters across space so that each filter only has one set of parameters, set `shared_axes=[1, 2]`. |\n\n\u003cbr /\u003e"]]