# tfl.lattice_layer.create_kernel_initializer

<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/lattice_layer.py#L547-L650) |

Returns a kernel Keras initializer object from its id.

    tfl.lattice_layer.create_kernel_initializer(
        kernel_initializer_id,
        lattice_sizes,
        monotonicities,
        output_min,
        output_max,
        unimodalities,
        joint_unimodalities,
        init_min=None,
        init_max=None
    )

This function is used to convert the 'kernel_initializer' parameter in the
constructor of tfl.Lattice into the corresponding initializer object.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `kernel_initializer_id` | See the documentation of the 'kernel_initializer' parameter in the constructor of tfl.Lattice. |
| `lattice_sizes` | See the documentation of the same parameter in the constructor of tfl.Lattice. |
| `monotonicities` | See the documentation of the same parameter in the constructor of tfl.Lattice. |
| `output_min` | See the documentation of the same parameter in the constructor of tfl.Lattice. |
| `output_max` | See the documentation of the same parameter in the constructor of tfl.Lattice. |
| `unimodalities` | See the documentation of the same parameter in the constructor of tfl.Lattice. |
| `joint_unimodalities` | See the documentation of the same parameter in the constructor of tfl.Lattice. |
| `init_min` | None or lower bound of kernel initialization. If set, init_max must also be set. |
| `init_max` | None or upper bound of kernel initialization. If set, init_min must also be set. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The Keras initializer object for the tfl.Lattice kernel variable. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If only one of init_{min/max} is set. |

<br />