broccoli-ml 13.0.0__tar.gz → 13.0.1__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-13.0.0 → broccoli_ml-13.0.1}/PKG-INFO +1 -1
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/vit.py +12 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/pyproject.toml +1 -1
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/LICENSE +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/README.md +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/__init__.py +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/activation.py +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/cnn.py +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/linear.py +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/rope.py +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/tensor.py +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/transformer.py +0 -0
- {broccoli_ml-13.0.0 → broccoli_ml-13.0.1}/broccoli/utils.py +0 -0
|
@@ -187,9 +187,14 @@ class ViTEncoder(nn.Module):
|
|
|
187
187
|
transformer_stochastic_depth=0.1,
|
|
188
188
|
transformer_checkpoint_ff=True,
|
|
189
189
|
linear_module=nn.Linear,
|
|
190
|
+
alpha=1.0,
|
|
191
|
+
beta=1.0,
|
|
190
192
|
):
|
|
191
193
|
super().__init__()
|
|
192
194
|
|
|
195
|
+
self.alpha = alpha
|
|
196
|
+
self.beta = beta
|
|
197
|
+
|
|
193
198
|
if cnn_activation_kwargs is not None:
|
|
194
199
|
self.cnn_activation = cnn_activation(**cnn_activation_kwargs)
|
|
195
200
|
else:
|
|
@@ -491,6 +496,8 @@ class ViT(nn.Module):
|
|
|
491
496
|
batch_norm_logits=True,
|
|
492
497
|
logit_projection_layer=nn.Linear,
|
|
493
498
|
linear_module=nn.Linear,
|
|
499
|
+
alpha=1.0,
|
|
500
|
+
beta=1.0,
|
|
494
501
|
):
|
|
495
502
|
|
|
496
503
|
super().__init__()
|
|
@@ -511,6 +518,9 @@ class ViT(nn.Module):
|
|
|
511
518
|
"SwiGLU": SwiGLU,
|
|
512
519
|
}[transformer_activation]
|
|
513
520
|
|
|
521
|
+
self.alpha = alpha
|
|
522
|
+
self.beta = beta
|
|
523
|
+
|
|
514
524
|
self.encoder = ViTEncoder(
|
|
515
525
|
input_size=input_size,
|
|
516
526
|
initial_batch_norm=initial_batch_norm,
|
|
@@ -559,6 +569,8 @@ class ViT(nn.Module):
|
|
|
559
569
|
transformer_stochastic_depth=transformer_stochastic_depth,
|
|
560
570
|
transformer_checkpoint_ff=transformer_checkpoint_ff,
|
|
561
571
|
linear_module=linear_module,
|
|
572
|
+
alpha=alpha,
|
|
573
|
+
beta=beta,
|
|
562
574
|
)
|
|
563
575
|
|
|
564
576
|
self.pool = head(
|
|
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
|