Question about regression in baseline
Closed this issue · 2 comments
hzyjerry commented
In https://github.com/tristandeleu/pytorch-maml-rl/blob/master/maml_rl/baseline.py#L44-L45, is there any particular reason to multiplying featmat.t()
? In other words, is there any drawback to just doing torch.gels(torch.matmul(returns), torch.matmul(featmat) + reg_coeff * eye)
?
Thanks in advance for your insight!
tristandeleu commented
These are the normal equations to solve a regularized linear model, which is (X^T * X + \lambda * I)^-1 * X^T * y
, so you need this featmat.t()
.
hzyjerry commented
Awesome thanks!