# tfl.kronecker_factored_lattice_layer.KroneckerFactoredLatticeConstraints

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/kronecker_factored_lattice_layer.py#L592-L659) |

Constraints for [`tfl.layers.KroneckerFactoredLattice`](https://www.tensorflow.org/lattice/api_docs/python/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`](https://www.tensorflow.org/lattice/api_docs/python/tfl/layers/KroneckerFactoredLattice) for more details.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `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`. |

<br />

## 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)

<br />

<br />

<br />

| Args ||
|---|---|
| `config` | A Python dictionary, the output of `get_config`. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A [`tf.keras.constraints.Constraint`](https://www.tensorflow.org/api_docs/python/tf/keras/constraints/Constraint) instance. ||

<br />

### `get_config`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/kronecker_factored_lattice_layer.py#L651-L659)

    get_config()

Standard Keras config for serialization.

### `__call__`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/kronecker_factored_lattice_layer.py#L631-L649)

    __call__(
        w
    )

Applies constraints to `w`.

<br />

<br />

<br />

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

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| Constrained and projected w. ||

<br />