Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

utils.py 376 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  1. def init_weights(m, mean=0.0, std=0.01):
  2. classname = m.__class__.__name__
  3. if classname.find("Conv") != -1:
  4. m.weight.data.normal_(mean, std)
  5. def apply_weight_norm(m):
  6. classname = m.__class__.__name__
  7. if classname.find("Conv") != -1:
  8. weight_norm(m)
  9. def get_padding(kernel_size, dilation=1):
  10. return int((kernel_size*dilation - dilation)/2)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...