Abdullah-Nazhat commited on
Commit
c9ee00c
·
verified ·
1 Parent(s): 3dcff51

Rename cobra.py to mcdpmamba.py

Browse files
Files changed (1) hide show
  1. cobra.py → mcdpmamba.py +5 -5
cobra.py → mcdpmamba.py RENAMED
@@ -27,7 +27,7 @@ class FeedForward(nn.Module):
27
 
28
 
29
 
30
- class COBRAGatingUnit(nn.Module):
31
  def __init__(self,d_model,d_ffn,dropout):
32
  super().__init__()
33
 
@@ -47,12 +47,12 @@ class COBRAGatingUnit(nn.Module):
47
  return out
48
 
49
 
50
- class COBRABlock(nn.Module):
51
  def __init__(self, d_model, d_ffn,dropout):
52
  super().__init__()
53
 
54
  self.norm = nn.LayerNorm(d_model)
55
- self.cobgu = COBRAGatingUnit(d_model,d_ffn,dropout)
56
  self.ffn = FeedForward(d_model,d_ffn,dropout)
57
  def forward(self, x):
58
  residual = x
@@ -73,13 +73,13 @@ class COBRABlock(nn.Module):
73
 
74
 
75
 
76
- class COBRA(nn.Module):
77
  def __init__(self, d_model, d_ffn, num_layers,dropout):
78
  super().__init__()
79
 
80
  self.model = nn.Sequential(
81
 
82
- *[COBRABlock(d_model,d_ffn,dropout) for _ in range(num_layers)],
83
 
84
 
85
  )
 
27
 
28
 
29
 
30
+ class MCGatingUnit(nn.Module):
31
  def __init__(self,d_model,d_ffn,dropout):
32
  super().__init__()
33
 
 
47
  return out
48
 
49
 
50
+ class MCDPMAMBABlock(nn.Module):
51
  def __init__(self, d_model, d_ffn,dropout):
52
  super().__init__()
53
 
54
  self.norm = nn.LayerNorm(d_model)
55
+ self.mcgu = MCGatingUnit(d_model,d_ffn,dropout)
56
  self.ffn = FeedForward(d_model,d_ffn,dropout)
57
  def forward(self, x):
58
  residual = x
 
73
 
74
 
75
 
76
+ class MCDPMAMBA(nn.Module):
77
  def __init__(self, d_model, d_ffn, num_layers,dropout):
78
  super().__init__()
79
 
80
  self.model = nn.Sequential(
81
 
82
+ *[MCDPMAMBABlock(d_model,d_ffn,dropout) for _ in range(num_layers)],
83
 
84
 
85
  )