projects
/
mygpt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2673ce0
)
Update.
author
Francois Fleuret
<francois@fleuret.org>
Fri, 29 Apr 2022 12:08:20 +0000
(14:08 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Fri, 29 Apr 2022 12:08:20 +0000
(14:08 +0200)
mygpt.py
patch
|
blob
|
history
diff --git
a/mygpt.py
b/mygpt.py
index
7bf25b5
..
a23470b
100755
(executable)
--- a/
mygpt.py
+++ b/
mygpt.py
@@
-119,3
+119,18
@@
class MyGPT(nn.Module):
return x
######################################################################
+
+if __name__ == '__main__':
+ vocabulary_size = 10
+ x = torch.randint(vocabulary_size, (25, 100))
+
+ model = MyGPT(
+ vocabulary_size = vocabulary_size,
+ dim_model = 16, dim_keys = 50, dim_hidden = 100,
+ nb_heads = 2, nb_blocks = 3,
+ dropout = 0.1
+ )
+
+ y = model(x)
+
+######################################################################