View source on GitHub |
Monotonicity and bounds constraints for categorical calibration layer.
tfl.categorical_calibration_layer.CategoricalCalibrationConstraints(
output_min=None, output_max=None, monotonicities=None
)
Updates the weights of CategoricalCalibration layer to satify bound and monotonicity constraints. The update is an approximate L2 projection into the constrained parameter space.
Args | |
---|---|
output_min
|
Minimum possible output of categorical function. |
output_max
|
Maximum possible output of categorical function. |
monotonicities
|
Monotonicities of CategoricalCalibration layer. |
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.