tfl.linear_lib.project
Stay organized with collections
Save and categorize content based on your preferences.
Applies constraints to weights.
tfl.linear_lib.project(
weights,
monotonicities,
monotonic_dominances=None,
range_dominances=None,
input_min=None,
input_max=None,
normalization_order=None
)
Args |
weights
|
Tensor which represents weights of TFL linear layer. Must have
shape [len(monotonicities), units].
|
monotonicities
|
List or tuple of same length as number of elements in
'weights' of {-1, 0, 1} which represent monotonicity constraints per
dimension. -1 stands for decreasing, 0 for no constraints, 1 for
increasing.
|
monotonic_dominances
|
List of two-element tuples. First element is the index
of the dominant feature. Second element is the index of the weak feature.
|
range_dominances
|
List of two-element tuples. First element is the index of
the dominant feature. Second element is the index of the weak feature.
|
input_min
|
List or tuple of length same length as number of elements in
'weights' of either None or float to compute input range for range
dominance projection.
|
input_max
|
List or tuple of length same length as number of elements in
'weights' of either None or float to compute input range for range
dominance projection.
|
normalization_order
|
If specified weights will be adjusted to have norm 1.
Norm will be computed by: tf.norm(tensor, ord=normalization_order) .
|
Raises |
ValueError
|
If shape of weights is not (len(monotonicities), units) .
|
Returns |
'weights' with monotonicity constraints and normalization applied to it.
|
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.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"lastModified": "Last updated 2024-08-02 UTC.",
"confidential": False
}