broccoli-ml 0.1.36__tar.gz → 0.1.37__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-0.1.36 → broccoli_ml-0.1.37}/PKG-INFO +1 -1
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/vit.py +17 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/pyproject.toml +1 -1
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/LICENSE +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/README.md +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/__init__.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/activation.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/assets/2025_resnet_imagenet_1k_pretrained_state_dict.pkl +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/assets/cifar100_eigenvectors_size_2.pt +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/assets/cifar100_eigenvectors_size_3.pt +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/cnn.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/eigenpatches.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/linear.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/rope.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/tensor.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/transformer.py +0 -0
- {broccoli_ml-0.1.36 → broccoli_ml-0.1.37}/broccoli/utils.py +0 -0
@@ -3,6 +3,7 @@ from typing import Optional
|
|
3
3
|
|
4
4
|
from .transformer import TransformerEncoder
|
5
5
|
from .cnn import ConvLayer, ConcatPool
|
6
|
+
from .activation import ReLU, SquaredReLU, GELU, SwiGLU
|
6
7
|
from einops import einsum
|
7
8
|
from einops.layers.torch import Rearrange
|
8
9
|
import torch.nn as nn
|
@@ -249,6 +250,22 @@ class CCT(nn.Module):
|
|
249
250
|
|
250
251
|
super().__init__()
|
251
252
|
|
253
|
+
if isinstance(cnn_activation, str):
|
254
|
+
cnn_activation = {
|
255
|
+
"ReLU": ReLU,
|
256
|
+
"SquaredReLU": SquaredReLU,
|
257
|
+
"GELU": GELU,
|
258
|
+
"SwiGLU": SwiGLU,
|
259
|
+
}[cnn_activation]
|
260
|
+
|
261
|
+
if isinstance(transformer_activation, str):
|
262
|
+
transformer_activation = {
|
263
|
+
"ReLU": ReLU,
|
264
|
+
"SquaredReLU": SquaredReLU,
|
265
|
+
"GELU": GELU,
|
266
|
+
"SwiGLU": SwiGLU,
|
267
|
+
}[transformer_activation]
|
268
|
+
|
252
269
|
self.encoder = CCTEncoder(
|
253
270
|
image_size=image_size,
|
254
271
|
conv_kernel_size=conv_kernel_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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|