Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep Learning XOR Revisited Example #84

Open
smithjackson35 opened this issue Jan 6, 2020 · 1 comment
Open

Deep Learning XOR Revisited Example #84

smithjackson35 opened this issue Jan 6, 2020 · 1 comment

Comments

@smithjackson35
Copy link

I have looked over the code in the repository and still have not found a difference in my code that would cause it to break. I have reworked the entire chapter up to this point and still can not figure it out. Below is the error message and my code in its entirety is attached.

In [121]: with tqdm.trange(3000) as t:
...: for epoch in t:
...: epoch_loss = 0.0
...: for x, y in zip(xs, ys):
...: predicted = net.forward(x)
...: epoch_loss += loss.loss(predicted, y)
...: gradient = loss.gradient(predicted, y)
...: net.backward(gradient)
...: optimizer.step(net)
...: t.set_description(f"xor loss {epoch_loss:.3f}")
...:
0%| | 0/3000 [00:00<?, ?it/s]

NotImplementedError Traceback (most recent call last)
in
3 epoch_loss = 0.0
4 for x, y in zip(xs, ys):
----> 5 predicted = net.forward(x)
6 epoch_loss += loss.loss(predicted, y)
7 gradient = loss.gradient(predicted, y)

in forward(self, input)
10 """Just forward the input through the layers in order."""
11 for layer in self.layers:
---> 12 input = layer.forward(input)
13 return input
14 def backward(self, gradient):

in forward(self, input)
6 Note the lack of types. We're not going to be perscriptive about what kinds of inputs layers can take and whats kinds of outputs they can return
7 """
----> 8 raise NotImplementedError
9 def backward(self, gradient):
10 """

NotImplementedError:
dsfs_deeplearningissue.txt

@smithjackson35
Copy link
Author

I see where i defined some of the Linear class methods out side of the class block. I went back and correct that and still receive the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant