# tf_agents.bandits.multi_objective.multi_objective_scalarizer.Scalarizer

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/bandits/multi_objective/multi_objective_scalarizer.py#L102-L207) |

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.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `num_of_objectives` | A non-negative integer indicating the number of objectives to scalarize. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if `not isinstance(num_of_objectives, int)`. |
| `ValueError` | if `num_of_objectives < 2`. |

<br />

## Methods

### `set_parameters`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/bandits/multi_objective/multi_objective_scalarizer.py#L201-L203)

    @abc.abstractmethod
    set_parameters(
        **kwargs
    )

Setter method for scalarization parameters.

### `__call__`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/bandits/multi_objective/multi_objective_scalarizer.py#L135-L161)

    __call__(
        multi_objectives: tf.Tensor
    ) -> tf.Tensor

Returns a single reward by scalarizing multiple objectives.

<br />

<br />

<br />

| Args ||
|---|---|
| `multi_objectives` | A `Tensor` of shape \[batch_size, number_of_objectives\], where each column represents an objective. |

<br />

Returns: A `Tensor` of shape \[batch_size\] representing scalarized rewards.

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | if `multi_objectives.shape.rank != 2`. |
| `ValueError` | if `multi_objectives.shape.dims[1] != self._num_of_objectives`. |

<br />