View source on GitHub
|
Constraints for tfl.layers.KroneckerFactoredLattice layer.
tfl.kronecker_factored_lattice_layer.KroneckerFactoredLatticeConstraints(
units, scale, monotonicities=None, output_min=None, output_max=None
)
Applies all constraints to the Kronecker-Factored Lattice weights. See
tfl.layers.KroneckerFactoredLattice for more details.
Methods
from_config
@classmethodfrom_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.
| Args | |
|---|---|
w
|
Kronecker-Factored Lattice weights tensor of shape: (1, lattice_sizes,
units * dims, num_terms).
|
| Returns | |
|---|---|
| Constrained and projected w. |
View source on GitHub