flax.linen.PReLU¶
- class flax.linen.PReLU(param_dtype=<class 'jax.numpy.float32'>, negative_slope_init=0.01, parent=<flax.linen.module._Sentinel object>, name=None)[source]¶
Parametric Rectified Linear Unit (PReLU) activation function.
- Parameters
param_dtype (Any) –
negative_slope_init (float) –
parent (Optional[Union[Type[flax.linen.module.Module], Type[flax.core.scope.Scope], Type[flax.linen.module._Sentinel]]]) –
name (str) –
- Return type
None
- param_dtype¶
the dtype passed to parameter initializers (default: float32).
- Type
Any
- negative_slope_init¶
the value to initialize the negative slope (default 0.01).
- Type
float
- __init__(param_dtype=<class 'jax.numpy.float32'>, negative_slope_init=0.01, parent=<flax.linen.module._Sentinel object>, name=None)¶
- Parameters
param_dtype (Any) –
negative_slope_init (float) –
parent (Optional[Union[Type[flax.linen.module.Module], Type[flax.core.scope.Scope], Type[flax.linen.module._Sentinel]]]) –
name (Optional[str]) –
- Return type
None
Methods
__init__
([param_dtype, negative_slope_init, ...])apply
(variables, *args[, rngs, method, ...])Applies a module method to variables and returns output and modified variables.
bind
(variables, *args[, rngs, mutable])Creates an interactive Module instance by binding variables and RNGs.
clone
(*[, parent])Creates a clone of this Module, with optionally updated arguments.
get_variable
(col, name[, default])Retrieves the value of a Variable.
has_rng
(name)Returns true if a PRNGSequence with name name exists.
has_variable
(col, name)Checks if a variable of given collection and name exists in this Module.
init
(rngs, *args[, method, mutable])Initializes a module method with variables and returns modified variables.
init_with_output
(rngs, *args[, method, mutable])Initializes a module method with variables and returns output and modified variables.
is_mutable_collection
(col)Returns true if the collection col is mutable.
make_rng
(name)Returns a new RNG key from a given RNG sequence for this Module.
param
(name, init_fn, *init_args)Declares and returns a parameter in this Module.
put_variable
(col, name, value)Sets the value of a Variable.
setup
()Initializes a Module lazily (similar to a lazy
__init__
).sow
(col, name, value[, reduce_fn, init_fn])Stores a value in a collection.
variable
(col, name[, init_fn])Declares and returns a variable in this Module.
Attributes
name
parent
scope
variables
Returns the variables in this module.