broccoli-ml 0.2.0__tar.gz → 0.3.0__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.2.0
3
+ Version: 0.3.0
4
4
  Summary: Some useful Pytorch models, circa 2025
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -63,6 +63,7 @@ class CCTEncoder(nn.Module):
63
63
  self,
64
64
  input_size=(32, 32),
65
65
  cnn_in_channels=3,
66
+ minimum_cnn_out_channels=16,
66
67
  cnn_kernel_size=3,
67
68
  cnn_kernel_stride=1,
68
69
  cnn_kernel_padding="same",
@@ -155,8 +156,9 @@ class CCTEncoder(nn.Module):
155
156
  if pooling_type in ["maxpool", None]:
156
157
  cnn_out_channels = transformer_embedding_size
157
158
  elif pooling_type == "concat":
158
- cnn_out_channels = math.floor(
159
- transformer_embedding_size / pooling_kernel_voxels
159
+ cnn_out_channels = min(
160
+ math.floor(transformer_embedding_size / pooling_kernel_voxels),
161
+ minimum_cnn_out_channels,
160
162
  )
161
163
  else:
162
164
  raise NotImplementedError("Pooling type must be maxpool, concat or None")
@@ -301,6 +303,7 @@ class CCT(nn.Module):
301
303
  self,
302
304
  input_size=(32, 32),
303
305
  cnn_in_channels=3,
306
+ minimum_cnn_out_channels=16,
304
307
  cnn_kernel_size=3,
305
308
  cnn_kernel_stride=1,
306
309
  cnn_kernel_padding="same",
@@ -350,6 +353,7 @@ class CCT(nn.Module):
350
353
  self.encoder = CCTEncoder(
351
354
  input_size=input_size,
352
355
  cnn_in_channels=cnn_in_channels,
356
+ minimum_cnn_out_channels=minimum_cnn_out_channels,
353
357
  cnn_kernel_size=cnn_kernel_size,
354
358
  cnn_kernel_stride=cnn_kernel_stride,
355
359
  cnn_kernel_padding=cnn_kernel_padding,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "broccoli-ml"
3
- version = "0.2.0"
3
+ version = "0.3.0"
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