class_docstr: Implement the hypervolume scalarization.
  
  Given a vector of (at least two) objectives M, a unit-length vector V with
  non-negative coordinates, a slope vector A, and an offset vector B, all having
  the same dimension, the hypervolume scalarization of M is defined as:
  
  ```min_{i: V_i > 0} max(A_i * M_i + B_i, 0) / V_i.```
  
  See https://arxiv.org/abs/2006.04655 for more details.
  Note that it is recommended for the user to set A_i and B_i in such a way to
  ensure non-negativity of the transformed objectives.
class_docstr_tok: ["Implement","the","hypervolume","scalarization",".","Given","a","vector","of","(","at","least","two",")","objectives","M",",","a","unit-length","vector","V","with","non-negative","coordinates",",","a","slope","vector","A",",","and","an","offset","vector","B",",","all","having","the","same","dimension",",","the","hypervolume","scalarization","of","M","is","defined","as",":","``","`","min_","{","i",":","V_i",">","0","}","max","(","A_i","*","M_i","+","B_i",",","0",")","\/","V_i.","``","`","See","https",":","\/\/arxiv.org\/abs\/2006.04655","for","more","details",".","Note","that","it","is","recommended","for","the","user","to","set","A_i","and","B_i","in","such","a","way","to","ensure","non-negativity","of","the","transformed","objectives","."]
docstr: Set the scalarization parameters for the HyperVolumeScalarizer.
  
  Args:
    direction: A `tf.Tensor` representing a directional vector, which will be
      normalized to have unit length. Coordinates of the normalized direction
      whose absolute values are less than `HyperVolumeScalarizer.ALMOST_ZERO`
      will be considered zeros. It must be rank-2 and shaped as [batch_size,
      self._num_of_objectives], where `batch_size` should match the batch size
      of the multi objectives passed to the scalarizer call.
    transform_params: A dictionary mapping `self.SLOPE_KEY` and/or
      `self.OFFSET_KEY` to `tf.Tensor`, representing the slope and the offset
      parameters for transforming an objective to be non-negative. These
      tensors must satisfy the same rank and shape requirements as
      `direction`.
  
  Raises:
    ValueError: if any input scalarization parameter tensor is not rank-2, or
    has a last dimension size that does not match `self._num_of_objectives`.
docstr_tok: ["Set","the","scalarization","parameters","for","the","HyperVolumeScalarizer",".","Args",":","direction",":","A","`","tf.Tensor","`","representing","a","directional","vector",",","which","will","be","normalized","to","have","unit","length",".","Coordinates","of","the","normalized","direction","whose","absolute","values","are","less","than","`","HyperVolumeScalarizer.ALMOST_ZERO","`","will","be","considered","zeros",".","It","must","be","rank-2","and","shaped","as","[","batch_size",",","self._num_of_objectives","]",",","where","`","batch_size","`","should","match","the","batch","size","of","the","multi","objectives","passed","to","the","scalarizer","call",".","transform_params",":","A","dictionary","mapping","`","self.SLOPE_KEY","`","and\/or","`","self.OFFSET_KEY","`","to","`","tf.Tensor","`",",","representing","the","slope","and","the","offset","parameters","for","transforming","an","objective","to","be","non-negative",".","These","tensors","must","satisfy","the","same","rank","and","shape","requirements","as","`","direction","`",".","Raises",":","ValueError",":","if","any","input","scalarization","parameter","tensor","is","not","rank-2",",","or","has","a","last","dimension","size","that","does","not","match","`","self._num_of_objectives","`","."]
code: def set_parameters(
      self,
      direction: tf.Tensor,  # pytype: disable=signature-mismatch  # overriding-parameter-count-checks
      transform_params: Dict[str, tf.Tensor],
  ):
      """Set the scalarization parameters for the HyperVolumeScalarizer.
  
      Args:
        direction: A `tf.Tensor` representing a directional vector, which will be
          normalized to have unit length. Coordinates of the normalized direction
          whose absolute values are less than `HyperVolumeScalarizer.ALMOST_ZERO`
          will be considered zeros. It must be rank-2 and shaped as [batch_size,
          self._num_of_objectives], where `batch_size` should match the batch size
          of the multi objectives passed to the scalarizer call.
        transform_params: A dictionary mapping `self.SLOPE_KEY` and/or
          `self.OFFSET_KEY` to `tf.Tensor`, representing the slope and the offset
          parameters for transforming an objective to be non-negative. These
          tensors must satisfy the same rank and shape requirements as
          `direction`.
  
      Raises:
        ValueError: if any input scalarization parameter tensor is not rank-2, or
        has a last dimension size that does not match `self._num_of_objectives`.
      """
      self._validate_scalarization_parameters(
          {self.DIRECTION_KEY: direction}
      )
      self._direction = direction
      for key, param in transform_params.items():
          if key == self.SLOPE_KEY:
              self._validate_scalarization_parameters({key: param})
              self._slopes = param
          elif key == self.OFFSET_KEY:
              self._validate_scalarization_parameters({key: param})
              self._offsets = param
          else:
              raise ValueError(
                  "All transform_params keys should be {} or {}, but one key is not:"
                  " {}".format(self.SLOPE_KEY, self.OFFSET_KEY, key)
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import copy
  from typing import Callable, Dict, NamedTuple, Optional, Sequence, Union
  import numpy
  import six
  import tensorflow.compat.v2
label_desc: Use image node_id 5 for calling the HyperVolumeScalarizer obj's underlying member method code with example usage: obj.set_parameters(direction, transform_params) without return types