# tfl.pwl_calibration_layer.UniformOutputInitializer

<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/pwl_calibration_layer.py#L614-L685) |

Initializes PWL calibration layer to represent linear function.

    tfl.pwl_calibration_layer.UniformOutputInitializer(
        output_min, output_max, monotonicity, keypoints=None
    )

PWL calibration layer weights are one-d tensor. First element of tensor
represents bias. All remaining represent delta in y-value compare to previous
point. Aka heights of segments.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `output_min` | Minimum value of PWL calibration output after initialization. |
| `output_max` | Maximum value of PWL calibration output after initialization. |
| `monotonicity` | <br /> - if 'none' or 'increasing', the returned function will go from `(input_min, output_min)` to `(input_max, output_max)`. - if 'decreasing', the returned function will go from `(input_min, output_max)` to `(input_max, output_min)`. |
| `keypoints` | - if not provided (None or \[\]), all pieces of returned function will have equal heights (i.e. `y[i+1] - y[i]` is constant). - if provided, all pieces of returned function will have equal slopes (i.e. `(y[i+1] - y[i]) / (x[i+1] - x[i])` is constant). |

## Methods

### `from_config`

    @classmethod
    from_config(
        config
    )

Instantiates an initializer from a configuration dictionary.

#### Example:

    initializer = RandomUniform(-1, 1)
    config = initializer.get_config()
    initializer = RandomUniform.from_config(config)

<br />

<br />

<br />

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

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| An `Initializer` instance. ||

<br />

### `get_config`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/pwl_calibration_layer.py#L678-L685)

    get_config()

Standard Keras config for serialization.

### `__call__`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/pwl_calibration_layer.py#L655-L676)

    __call__(
        shape, dtype=None, partition_info=None
    )

Returns weights of PWL calibration layer.

<br />

<br />

<br />

| Args ||
|---|---|
| `shape` | Must be a collection of the form `(k, units)` where `k >= 2`. |
| `dtype` | Standard Keras initializer param. |
| `partition_info` | Standard Keras initializer param. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| Weights of PWL calibration layer. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If requested shape is invalid for PWL calibration layer weights. |

<br />