class_docstr: ## Multilayer Recurrent Highway Network
class_docstr_tok: ["#","#","Multilayer","Recurrent","Highway","Network"]
docstr: Create a network of `n_layers` of recurrent highway network layers, each with depth `depth`, $D$.
docstr_tok: ["Create","a","network","of","`","n_layers","`","of","recurrent","highway","network","layers",",","each","with","depth","`","depth","`",",","$","D","$","."]
code: def __init__(
      self, input_size: int, hidden_size: int, depth: int, n_layers: int
  ):
      """
      Create a network of `n_layers` of recurrent highway network layers, each with depth `depth`, $D$.
      """
  
      super().__init__()
      self.n_layers = n_layers
      self.hidden_size = hidden_size
      # Create cells for each layer. Note that only the first layer gets the input directly.
      # Rest of the layers get the input from the layer below
      self.cells = nn.ModuleList(
          [RHNCell(input_size, hidden_size, depth)]
          + [
              RHNCell(hidden_size, hidden_size, depth)
              for _ in range(n_layers - 1)
          ]
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/recurrent_highway_networks/__init__.py
imports: from typing import Optional
  import torch
  from torch import nn
  from labml_helpers.module import Module
label_desc: Use image node_id 1 to create a new RHN object from inherited base classes: Module with example: obj = RHN(input_size, hidden_size, depth, n_layers)