code: def test_modules(self):
      self.start_tests(name="modules")
  
      # distributions
      self.unittest(
          policy=dict(
              distributions=dict(
                  float=dict(type="gaussian", stddev_mode="global"),
                  bounded_action=dict(type="beta"),
              )
          )
      )
  
      # layers
      import tensorflow as tf
  
      self.unittest(
          states=dict(
              type="float", shape=(2,), min_value=-1.0, max_value=2.0
          ),
          policy=dict(
              network=[
                  (lambda x: tf.clip_by_value(x, -1.0, 1.0)),
                  dict(type="dense", size=8, activation="tanh"),
              ]
          ),
      )
  
      # memories
      self.unittest(memory=100)
  
      # networks
      self.unittest(
          states=dict(
              type="float", shape=(2,), min_value=1.0, max_value=2.0
          ),
          policy=dict(
              network=[
                  dict(type="dense", size=8, activation="tanh"),
                  dict(type="dense", size=8, activation="tanh"),
              ]
          ),
      )
      self.unittest(
          states=dict(
              observation=dict(
                  type="float",
                  shape=(4, 4, 3),
                  min_value=-1.0,
                  max_value=1.0,
              ),
              attributes=dict(type="int", shape=(4, 2), num_values=5),
          ),
          policy=[
              [
                  dict(type="retrieve", tensors=["observation"]),
                  dict(type="conv2d", size=8),
                  dict(type="flatten"),
                  dict(type="register", tensor="obs-embedding"),
              ],
              [
                  dict(type="retrieve", tensors=["attributes"]),
                  dict(type="embedding", size=8),
                  dict(type="flatten"),
                  dict(type="register", tensor="attr-embedding"),
              ],
              [
                  dict(
                      type="retrieve",
                      tensors=["obs-embedding", "attr-embedding"],
                      aggregation="concat",
                  ),
                  dict(type="dense", size=16),
              ],
          ],
      )
  
      # optimizers
      self.unittest(
          optimizer=dict(
              optimizer="adam",
              learning_rate=1e-3,
              clipping_threshold=1e-2,
              multi_step=3,
              subsampling_fraction=8,
              linesearch_iterations=3,
              doublecheck_update=True,
          )
      )
  
      # parameters
      self.unittest(exploration=0.1)
      self.unittest(
          optimizer=dict(
              optimizer="adam",
              learning_rate=dict(
                  type="exponential",
                  unit="timesteps",
                  num_steps=2,
                  initial_value=0.01,
                  decay_rate=0.5,
              ),
          )
      )
      self.unittest(
          reward_estimation=dict(
              horizon=dict(
                  type="linear",
                  unit="episodes",
                  num_steps=2,
                  initial_value=2,
                  final_value=6,
              )
          )
      )
  
      # preprocessing
      reward_processing = dict(type="clipping", lower=-1.0, upper=1.0)
      self.unittest(
          states=dict(
              type="float",
              shape=(8, 8, 3),
              min_value=-1.0,
              max_value=2.0,
          ),
          reward_estimation=dict(
              horizon=3,
              estimate_advantage=True,
              predict_horizon_values="late",
              reward_processing=reward_processing,
              return_processing=dict(
                  type="clipping", lower=-1.0, upper=1.0
              ),
              advantage_processing="batch_normalization",
          ),
          state_preprocessing=[
              dict(type="image", height=4, width=4, grayscale=True),
              dict(type="exponential_normalization", decay=0.999),
          ],
      )
  
      # policy
      self.unittest(
          states=dict(
              type="float", shape=(2,), min_value=-1.0, max_value=2.0
          ),
          policy=[
              dict(type="dense", size=8, activation="tanh"),
              dict(type="dense", size=8, activation="tanh"),
          ],
      )
      self.unittest(
          states=dict(
              type="float", shape=(2,), min_value=-1.0, max_value=2.0
          ),
          policy=dict(network="auto"),
      )
      self.unittest(
          states=dict(
              type="float", shape=(2,), min_value=-1.0, max_value=2.0
          ),
          policy=dict(
              type="parametrized_distributions",
              network=[
                  dict(type="dense", size=8, activation="tanh"),
                  dict(type="dense", size=8, activation="tanh"),
              ],
              distributions=dict(
                  float=dict(type="gaussian", stddev_mode="global"),
                  bounded_action=dict(type="beta"),
              ),
              temperature=dict(
                  type="decaying",
                  decay="exponential",
                  unit="episodes",
                  num_steps=2,
                  initial_value=0.01,
                  decay_rate=0.5,
              ),
          ),
      )
      self.unittest(
          states=dict(
              type="float", shape=(2,), min_value=-1.0, max_value=2.0
          ),
          actions=dict(
              action1=dict(type="int", shape=(), num_values=5),
              action2=dict(
                  type="float", shape=(), min_value=-1.0, max_value=1.0
              ),
          ),
          policy=dict(
              type="parametrized_distributions",
              network=[
                  dict(type="dense", size=64),
                  dict(type="register", tensor="action1-embedding"),
                  dict(type="dense", size=64)
                  # Final output implicitly used for remaining actions
              ],
              single_output=False,
          ),
      )
  
file_path: tensorforce/test/test_documentation.py
imports: import unittest
  from tensorforce import Agent, Environment, Runner
  from test.unittest_base import UnittestBase
label_desc: Use image node_id 5 for calling the TestDocumentation obj's underlying member method code with example usage: obj.test_modules() without return types