Skip to content

Commit

Permalink
mega vit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Oct 3, 2023
1 parent 5e8e1ed commit c1f6f63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mega_vit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from mega_vit.main import MegaVit
from mega_vit.main import MegaVit
13 changes: 12 additions & 1 deletion mega_vit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ def pair(t):

# classes

class Parallel(nn.Module):
def __init__(self, *fns):
super().__init__()
self.fns = nn.ModuleList(fns)

def forward(self, x):
return ([fn(x) for fn in self.fns])



class LayerNorm(nn.Module):
def __init__(
self,
Expand Down Expand Up @@ -104,7 +114,8 @@ def forward(self, x):

#project out
return self.to_out(out)



class Transformer(nn.Module):
def __init__(
self,
Expand Down

0 comments on commit c1f6f63

Please sign in to comment.