tf_agents.bandits.multi_objective.multi_objective_scalarizer.Scalarizer
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Abstract base class for different Scalarizers.
tf_agents.bandits.multi_objective.multi_objective_scalarizer.Scalarizer(
num_of_objectives: int
)
The Scalarizer class is a callable that transforms multiple objectives into
a single scalar reward.
Args |
num_of_objectives
|
A non-negative integer indicating the number of
objectives to scalarize.
|
Raises |
ValueError
|
if not isinstance(num_of_objectives, int) .
|
ValueError
|
if num_of_objectives < 2 .
|
Methods
set_parameters
View source
@abc.abstractmethod
set_parameters(
**kwargs
)
Setter method for scalarization parameters.
__call__
View source
__call__(
multi_objectives: tf.Tensor
) -> tf.Tensor
Returns a single reward by scalarizing multiple objectives.
Args |
multi_objectives
|
A Tensor of shape [batch_size, number_of_objectives],
where each column represents an objective.
|
Returns: A Tensor
of shape [batch_size] representing scalarized rewards.
Raises |
ValueError
|
if multi_objectives.shape.rank != 2 .
|
ValueError
|
if
multi_objectives.shape.dims[1] != self._num_of_objectives .
|
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-04-26 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-04-26 UTC."],[],[]]