class_docstr: References:
  ===========
      - https://towardsdatascience.com/deep-reinforcement-learning-build-a-deep-q-network-dqn-to-play-cartpole-with-tensorflow-2-and-gym-8e105744b998
      - https://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html#dqn-algorithm
      - https://arxiv.org/abs/1802.00308
code: def get_action(self, state: np.ndarray, **kwargs) -> int:
      threshold: float = kwargs.get("threshold", 0)
  
      rand = random.random()
  
      if rand < threshold:
          return np.random.choice(self.n_actions)
      else:
          return np.argmax(
              self.policy_network(np.expand_dims(state, 0))
          )
  
file_path: tensortrade/tensortrade/agents/dqn_agent.py
imports: from deprecated import deprecated
  import random
  import numpy
  import tensorflow
  from collections import namedtuple
  from tensortrade.agents import Agent, ReplayMemory
  from datetime import datetime
label_desc: Use image node_id 5 for calling the DQNAgent obj's underlying member method code with example usage: obj.get_action(state) and returns: np, np