Init method based on normal distribution. This is only used for embeddings. The transformer has its own initializer.
(std=0.02)
| 25 | |
| 26 | |
| 27 | def init_method_normal(std=0.02): |
| 28 | """Init method based on normal distribution. |
| 29 | |
| 30 | This is only used for embeddings. The transformer has its |
| 31 | own initializer. |
| 32 | """ |
| 33 | |
| 34 | def init_(tensor): |
| 35 | return torch.nn.init.normal_(tensor, mean=0.0, std=std) |
| 36 | |
| 37 | return init_ |
| 38 | |
| 39 | |
| 40 | class GLMModel(torch.nn.Module): |