tfl.pwl_calibration_layer.UniformOutputInitializer
Stay organized with collections
Save and categorize content based on your preferences.
Initializes PWL calibration layer to represent linear function.
tfl.pwl_calibration_layer.UniformOutputInitializer(
output_min, output_max, monotonicity, keypoints=None
)
PWL calibration layer weights are one-d tensor. First element of tensor
represents bias. All remaining represent delta in y-value compare to previous
point. Aka heights of segments.
Args |
output_min
|
Minimum value of PWL calibration output after initialization.
|
output_max
|
Maximum value of PWL calibration output after initialization.
|
monotonicity
|
- if 'none' or 'increasing', the returned function will go from
(input_min, output_min) to (input_max, output_max) .
- if 'decreasing', the returned function will go from
(input_min, output_max) to (input_max, output_min) .
|
keypoints
|
- if not provided (None or []), all pieces of returned function
will have equal heights (i.e.
y[i+1] - y[i] is constant).
if provided, all pieces of returned function will have equal slopes
(i.e. (y[i+1] - y[i]) / (x[i+1] - x[i]) is constant).
|
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 PWL calibration layer.
Args |
shape
|
Must be a collection of the form (k, units) where k >= 2 .
|
dtype
|
Standard Keras initializer param.
|
partition_info
|
Standard Keras initializer param.
|
Returns |
Weights of PWL calibration layer.
|
Raises |
ValueError
|
If requested shape is invalid for PWL calibration layer
weights.
|
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-02 UTC."],[],[]]