class_docstr: ## Trainer
class_docstr_tok: ["#","#","Trainer"]
docstr: ### Run training loop
docstr_tok: ["#","#","#","Run","training","loop"]
code: def run_training_loop(self):
      """
      ### Run training loop
      """
  
      # last 100 episode information
      tracker.set_queue("reward", 100, True)
      tracker.set_queue("length", 100, True)
  
      for update in monit.loop(self.updates):
          # sample with current policy
          samples = self.sample()
  
          # train the model
          self.train(samples)
  
          # Save tracked indicators.
          tracker.save()
          # Add a new line to the screen periodically
          if (update + 1) % 1_000 == 0:
              logger.log()
  
imports: from typing import Dict
  import numpy
  import torch
  from torch import nn
  from torch import optim
  from torch.distributions import Categorical
  from labml import monit, tracker, logger, experiment
  from labml.configs import FloatDynamicHyperParam, IntDynamicHyperParam
  from labml_helpers.module import Module
  from labml_nn.rl.game import Worker
  from labml_nn.rl.ppo import ClippedPPOLoss, ClippedValueFunctionLoss
  from labml_nn.rl.ppo.gae import GAE
label_desc: Use image node_id 6 for calling the Trainer obj's underlying member method code with example usage: obj.run_training_loop() without return types