class_docstr: This class implements The HyperNetwork. It is an approach of using a one network,
  also known as a hypernetwork, to generate the weights for another network.
  Here, it is used to generate the labels of linear layers.
  
  Reference: https://arxiv.org/abs/1609.09106
  
  Arguments
  ----------
  input_output_dim : int
      Dimension of the linear layers
  hypernet_size:
      Dimension of the HyperNetwork
  tied : bool, optional
      Define whether weights of layer 1 and layer 2 are shared
  num_heads: int, optional
      Number of heads, akin to heads in MultiHeadAttention
  keep_output_size: bool, optional
      Set whether to keep the same output size independent of number of heads
class_docstr_tok: ["This","class","implements","The","HyperNetwork",".","It","is","an","approach","of","using","a","one","network",",","also","known","as","a","hypernetwork",",","to","generate","the","weights","for","another","network",".","Here",",","it","is","used","to","generate","the","labels","of","linear","layers",".","Reference",":","https",":","\/\/arxiv.org\/abs\/1609.09106","Arguments","--","--","--","--","--","input_output_dim",":","int","Dimension","of","the","linear","layers","hypernet_size",":","Dimension","of","the","HyperNetwork","tied",":","bool",",","optional","Define","whether","weights","of","layer","1","and","layer","2","are","shared","num_heads",":","int",",","optional","Number","of","heads",",","akin","to","heads","in","MultiHeadAttention","keep_output_size",":","bool",",","optional","Set","whether","to","keep","the","same","output","size","independent","of","number","of","heads"]
code: def __init__(
      self,
      input_output_dim: int,
      hypernet_size: int,
      tied=False,
      num_heads=1,
      keep_output_size=True,
  ) -> None:
      super(HyperNetwork, self).__init__()
  
      # Define whether the two linear layers have tied weights
      self.tied = tied
      self.w1_gen = ParallelMLPs(
          input_output_dim,
          input_output_dim,
          output_size=hypernet_size,
          num_mlps=num_heads,
          keep_output_size=keep_output_size,
      )
      if self.tied:
          self.w2_gen = self.w1_gen
      else:
          self.w2_gen = ParallelMLPs(
              input_output_dim,
              input_output_dim,
              output_size=hypernet_size,
              num_mlps=num_heads,
              keep_output_size=keep_output_size,
          )
  
file_path: speechbrain/speechbrain/lobes/models/transformer/hypermixing.py
imports: from typing import Optional
  import math
  import torch
  from torch import nn
label_desc: Use image node_id 1 to create a new HyperNetwork object from inherited base classes: nn with example: obj = HyperNetwork(input_output_dim, hypernet_size, tied, num_heads, keep_output_size)