Relative Content

Tag Archive for pythonpytorchautograd

pytorch autograd on linear combination weights in the parameter space

I’m trying to multiply the parameters of one model (model A) by a scalar $lambda$ to get another model (model B) which has the same architecture as A but different parameters. Then I feed a tensor into model B and get the output. I want to calculate the gradient of the output on $lambda$ but the .backward() method doesn’t work. Specifically, I try to run the following program: