python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Linear Regression Stochastic Gradient Descent
I am trying to fit a sinusoidal wave (sin(2 pi x)) with some gaussian noise added to it. I am using the stochastic gradient descent algorithm, and the model I am trying to fit is linear in the paramet...
Karthik Prakash
Votes: 0
Answers: 1
torch.no_grad() and detach() combined
I encountered many code fragments like the following for choosing an action, that include a mix of torch.no_grad and detach (where actor is some actor, SomeDistribution your preferred distribution), a...
joinijo
Votes: 0
Answers: 1
Gradient only defined for scalar-output functions. Output had shape: (1,)
I'm working with gradients and having some troubles, here is my code
def model(x):
return (x+1)**2 + (x-1)**2
def loss(x,y):
return y-model(x)
x=2
grad = jax.grad(loss,argnums=0)
gradient = grad...
Lorenzo Cutrupi
Votes: 0
Answers: 1
Understanding Pytorch Weight and Biases in Linear Layer
Below is the code for combining weight and bias into a single layer, I am not able to understand the line below, why we have to multiply weight transpose matrix with bais. I should just bias without w...

ZKS
Votes: 0
Answers: 1