# tfl.kronecker_factored_lattice_layer.ScaleConstraints

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

Constraints for [`tfl.layers.KroneckerFactoredLattice`](https://www.tensorflow.org/lattice/api_docs/python/tfl/layers/KroneckerFactoredLattice) scale.

    tfl.kronecker_factored_lattice_layer.ScaleConstraints(
        output_min=None, output_max=None
    )

Constraints the scale variable to be between
`[output_min-output_max, output_max-output_min]` such that the final output
of the layer is within the desired `[output_min, output_max]` range, assuming
bias is properly fixed to be `output_min`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `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#L703-L708)

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

    __call__(
        scale
    )

Applies constraints to `scale`.

<br />

<br />

<br />

| Args ||
|---|---|
| `scale` | Kronecker-Factored Lattice scale tensor of shape: `(units, num_terms)`. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| Constrained and clipped scale. ||

<br />