Initializes a tfl.layers.Lattice
as uniform random monotonic function.
tfl.lattice_layer.RandomMonotonicInitializer(
lattice_sizes, output_min, output_max, unimodalities=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
[output_min, output_max]
Args |
lattice_sizes
|
Lattice sizes of tfl.layers.Lattice to initialize.
|
output_min
|
Minimum layer output after initialization.
|
output_max
|
Maximum layer output after initialization.
|
unimodalities
|
None or unimodal dimensions after initialization. Does not
need to match unimodalities of tfl.layers.Lattice .
|
Raises |
ValueError
|
If there are invalid hyperparameters.
|
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)
Args |
config
|
A Python dictionary, the output of get_config() .
|
Returns |
An Initializer instance.
|
get_config
View source
get_config()
Standard Keras config for serialization.
__call__
View source
__call__(
shape, dtype=None, partition_info=None
)
Returns weights of tfl.layers.Lattice
layer.
Args |
shape
|
Must be: (prod(lattice_sizes), units) .
|
dtype
|
Standard Keras initializer param.
|
partition_info
|
Standard Keras initializer param. Not used.
|