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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: broccoli-ml
3
- Version: 0.1.36
3
+ Version: 0.1.37
4
4
  Summary: Some useful Pytorch models, circa 2025
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -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,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "broccoli-ml"
3
- version = "0.1.36"
3
+ version = "0.1.37"
4
4
  description = "Some useful Pytorch models, circa 2025"
5
5
  authors = [
6
6
  {name = "Nicholas Bailey"}
File without changes
File without changes