code: def __init__(self, num_inputs, use_gru):
      super().__init__()
  
      init_ = lambda m: init(
          m,
          torch.nn.init.orthogonal_,
          lambda x: torch.nn.init.constant_(x, 0),
          torch.nn.init.calculate_gain("relu"),
      )
  
      self.main = torch.nn.Sequential(
          init_(torch.nn.Conv2d(num_inputs, 32, 8, stride=4)),
          torch.nn.ReLU(),
          init_(torch.nn.Conv2d(32, 64, 4, stride=2)),
          torch.nn.ReLU(),
          init_(torch.nn.Conv2d(64, 64, 3, stride=1)),
          torch.nn.ReLU(),
          Flatten(),
          init_(torch.nn.Linear(5184, 512)),
          torch.nn.ReLU(),
      )
  
      if use_gru:
          self.gru = torch.nn.GRUCell(512, 512)
          torch.nn.init.orthogonal_(self.gru.weight_ih.data)
          torch.nn.init.orthogonal_(self.gru.weight_hh.data)
          self.gru.bias_ih.data.fill_(0)
          self.gru.bias_hh.data.fill_(0)
  
      init_ = lambda m: init(
          m,
          torch.nn.init.orthogonal_,
          lambda x: torch.nn.init.constant_(x, 0),
      )
  
      self.critic_linear = init_(torch.nn.Linear(512, 1))
  
      self.train()
  
file_path: SerpentAI/serpent/machine_learning/reinforcement_learning/ppo/cnn_base.py
imports: import torch
label_desc: Use image node_id 1 to create a new CNNBase object from inherited base classes: torch.nn with example: obj = CNNBase(num_inputs, use_gru)