In line 226 of the anfis.py, a runtime error arises:
RuntimeError: This function was deprecated since version 1.9 and is now removed. `torch.lstsq` is deprecated in favor of `torch.linalg.lstsq`.
`torch.linalg.lstsq` has reversed arguments and does not return the QR decomposition in the returned tuple (although it returns other information about the problem).
This is an issue that arises when swapping .gels with lstsq, which fixes the original deprecation, however with torch > 1.9 torch.linalg.lstsq is needed because another deprecation arises.
In line 226 of the anfis.py, a runtime error arises:
This is an issue that arises when swapping .gels with lstsq, which fixes the original deprecation, however with torch > 1.9
torch.linalg.lstsq
is needed because another deprecation arises.Swapping:
coeff_2d, _ = torch.lstsq(y_actual_2d, weighted_x_2d)
for:coeff_2d = torch.linalg.lstsq(weighted_x_2d, y_actual_2d).solution
fixes the problem.