Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions anfis.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def fit_coeff(self, x, weights, y_actual):
# Use gels to do LSE, then pick out the solution rows:
try:
coeff_2d, _ = torch.gels(y_actual_2d, weighted_x_2d)
except AttributeError:
coeff_2d, _ = torch.lstsq(y_actual_2d, weighted_x_2d)
except RuntimeError as e:
print('Internal error in gels', e)
print('Weights are:', weighted_x)
Expand Down