NameError: name 'custom_where' is not defined
Totoro-wen opened this issue · comments
chenewy commented
Hello,I discovered the following problem in pycharm
deeplearning-models/pytorch_ipynb/basic-ml/perceptron.ipynb
Traceback (most recent call last):
File "/home/aibc/Desktop/DL/pytorch_ML/traditional_ml/preceptron/preceptron.py", line 99, in <module>
ppn.train(X_train_tensor, y_train_tensor, epochs=5)
File "/home/aibc/Desktop/DL/pytorch_ML/traditional_ml/preceptron/preceptron.py", line 84, in train
errors = self.backward(x[i].view(1, self.num_features), y[i]).view(-1)
File "/home/aibc/Desktop/DL/pytorch_ML/traditional_ml/preceptron/preceptron.py", line 75, in backward
predictions = self.forward(x)
File "/home/aibc/Desktop/DL/pytorch_ML/traditional_ml/preceptron/preceptron.py", line 71, in forward
predictions = custom_where(linear > 0., 1, 0).float()
NameError: name 'custom_where' is not defined
I looked up the definition of the function, but nothing came of it.
I hope you can help me. Thank you
Sebastian Raschka commented