broccoli-ml 5.1.3__tar.gz → 5.2.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: 5.1.3
3
+ Version: 5.2.0
4
4
  Summary: Some useful Pytorch models, circa 2025
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -549,13 +549,12 @@ class ViT(nn.Module):
549
549
  def attention_logits(self, x):
550
550
  return self.encoder.attention_logits(x)
551
551
 
552
- def head_to_bos_token_attention(self, x):
552
+ def head_to_bos_token_attention_logits(self, x):
553
553
  all_attention = self.attention_logits(x)
554
554
  batch_averages = torch.mean(all_attention, dim=0, keepdim=False)
555
555
  sequence_averages = torch.mean(batch_averages, dim=-1, keepdim=False)
556
556
  n_bos_tokens = self.encoder.encoder[-1]._bos_tokens
557
- just_bos = sequence_averages[:, :, :n_bos_tokens]
558
- return F.softmax(just_bos, dim=-1) # (layer, head, bos_token)
557
+ return sequence_averages[:, :, :n_bos_tokens] # (layer, head, bos_token)
559
558
 
560
559
  def reset_parameters(self):
561
560
  self.encoder.reset_parameters()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "broccoli-ml"
3
- version = "5.1.3"
3
+ version = "5.2.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