tfl.kronecker_factored_lattice_layer.BiasInitializer
Stay organized with collections
Save and categorize content based on your preferences.
Initializes bias depending on output_min and output_max.
tfl.kronecker_factored_lattice_layer.BiasInitializer(
output_min, output_max
)
If both output_min and output_max are set, bias is initialized to their
average. If only output_min is set, bias is initialized to output_min. If only
output_max is set, bias is initialized to output_max. Otherwise bias is
initialized to zeros.
Args |
output_min
|
None or minimum layer output.
|
output_max
|
None or maximum layer output.
|
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, dtype=None, **kwargs
)
Returns weights of tfl.layers.KroneckerFactoredLattice
bias.
Args |
shape
|
Must be: (units, num_terms) .
|
dtype
|
Standard Keras initializer param.
|
**kwargs
|
Other args passed to keras.initializers.Initializer call
method.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-02 UTC.
[null,null,["Last updated 2024-08-02 UTC."],[],[],null,["# tfl.kronecker_factored_lattice_layer.BiasInitializer\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/kronecker_factored_lattice_layer.py#L547-L589) |\n\nInitializes bias depending on output_min and output_max. \n\n tfl.kronecker_factored_lattice_layer.BiasInitializer(\n output_min, output_max\n )\n\nIf both output_min and output_max are set, bias is initialized to their\naverage. If only output_min is set, bias is initialized to output_min. If only\noutput_max is set, bias is initialized to output_max. Otherwise bias is\ninitialized to zeros.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------|-------------------------------|\n| `output_min` | None or minimum layer output. |\n| `output_max` | None or maximum layer output. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `from_config`\n\n @classmethod\n from_config(\n config\n )\n\nInstantiates an initializer from a configuration dictionary.\n\n#### Example:\n\n initializer = RandomUniform(-1, 1)\n config = initializer.get_config()\n initializer = RandomUniform.from_config(config)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------|----------------------------------------------------|\n| `config` | A Python dictionary, the output of `get_config()`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| An `Initializer` instance. ||\n\n\u003cbr /\u003e\n\n### `get_config`\n\n[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/kronecker_factored_lattice_layer.py#L583-L589) \n\n get_config()\n\nStandard Keras config for serializaion.\n\n### `__call__`\n\n[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/kronecker_factored_lattice_layer.py#L568-L581) \n\n __call__(\n shape, dtype=None, **kwargs\n )\n\nReturns weights of [`tfl.layers.KroneckerFactoredLattice`](../../tfl/layers/KroneckerFactoredLattice) bias.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| `shape` | Must be: `(units, num_terms)`. |\n| `dtype` | Standard Keras initializer param. |\n| `**kwargs` | Other args passed to [`keras.initializers.Initializer`](https://www.tensorflow.org/api_docs/python/tf/keras/Initializer) **call** method. |\n\n\u003cbr /\u003e"]]