broccoli-ml 15.3.0__py3-none-any.whl → 15.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- broccoli/vit.py +7 -3
- {broccoli_ml-15.3.0.dist-info → broccoli_ml-15.4.1.dist-info}/METADATA +1 -1
- {broccoli_ml-15.3.0.dist-info → broccoli_ml-15.4.1.dist-info}/RECORD +5 -5
- {broccoli_ml-15.3.0.dist-info → broccoli_ml-15.4.1.dist-info}/LICENSE +0 -0
- {broccoli_ml-15.3.0.dist-info → broccoli_ml-15.4.1.dist-info}/WHEEL +0 -0
broccoli/vit.py
CHANGED
|
@@ -520,9 +520,13 @@ class ViT(nn.Module):
|
|
|
520
520
|
"SwiGLU": SwiGLU,
|
|
521
521
|
}[transformer_activation]
|
|
522
522
|
|
|
523
|
-
# Set alpha
|
|
524
|
-
|
|
525
|
-
|
|
523
|
+
# Set alpha according to Microsoft's DeepNorm if layers > 50
|
|
524
|
+
if transformer_layers > 50:
|
|
525
|
+
self.alpha = (2 * transformer_layers) ** 0.25
|
|
526
|
+
self.beta = 1.0 # beta is not needed as we norm the Q and K vectors in MSA!
|
|
527
|
+
else:
|
|
528
|
+
self.alpha = 1.0
|
|
529
|
+
self.beta = 1.0 # beta is not needed as we norm the Q and K vectors in MSA!
|
|
526
530
|
|
|
527
531
|
self.encoder = ViTEncoder(
|
|
528
532
|
input_size=input_size,
|
|
@@ -6,8 +6,8 @@ broccoli/rope.py,sha256=GRqApBNmYCFaDak0WL1xE_BC5CTTYKQU_PBdeTcQcjc,12557
|
|
|
6
6
|
broccoli/tensor.py,sha256=um8mrxkYbvNDo-QvHlmJm8Aw6qcngOlUZPoAk_PMReA,4480
|
|
7
7
|
broccoli/transformer.py,sha256=XCr3fkDrYvNEA3m5rdVDHU5qbf1IYJQS1Cjgmn5RX-o,28177
|
|
8
8
|
broccoli/utils.py,sha256=oOWzn6dJ5nC_9r4zq0emmfmaYACJXJNFS48AOpW2jqc,358
|
|
9
|
-
broccoli/vit.py,sha256=
|
|
10
|
-
broccoli_ml-15.
|
|
11
|
-
broccoli_ml-15.
|
|
12
|
-
broccoli_ml-15.
|
|
13
|
-
broccoli_ml-15.
|
|
9
|
+
broccoli/vit.py,sha256=lhWOcVg4GfTHJp3ABflKjQQzWGKMqrOU6QKqRWU11wo,23012
|
|
10
|
+
broccoli_ml-15.4.1.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
|
|
11
|
+
broccoli_ml-15.4.1.dist-info/METADATA,sha256=Vg2KdoHSlbV1IDYuNk8h07sVT1UTW69bt49JLiEr0os,1369
|
|
12
|
+
broccoli_ml-15.4.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
13
|
+
broccoli_ml-15.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|