Module nn.utils
Expand source code
from torch import exp, randn
def sigmoid(x):
return 1 / (1 + exp(-x))
def init_params(size, std):
return (randn(size) * std).requires_grad_()
Functions
def init_params(size, std)-
Expand source code
def init_params(size, std): return (randn(size) * std).requires_grad_() def sigmoid(x)-
Expand source code
def sigmoid(x): return 1 / (1 + exp(-x))