class_docstr: MPO agent configuration.
code: def __post_init__(self):
      if (self.target_update_period and self.target_update_rate) or (
          self.target_update_period is None
          and self.target_update_rate is None
      ):
          raise ValueError(
              "Exactly one of target_update_{period|rate} must be set."
              f" Received target_update_period={self.target_update_period} and"
              f" target_update_rate={self.target_update_rate}."
          )
  
      online_batch_size = int(
          self.batch_size * (1.0 - self.replay_fraction)
      )
      if not self.online_queue_capacity:
          # Note: larger capacities mean the online data is more "stale". This seems
          # a reasonable default for now.
          self.online_queue_capacity = int(4 * online_batch_size)
      self.online_queue_capacity = max(
          self.online_queue_capacity, online_batch_size + 1
      )
  
      if (
          self.samples_per_insert is not None
          and self.replay_fraction < 1
      ):
          raise ValueError(
              "Cannot set samples_per_insert when using a mixed replay (i.e when "
              "0 < replay_fraction < 1). Received:\n"
              f"\tsamples_per_insert={self.samples_per_insert} and\n"
              f"\treplay_fraction={self.replay_fraction}."
          )
  
      if (
          0 < self.replay_fraction < 1
          and self.min_replay_size > self.online_queue_capacity
      ):
          raise ValueError(
              "When mixing replay with an online queue, min replay "
              "size must not be larger than the queue capacity."
          )
  
      if (
          isinstance(self.experience_type, mpo_types.FromTransitions)
          and self.num_stacked_observations > 1
      ):
          raise ValueError(
              "Agent-side frame-stacking is currently only supported when learning "
              "from sequences. Consider environment-side frame-stacking instead."
          )
  
      if self.critic_type == mpo_types.CriticType.CATEGORICAL:
          if self.model_rollout_length > 0:
              raise ValueError(
                  "Model rollouts are not supported for the Categorical critic"
              )
          if not isinstance(
              self.experience_type, mpo_types.FromTransitions
          ):
              raise ValueError(
                  "Categorical critic only supports experience_type=FromTransitions"
              )
          if self.use_retrace:
              raise ValueError(
                  "retrace is not supported for the Categorical critic"
              )
  
      if self.model_rollout_length > 0 and not self.discrete_policy:
          if (
              self.rollout_policy_loss_scale
              or self.rollout_bc_policy_loss_scale
          ):
              raise ValueError(
                  "Policy rollout losses are only supported in the "
                  "discrete policy case."
              )
  
file_path: acme/acme/agents/jax/mpo/config.py
imports: import dataclasses
  from typing import Callable, Optional, Union
  from acme import types
  from acme.agents.jax.mpo import types
  import numpy
  import rlax
label_desc: Use image node_id 1 for calling the MPOConfig obj's underlying member method code with example usage: obj.__post_init__() without return types