Skip to content

Instantly share code, notes, and snippets.

@danielcwq
Created November 28, 2021 05:39
Show Gist options
  • Save danielcwq/2ea0e8a44b28696dd2445a57ae749eea to your computer and use it in GitHub Desktop.
Save danielcwq/2ea0e8a44b28696dd2445a57ae749eea to your computer and use it in GitHub Desktop.
Initialise Random Weights
def init_params(size, std=1.0):
return (torch.randn(size)*std).requires_grad_()
weights = init_params((28*28,1))
bias = init_params(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment