X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;ds=inline;f=mygpt.py;h=7117e766e3aa8347357475e77e8628850ce54942;hb=674eb2f0d02b362fbfcf8ed403b2caa329054d0a;hp=3bb3519ac1d70bf38ccb8fe6c88c106c8b1d0e2b;hpb=17c63771f2ca82ce39d8406e377ace2015fe69fc;p=culture.git diff --git a/mygpt.py b/mygpt.py index 3bb3519..7117e76 100755 --- a/mygpt.py +++ b/mygpt.py @@ -304,7 +304,7 @@ class MyGPT(nn.Module): t_next = dist.sample() sum_logits += logits.log_softmax(dim=-1)[ torch.arange(t_next.size(0)), t_next - ] + ].sum() input[:, s] = ar_mask[:, s] * t_next + (1 - ar_mask[:, s]) * input[:, s] return sum_logits