broccoli-ml 0.5.4__tar.gz → 0.5.5__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.5.4
3
+ Version: 0.5.5
4
4
  Summary: Some useful Pytorch models, circa 2025
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -215,6 +215,7 @@ class ViTEncoder(nn.Module):
215
215
  ), # for transformer
216
216
  ]
217
217
  )
218
+ pooling_out_channels = transformer_embedding_size
218
219
 
219
220
  elif pooling_type == "max":
220
221
  self.pool = nn.Sequential(
@@ -229,6 +230,7 @@ class ViTEncoder(nn.Module):
229
230
  ), # for transformer
230
231
  ]
231
232
  )
233
+ pooling_out_channels = transformer_embedding_size
232
234
 
233
235
  elif pooling_type == "average":
234
236
  self.pool = nn.Sequential(
@@ -243,6 +245,7 @@ class ViTEncoder(nn.Module):
243
245
  ), # for transformer
244
246
  ]
245
247
  )
248
+ pooling_out_channels = transformer_embedding_size
246
249
 
247
250
  elif pooling_type == "concat":
248
251
 
@@ -253,9 +256,7 @@ class ViTEncoder(nn.Module):
253
256
  else:
254
257
  self.concatpool_activation = transformer_activation()
255
258
 
256
- concatpool_out_channels = (
257
- pooling_kernel_voxels * cnn_activation_out_channels
258
- )
259
+ pooling_out_channels = pooling_kernel_voxels * cnn_activation_out_channels
259
260
 
260
261
  self.pool = nn.Sequential(
261
262
  *[
@@ -268,9 +269,6 @@ class ViTEncoder(nn.Module):
268
269
  Rearrange( # for transformer
269
270
  f"N C {spatial_dim_names} -> N ({spatial_dim_names}) C"
270
271
  ),
271
- PadTensor(
272
- (0, transformer_embedding_size - concatpool_out_channels)
273
- ),
274
272
  ]
275
273
  )
276
274
 
@@ -303,7 +301,7 @@ class ViTEncoder(nn.Module):
303
301
  self.pool,
304
302
  (
305
303
  FeedforwardLayer(
306
- transformer_embedding_size,
304
+ pooling_out_channels,
307
305
  transformer_mlp_ratio,
308
306
  transformer_embedding_size,
309
307
  activation=transformer_activation,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "broccoli-ml"
3
- version = "0.5.4"
3
+ version = "0.5.5"
4
4
  description = "Some useful Pytorch models, circa 2025"
5
5
  authors = [
6
6
  {name = "Nicholas Bailey"}
File without changes
File without changes
File without changes