broccoli-ml 0.5.3__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.
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/PKG-INFO +1 -1
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/vit.py +7 -9
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/pyproject.toml +1 -1
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/LICENSE +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/README.md +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/__init__.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/activation.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/assets/2025_resnet_imagenet_1k_pretrained_state_dict.pkl +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/assets/cifar100_eigenvectors_size_2.pt +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/assets/cifar100_eigenvectors_size_3.pt +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/cnn.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/eigenpatches.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/linear.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/rope.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/tensor.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/transformer.py +0 -0
- {broccoli_ml-0.5.3 → broccoli_ml-0.5.5}/broccoli/utils.py +0 -0
@@ -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
|
-
|
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
|
|
@@ -285,8 +283,8 @@ class ViTEncoder(nn.Module):
|
|
285
283
|
mlp_ratio=transformer_mlp_ratio,
|
286
284
|
activation=transformer_activation,
|
287
285
|
activation_kwargs=transformer_activation_kwargs,
|
288
|
-
|
289
|
-
|
286
|
+
mlp_dropout=transformer_mlp_dropout,
|
287
|
+
msa_dropout=transformer_msa_dropout,
|
290
288
|
stochastic_depth=transformer_stochastic_depth,
|
291
289
|
causal=False,
|
292
290
|
linear_module=linear_module,
|
@@ -303,7 +301,7 @@ class ViTEncoder(nn.Module):
|
|
303
301
|
self.pool,
|
304
302
|
(
|
305
303
|
FeedforwardLayer(
|
306
|
-
|
304
|
+
pooling_out_channels,
|
307
305
|
transformer_mlp_ratio,
|
308
306
|
transformer_embedding_size,
|
309
307
|
activation=transformer_activation,
|
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
|