View source on GitHub |
Naively clips all elements of tensor to be within bounds.
tfl.pwl_calibration_layer.NaiveBoundsConstraints(
lower_bound=None, upper_bound=None
)
This constraint is used only for the weight tensor for missing output value.
Args | |
---|---|
lower_bound
|
Lower bound to clip variable values to. |
upper_bound
|
Upper bound to clip variable values to. |
Methods
from_config
@classmethod
from_config( config )
Instantiates a weight constraint from a configuration dictionary.
Example:
constraint = UnitNorm()
config = constraint.get_config()
constraint = UnitNorm.from_config(config)
Args | |
---|---|
config
|
A Python dictionary, the output of get_config .
|
Returns | |
---|---|
A tf.keras.constraints.Constraint instance.
|
get_config
get_config()
Standard Keras config for serialization.
__call__
__call__(
w
)
Applies constraints to w.