tfl.kronecker_factored_lattice_layer.KroneckerFactoredLatticeConstraints

Constraints for tfl.layers.KroneckerFactoredLattice layer.

Applies all constraints to the Kronecker-Factored Lattice weights. See tfl.layers.KroneckerFactoredLattice for more details.

units Same meaning as corresponding parameter of KroneckerFactoredLattice.
scale Scale variable of shape: (units, num_terms).
monotonicities Same meaning as corresponding parameter of KroneckerFactoredLattice.
output_min Same meaning as corresponding parameter of KroneckerFactoredLattice.
output_max Same meaning as corresponding parameter of KroneckerFactoredLattice.

Methods

from_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

View source

Standard Keras config for serialization.

__call__

View source

Applies constraints to w.

Args
w Kronecker-Factored Lattice weights tensor of shape: (1, lattice_sizes, units * dims, num_terms).

Returns
Constrained and projected w.