Skip to content

Use lstsq instead of gels for anfis.py in line 226 #3

Description

@GGuedesAB

Hi!
The "gels" operator was deprecated in release 1.3.0, according to this issue from pytorch's repository: pytorch/pytorch#31700.
It is recomended to use "lstsq" instead of "gels".
Here is the error I get when I run the following command from within the directory of the repository:
$ python3 jang_examples.py 1

Traceback (most recent call last):
  File "jang_examples.py", line 294, in <module>
    train_anfis(model, train_data, 20, show_plots)
  File "${workspace}/anfis-pytorch/experimental.py", line 168, in train_anfis
    train_anfis_with(model, data, optimizer, criterion, epochs, show_plots)
  File "${workspace}/anfis-pytorch/experimental.py", line 145, in train_anfis_with
    model.fit_coeff(x, y_actual)
  File "${workspace}/anfis-pytorch/anfis.py", line 342, in fit_coeff
    self.layer['consequent'].fit_coeff(x, self.weights, y_actual)
  File "${workspace}/anfis-pytorch/anfis.py", line 226, in fit_coeff
    coeff_2d, _ = torch.gels(y_actual_2d, weighted_x_2d)
AttributeError: module 'torch' has no attribute 'gels'

System information:

  • WSL2 with Ubuntu-18.04
  • Python 3.6.9

Python package information:

  • torch (1.7.1+cpu)
  • torchaudio (0.7.2)
  • torchvision (0.8.2+cpu)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions