# tfl.kronecker_factored_lattice_lib.kfl_random_monotonic_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/kronecker_factored_lattice_lib.py#L165-L221) |

Returns a uniformly random sampled monotonic weight tensor.

    tfl.kronecker_factored_lattice_lib.kfl_random_monotonic_initializer(
        shape,
        scale,
        monotonicities,
        init_min=0.5,
        init_max=1.5,
        dtype=tf.float32,
        seed=None
    )

- The uniform random monotonic function will initilaize the lattice parameters uniformly at random and make it such that the parameters are monotonically increasing for each input.
- The random parameters will be sampled from `[init_min, init_max]`

<br />

<br />

<br />

| ## Args ||
|---|---|
| `shape` | Shape of weights to initialize. Must be: `(1, lattice_sizes, units * dims, num_terms)`. |
| `scale` | Scale variable of shape: `(units, num_terms)`. |
| `monotonicities` | None or list or tuple of length dims of elements of {0,1} which represents monotonicity constraints per dimension. 1 stands for increasing (non-decreasing in fact), 0 for no monotonicity constraints. |
| `init_min` | The lower bound on the range of initialized weights. |
| `init_max` | The upper bound on the range of initialized weights. |
| `dtype` | dtype |
| `seed` | A Python integer. Used to create a random seed for the distribution. |

<br />

<br />

<br />

<br />

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

<br />