Init method based on N(0, sigma).
(self, sigma)
| 86 | return attention_scores |
| 87 | |
| 88 | def init_method_normal(self, sigma): |
| 89 | """Init method based on N(0, sigma).""" |
| 90 | |
| 91 | def init_(tensor): |
| 92 | return torch.nn.init.normal_(tensor, mean=0.0, std=sigma) |
| 93 | |
| 94 | return init_ |
| 95 | |
| 96 | def scaled_init_method_normal(self, sigma, num_layers): |
| 97 | """Init method based on N(0, sigma/sqrt(2*num_layers).""" |