(self, x)
| 117 | return torch.stack([self._mask_seq(el) for el in x]) |
| 118 | |
| 119 | def preprocess(self, x): |
| 120 | std, mean = x.std(1, keepdim=True).clip_(0.2), x.mean(1, keepdim=True) |
| 121 | x = (x - mean) / std |
| 122 | x = self._slice(x) |
| 123 | x = F.pad(x, pad=(2, 0, 1, 0), mode="constant", value=0) |
| 124 | x[:, 0, 0] = (mean.squeeze() - 2) / 2 |
| 125 | x[:, 0, 1] = (std.squeeze() - 2) / 8 |
| 126 | return x |
| 127 | |
| 128 | def _reset_parameters_datapt(self): |
| 129 | # not scaling the initial embeddngs. |
no test coverage detected