Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. import numpy as np
  2.  
  3. import torch
  4. import torch.nn as nn
  5. import torch.nn.functional as F
  6.  
  7. def hidden_init(layer):
  8. fan_in = layer.weight.data.size()[0]
  9. lim = 1. / np.sqrt(fan_in)
  10. return (-lim, lim)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement