code: def suggest(trial, steps):
      hyperparams = {}
  
      hyperparams["reward_scale_factor"] = trial.suggest_float(
          "reward_scale_factor", 1e-5, 10, log=True
      )
      n_hidden_layers = trial.suggest_int(
          "n_hidden_layers", 1, 3
      )  # hyper-hyper-param
      hyperparams["hidden_sizes"] = []
      for n_channel in range(n_hidden_layers):
          # If n_channels is a large value, the precise number doesn't matter.
          # In other words, we should search over the smaller values more precisely.
          c = trial.suggest_int(
              "n_hidden_layers_{}_n_channels_{}".format(
                  n_hidden_layers, n_channel
              ),
              10,
              200,
              log=True,
          )
          hyperparams["hidden_sizes"].append(c)
      hyperparams["end_epsilon"] = trial.suggest_float(
          "end_epsilon", 0.0, 0.3
      )
      max_decay_steps = steps // 2
      min_decay_steps = min(1e3, max_decay_steps)
      hyperparams["decay_steps"] = trial.suggest_int(
          "decay_steps", min_decay_steps, max_decay_steps
      )
      hyperparams["lr"] = trial.suggest_float(
          "lr", 1e-4, 1e-2, log=True
      )
      # Adam's default eps==1e-8 but larger eps oftens helps.
      # (Rainbow: eps==1.5e-4, IQN: eps==1e-2/batch_size=3.125e-4)
      hyperparams["adam_eps"] = trial.suggest_float(
          "adam_eps", 1e-8, 1e-3, log=True
      )
      inv_gamma = trial.suggest_float("inv_gamma", 1e-3, 1e-1, log=True)
      hyperparams["gamma"] = 1 - inv_gamma
  
      rbuf_capacity = steps
      min_replay_start_size = min(1e3, rbuf_capacity)
      # min: Replay start size cannot exceed replay buffer capacity.
      # max: decaying epsilon without training does not make much sense.
      max_replay_start_size = min(
          max(1e3, hyperparams["decay_steps"] // 2), rbuf_capacity
      )
      hyperparams["replay_start_size"] = trial.suggest_int(
          "replay_start_size",
          min_replay_start_size,
          max_replay_start_size,
      )
      # target_update_interval should be a multiple of update_interval
      hyperparams["update_interval"] = trial.suggest_int(
          "update_interval", 1, 8
      )
      target_update_interval_coef = trial.suggest_int(
          "target_update_interval_coef", 1, 4
      )
      hyperparams["target_update_interval"] = (
          hyperparams["update_interval"] * target_update_interval_coef
      )
  
      return hyperparams
  
file_path: pfrl/examples/optuna/optuna_dqn_obs1d.py
imports: import argparse
  import logging
  import os
  import random
  import gym
  import torch.optim
  import pfrl
  from pfrl import experiments, explorers, q_functions, replay_buffers, utils
  from pfrl.agents.dqn import DQN
  from pfrl.experiments.evaluation_hooks import OptunaPrunerHook
  from pfrl.nn.mlp import MLP
label_desc: Use image node_id 3 for calling a global function with example usage: suggest(trial, steps) and returns: hyperparams