# tfl.categorical_calibration_lib.project

<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/categorical_calibration_lib.py#L24-L61) |

Monotonicity/bounds constraints implementation for categorical calibration.

    tfl.categorical_calibration_lib.project(
        weights, output_min, output_max, monotonicities
    )

Returns the approximate L2 projection of the CategoricalCalibration weights
into the constrained parameter space.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `weights` | Tensor which represents weights of Categorical calibration layer. |
| `output_min` | Lower bound constraint on weights. |
| `output_max` | Upper bound constraint on weights. |
| `monotonicities` | List of pair of indices `(i, j)`, indicating constraint `weight[i] <= weight[j]`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Projected `weights` tensor. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If monotonicities are not of the correct format or are circular. |

<br />