class_docstr: Class that implements the MultiHead HyperMixer or HyperConformer.
  
  Arguments
  ----------
  input_size : int
      Dimension of the linear layers
  hidden_size: int
      Dimension of the hidden layer
  output_size : int
      Dimension of the HyperNetwork
  num_mlps : int
      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: ["Class","that","implements","the","MultiHead","HyperMixer","or","HyperConformer",".","Arguments","--","--","--","--","--","input_size",":","int","Dimension","of","the","linear","layers","hidden_size",":","int","Dimension","of","the","hidden","layer","output_size",":","int","Dimension","of","the","HyperNetwork","num_mlps",":","int","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_size,
      hidden_size,
      output_size=None,
      num_mlps=1,
      keep_output_size=True,
  ) -> None:
      super(ParallelMLPs, self).__init__()
  
      if output_size is None:
          output_size = input_size
  
      self.original_in_size = input_size
      self.original_out_size = output_size
  
      assert input_size % num_mlps == 0
      assert output_size % num_mlps == 0
      assert hidden_size % num_mlps == 0
      input_size = input_size // num_mlps
  
      if not keep_output_size:
          output_size = output_size // num_mlps
      hidden_size = hidden_size // num_mlps
  
      self.input_size = input_size
      self.output_size = output_size
  
      self.num_mlps = num_mlps
  
      # set the weights and biases parameters
      self.fc1_weights = nn.Parameter(
          torch.empty(num_mlps, hidden_size, input_size)
      )
      self.fc1_biases = nn.Parameter(torch.empty(num_mlps, hidden_size))
      self.fc2_weights = nn.Parameter(
          torch.empty(num_mlps, output_size, hidden_size)
      )
      self.fc2_biases = nn.Parameter(torch.empty(num_mlps, output_size))
  
      # initialize the weights and biases
      nn.init.xavier_uniform_(self.fc1_weights, gain=math.sqrt(2.0))
      nn.init.xavier_uniform_(self.fc1_biases, gain=math.sqrt(2.0))
      nn.init.xavier_uniform_(self.fc2_weights, gain=math.sqrt(2.0))
      nn.init.xavier_uniform_(self.fc2_biases, gain=math.sqrt(2.0))
  
      self.activation = nn.GELU()
  
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 ParallelMLPs object from inherited base classes: nn with example: obj = ParallelMLPs(input_size, hidden_size, output_size, num_mlps, keep_output_size)