Initializes a tfl.layers.KroneckerFactoredLattice
as random monotonic.
tfl.kronecker_factored_lattice_layer.KFLRandomMonotonicInitializer(
monotonicities, init_min=0.5, init_max=1.5, seed=None
)
Args |
monotonicities
|
Monotonic dimensions for initialization. Does not need to
match monotonicities of tfl.layers.KroneckerFactoredLattice .
|
init_min
|
The lower bound on the range of initialized weights.
|
init_max
|
The upper bound on the range of initialized weights.
|
seed
|
A Python integer. Used to create a random seed for the distribution.
|
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 serializaion.
__call__
View source
__call__(
shape, scale, dtype=None, **kwargs
)
Returns weights of tfl.layers.KroneckerFactoredLattice
layer.
Args |
shape
|
Must be: (1, lattice_sizes, units * dims, num_terms) .
|
scale
|
Scale variable of shape: (units, num_terms) .
|
dtype
|
Standard Keras initializer param.
|
**kwargs
|
Other args passed to keras.initializers.Initializer call
method.
|