titans-pytorch 0.0.1__tar.gz → 0.0.2__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.4
2
2
  Name: titans-pytorch
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Titans
5
5
  Project-URL: Homepage, https://pypi.org/project/titans-pytorch/
6
6
  Project-URL: Repository, https://github.com/lucidrains/titans-pytorch
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "titans-pytorch"
3
- version = "0.0.1"
3
+ version = "0.0.2"
4
4
  description = "Titans"
5
5
  authors = [
6
6
  { name = "Phil Wang", email = "lucidrains@gmail.com" }
@@ -121,7 +121,7 @@ class NeuralMemory(Module):
121
121
 
122
122
  self.to_momentum = LinearNoBias(dim, 1)
123
123
  self.to_adaptive_step = nn.Sequential(LinearNoBias(dim, 1), Rearrange('... 1 -> ...'))
124
- self.to_decay_factor = nn.Sequential(LinearNoBias(dim, 1), nn.Sigmoid()) # weight decay factor
124
+ self.to_decay_factor = LinearNoBias(dim, 1) # weight decay factor
125
125
 
126
126
  def init_weights_and_momentum(self):
127
127
  params = TensorDict(dict(self.memory_model.named_parameters()))
@@ -148,10 +148,10 @@ class NeuralMemory(Module):
148
148
 
149
149
  batch = seq.shape[0]
150
150
 
151
- adaptive_lr = self.to_adaptive_step(seq)
152
- adaptive_momentum = self.to_momentum(seq)
151
+ adaptive_lr = self.to_adaptive_step(seq).tanh() * 0.5 + 1.
153
152
 
154
- decay_factor = self.to_decay_factor(seq)
153
+ adaptive_momentum = self.to_momentum(seq).sigmoid()
154
+ decay_factor = self.to_decay_factor(seq).sigmoid()
155
155
 
156
156
  # keys and values
157
157
 
File without changes
File without changes
File without changes
File without changes