code: def sample_ddpg_params(trial: optuna.Trial) -> dict[str, Any]:
      """
      Sampler for DDPG hyperparams.
  
      :param trial:
      :return:
      """
      gamma = trial.suggest_categorical(
          "gamma", [0.9, 0.95, 0.98, 0.99, 0.995, 0.999, 0.9999]
      )
      learning_rate = trial.suggest_loguniform("learning_rate", 1e-5, 1)
      batch_size = trial.suggest_categorical(
          "batch_size", [16, 32, 64, 100, 128, 256, 512, 1024, 2048]
      )
      buffer_size = trial.suggest_categorical(
          "buffer_size", [int(1e4), int(1e5), int(1e6)]
      )
      # Polyak coeff
      tau = trial.suggest_categorical(
          "tau", [0.001, 0.005, 0.01, 0.02, 0.05, 0.08]
      )
  
      train_freq = trial.suggest_categorical(
          "train_freq", [1, 4, 8, 16, 32, 64, 128, 256, 512]
      )
      gradient_steps = train_freq
  
      noise_type = trial.suggest_categorical(
          "noise_type", ["ornstein-uhlenbeck", "normal", None]
      )
      noise_std = trial.suggest_uniform("noise_std", 0, 1)
  
      # NOTE: Add "verybig" to net_arch when tuning HER (see TD3)
      net_arch = trial.suggest_categorical(
          "net_arch", ["small", "medium", "big"]
      )
      # activation_fn = trial.suggest_categorical('activation_fn', [nn.Tanh, nn.ReLU, nn.ELU, nn.LeakyReLU])
  
      net_arch = {
          "small": [64, 64],
          "medium": [256, 256],
          "big": [400, 300],
      }[net_arch]
  
      hyperparams = {
          "gamma": gamma,
          "tau": tau,
          "learning_rate": learning_rate,
          "batch_size": batch_size,
          "buffer_size": buffer_size,
          "train_freq": train_freq,
          "gradient_steps": gradient_steps,
          "policy_kwargs": dict(net_arch=net_arch),
      }
  
      if noise_type == "normal":
          hyperparams["action_noise"] = NormalActionNoise(
              mean=np.zeros(trial.n_actions),
              sigma=noise_std * np.ones(trial.n_actions),
          )
      elif noise_type == "ornstein-uhlenbeck":
          hyperparams["action_noise"] = OrnsteinUhlenbeckActionNoise(
              mean=np.zeros(trial.n_actions),
              sigma=noise_std * np.ones(trial.n_actions),
          )
  
      if trial.using_her_replay_buffer:
          hyperparams = sample_her_params(trial, hyperparams)
  
      return hyperparams
  
file_path: FinRL/finrl/agents/stablebaselines3/hyperparams_opt.py
imports: from __future__ import annotations
  from typing import Any
  from typing import Dict
  import numpy
  import optuna
  from stable_baselines3.common.noise import NormalActionNoise
  from stable_baselines3.common.noise import OrnsteinUhlenbeckActionNoise
  from torch import nn
  from utils import linear_schedule
label_desc: Use image node_id 6 for calling a global function with example usage: sample_ddpg_params(trial) and returns: hyperparams