broccoli-ml 15.1.0__tar.gz → 15.2.0__tar.gz
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_ml-15.1.0 → broccoli_ml-15.2.0}/PKG-INFO +1 -1
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/vit.py +2 -1
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/pyproject.toml +1 -1
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/LICENSE +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/README.md +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/__init__.py +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/activation.py +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/cnn.py +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/linear.py +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/rope.py +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/tensor.py +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/transformer.py +0 -0
- {broccoli_ml-15.1.0 → broccoli_ml-15.2.0}/broccoli/utils.py +0 -0
|
@@ -522,7 +522,8 @@ class ViT(nn.Module):
|
|
|
522
522
|
|
|
523
523
|
# Set alpha and beta according to Microsoft's DeepNorm
|
|
524
524
|
self.alpha = (2 * transformer_layers) ** 0.25
|
|
525
|
-
|
|
525
|
+
# beta is only needed for very deep models
|
|
526
|
+
self.beta = 1 if transformer_layers < 50 else (8 * transformer_layers) ** -0.25
|
|
526
527
|
|
|
527
528
|
self.encoder = ViTEncoder(
|
|
528
529
|
input_size=input_size,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|