code: def test_curiosity_on_partially_observable_domain(self):
      config = (
          ppo.PPOConfig()
          .environment(
              "mini-grid",
              env_config={
                  # Also works with:
                  # - MiniGrid-MultiRoom-N4-S5-v0
                  # - MiniGrid-MultiRoom-N2-S4-v0
                  "name": "MiniGrid-Empty-8x8-v0",
                  "framestack": 1,  # seems to work even w/o framestacking
              },
          )
          .rollouts(num_envs_per_worker=4, num_rollout_workers=0)
          .training(
              model={
                  "fcnet_hiddens": [256, 256],
                  "fcnet_activation": "relu",
              },
              num_sgd_iter=8,
          )
          .exploration(
              exploration_config={
                  "type": "Curiosity",
                  # For the feature NN, use a non-LSTM fcnet (same as the one
                  # in the policy model).
                  "eta": 0.1,
                  "lr": 0.0003,  # 0.0003 or 0.0005 seem to work fine as well.
                  "feature_dim": 64,
                  # No actual feature net: map directly from observations to feature
                  # vector (linearly).
                  "feature_net_config": {
                      "fcnet_hiddens": [],
                      "fcnet_activation": "relu",
                  },
                  "sub_exploration": {
                      "type": "StochasticSampling",
                  },
              }
          )
      )
  
      min_reward = 0.001
      stop = {
          "training_iteration": 25,
          "episode_reward_mean": min_reward,
      }
      for _ in framework_iterator(config, frameworks="torch"):
          # To replay:
          # algo = ppo.PPO(config=config)
          # algo.restore("[checkpoint file]")
          # env = env_maker(config["env_config"])
          # obs, info = env.reset()
          # for _ in range(10000):
          #     obs, reward, done, truncated, info = env.step(
          #         algo.compute_single_action(s)
          #     )
          #     if done:
          #         obs, info = env.reset()
          #     env.render()
  
          results = tune.Tuner(
              "PPO",
              param_space=config,
              run_config=air.RunConfig(stop=stop, verbose=1),
          ).fit()
          check_learning_achieved(results, min_reward)
          iters = results.get_best_result().metrics[
              "training_iteration"
          ]
          print("Reached in {} iterations.".format(iters))
  
imports: from collections import deque
  import gymnasium
  import minigrid
  import numpy
  import sys
  import unittest
  import ray
  from ray import air, tune
  from ray.rllib.algorithms.callbacks import DefaultCallbacks
  import ray.rllib.algorithms.ppo
  from ray.rllib.utils.test_utils import check_learning_achieved, framework_iterator
  from ray.rllib.utils.numpy import one_hot
  from ray.tune import register_env
label_desc: Use image node_id 4 for calling the TestCuriosity obj's underlying member method code with example usage: obj.test_curiosity_on_partially_observable_domain() without return types