x-transformers 2.3.9__py3-none-any.whl → 2.3.10__py3-none-any.whl
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.
- x_transformers/continuous.py +5 -4
- {x_transformers-2.3.9.dist-info → x_transformers-2.3.10.dist-info}/METADATA +1 -1
- {x_transformers-2.3.9.dist-info → x_transformers-2.3.10.dist-info}/RECORD +5 -5
- {x_transformers-2.3.9.dist-info → x_transformers-2.3.10.dist-info}/WHEEL +0 -0
- {x_transformers-2.3.9.dist-info → x_transformers-2.3.10.dist-info}/licenses/LICENSE +0 -0
x_transformers/continuous.py
CHANGED
@@ -42,10 +42,9 @@ def masked_mean(t, mask):
|
|
42
42
|
# probabilistic loss fn
|
43
43
|
|
44
44
|
class GaussianNLL(Module):
|
45
|
-
def forward(self, pred, target):
|
45
|
+
def forward(self, pred, target, eps = 1e-5):
|
46
46
|
mean, var = pred
|
47
|
-
|
48
|
-
return -dist.log_prob(target)
|
47
|
+
return F.gaussian_nll_loss(mean, target, var)
|
49
48
|
|
50
49
|
# main classes
|
51
50
|
|
@@ -271,7 +270,9 @@ class ContinuousAutoregressiveWrapper(Module):
|
|
271
270
|
|
272
271
|
if self.probabilistic:
|
273
272
|
mean, var = last_output
|
274
|
-
|
273
|
+
stddev = var.clamp(min = 1e-5).sqrt()
|
274
|
+
|
275
|
+
last_output = torch.normal(mean, stddev * temperature)
|
275
276
|
|
276
277
|
out = cat((out, last_output), dim = -2)
|
277
278
|
|
@@ -2,7 +2,7 @@ x_transformers/__init__.py,sha256=h3I2ejobgEdy8H7NgV-rP8UaBCnd16-MysvDXH9GMEA,98
|
|
2
2
|
x_transformers/attend.py,sha256=-5BWWhFsp7tvZTdN91Ay5SqOjyj9uOs-122vFvoO6b4,17253
|
3
3
|
x_transformers/autoregressive_wrapper.py,sha256=reLCno9Z9pchVU79tBF8OMo21LwSZ67KAeB83jqkyAc,10505
|
4
4
|
x_transformers/belief_state_wrapper.py,sha256=YLUMk6t2MhFBEw5lHDDHJHcoCxTIkHvxTNY__GGZEKU,13374
|
5
|
-
x_transformers/continuous.py,sha256=
|
5
|
+
x_transformers/continuous.py,sha256=Ao1Ca4NWg5DQv6f4MZkoEYVQ1BsztBOg28dhOU7KUM8,9513
|
6
6
|
x_transformers/dpo.py,sha256=xt4OuOWhU8pN3OKN2LZAaC2NC8iiEnchqqcrPWVqf0o,3521
|
7
7
|
x_transformers/entropy_based_tokenizer.py,sha256=F2lO8-v3aLIcVDVNhu7RR-UtRdlmaaYJzBK9m7OnLE8,5018
|
8
8
|
x_transformers/multi_input.py,sha256=tCh-fTJDj2ib4SMGtsa-AM8MxKzJAQSwqAXOu3HU2mg,9252
|
@@ -11,7 +11,7 @@ x_transformers/nonautoregressive_wrapper.py,sha256=2NU58hYMgn-4Jzg3mie-mXb0XH_dC
|
|
11
11
|
x_transformers/x_transformers.py,sha256=Wo5hauzdn4Q9PUVjBqQo-1vCq08BT2jYUDbq3r2a5Go,114061
|
12
12
|
x_transformers/xl_autoregressive_wrapper.py,sha256=CvZMJ6A6PA-Y_bQAhnORwjJBSl6Vjq2IdW5KTdk8NI8,4195
|
13
13
|
x_transformers/xval.py,sha256=7S00kCuab4tWQa-vf-z-XfzADjVj48MoFIr7VSIvttg,8575
|
14
|
-
x_transformers-2.3.
|
15
|
-
x_transformers-2.3.
|
16
|
-
x_transformers-2.3.
|
17
|
-
x_transformers-2.3.
|
14
|
+
x_transformers-2.3.10.dist-info/METADATA,sha256=Zd0NPUOWdJpzTx_er3J3Z5rNzzPGBQfTWRvRhfEP4EM,89022
|
15
|
+
x_transformers-2.3.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
16
|
+
x_transformers-2.3.10.dist-info/licenses/LICENSE,sha256=As9u198X-U-vph5noInuUfqsAG2zX_oXPHDmdjwlPPY,1066
|
17
|
+
x_transformers-2.3.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|