broccoli-ml 0.27.0__py3-none-any.whl → 0.28.0__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/transformer.py CHANGED
@@ -238,6 +238,7 @@ class FeedforwardBlock(nn.Module):
238
238
  linear_module=nn.Linear,
239
239
  pre_norm=True,
240
240
  normformer=False,
241
+ raw_input=False,
241
242
  ):
242
243
  super().__init__()
243
244
 
@@ -246,6 +247,11 @@ class FeedforwardBlock(nn.Module):
246
247
  else:
247
248
  self.activation = activation()
248
249
 
250
+ if raw_input:
251
+ self.memory_type = AnchoredLinear
252
+ else:
253
+ self.memory_type = nn.Linear
254
+
249
255
  self.dropout = nn.Dropout(dropout)
250
256
 
251
257
  self.max_features = (
@@ -260,7 +266,7 @@ class FeedforwardBlock(nn.Module):
260
266
  linear_module(input_features, self.max_features),
261
267
  self.activation,
262
268
  nn.LayerNorm(ratio * output_features) if normformer else nn.Identity(),
263
- linear_module(ratio * output_features, output_features),
269
+ self.memory_type(ratio * output_features, output_features),
264
270
  self.dropout,
265
271
  ]
266
272
  )
broccoli/vit.py CHANGED
@@ -308,6 +308,7 @@ class ViTEncoder(nn.Module):
308
308
  linear_module=linear_module,
309
309
  pre_norm=transformer_pre_norm,
310
310
  normformer=transformer_normformer,
311
+ raw_input=not cnn,
311
312
  )
312
313
  else:
313
314
  self.initial_ff = nn.Identity()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: broccoli-ml
3
- Version: 0.27.0
3
+ Version: 0.28.0
4
4
  Summary: Some useful Pytorch models, circa 2025
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -8,10 +8,10 @@ broccoli/eigenpatches.py,sha256=J6n2usN1oQuHEHYiBNyYpn_a9eQcHjOBiIlvSei520Y,2413
8
8
  broccoli/linear.py,sha256=7NkNvhtxzWAUoBJOuiPUIcr853HhI1cS71d8DwdMkJ0,4826
9
9
  broccoli/rope.py,sha256=hw7kBPNR9GQXj4GxyIAffsGKPfcTPOFh8Bc7oEHtaZY,12108
10
10
  broccoli/tensor.py,sha256=zhSOo9W24FEgN7U35wy3ZIJHnw3u4cepJO5heCw6vwU,4590
11
- broccoli/transformer.py,sha256=barmcq4Y5X6iM6STFt2t52XlXhuZphQ98wX6UvUGMFU,16748
11
+ broccoli/transformer.py,sha256=QpjhGmdI5EPC-UrMF5e-4edvYInzJCjR82nlxsUl5h4,16900
12
12
  broccoli/utils.py,sha256=htq_hOsdhUhL0nJi9WkKiEYOjEoWqFpK5X49PtgTf-0,299
13
- broccoli/vit.py,sha256=nuXX2JoKoBTtF1tAH-11mL2R5ISgMHYsBbbgvcluV1s,16072
14
- broccoli_ml-0.27.0.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
15
- broccoli_ml-0.27.0.dist-info/METADATA,sha256=dzd2nejaPCG976rKlMnDTi5RzpWAeh87Yf2LsPb2Tzw,1257
16
- broccoli_ml-0.27.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
17
- broccoli_ml-0.27.0.dist-info/RECORD,,
13
+ broccoli/vit.py,sha256=YgoiI4iQ8DP9EkI4MunxC3EOnKx2uKYkKD0SZemyRRY,16107
14
+ broccoli_ml-0.28.0.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
15
+ broccoli_ml-0.28.0.dist-info/METADATA,sha256=EzKKU4RcKdi-9L-1JHREKoeuY2oWkTO-ZR8bEV3zmY4,1257
16
+ broccoli_ml-0.28.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
17
+ broccoli_ml-0.28.0.dist-info/RECORD,,