class_docstr: A simple environment model.
class_docstr_tok: ["A","simple","environment","model","."]
code: def __init__(
      self,
      environment_spec: specs.EnvironmentSpec,
      replay_capacity: int,
      batch_size: int,
      hidden_sizes: Tuple[int, ...],
      learning_rate: float = 1e-3,
      terminal_tol: float = 1e-3,
  ):
      self._obs_spec = environment_spec.observations
      self._action_spec = environment_spec.actions
      # Hyperparameters.
      self._batch_size = batch_size
      self._terminal_tol = terminal_tol
  
      # Modelling
      self._replay = replay.Replay(replay_capacity)
      self._transition_model = MLPTransitionModel(
          environment_spec, hidden_sizes
      )
      self._optimizer = snt.optimizers.Adam(learning_rate)
      self._forward = tf.function(self._transition_model)
      tf2_utils.create_variables(
          self._transition_model, [self._obs_spec, self._action_spec]
      )
      self._variables = self._transition_model.trainable_variables
  
      # Model state.
      self._needs_reset = True
  
imports: from typing import Optional, Tuple
  from acme import specs
  from acme.agents.tf.mcts import types
  from acme.agents.tf.mcts.models import base
  from acme.tf import utils
  from bsuite.baselines.utils import replay
  import dm_env
  import numpy
  from scipy import special
  import sonnet
  import tensorflow
label_desc: Use image node_id 1 to create a new MLPModel object from inherited base classes: base with example: obj = MLPModel(environment_spec, replay_capacity, batch_size, hidden_sizes, learning_rate, terminal_tol)