-
Notifications
You must be signed in to change notification settings - Fork 967
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
Simple neural net has different output for inputs in the same batch that are identical #1306
Comments
You should read about comparing float numbers first. The output of network is correct. |
Why is the output correct? What reason is there for the 5th output in the batch to be different than the 4th output in the batch, but 1st - 4th outputs are identical? There's nothing wrong with floating point comparison, it will just compare to see if the binary representations of each floating point number is equal. In this case, they are indeed equal for 1st - 4th outputs. |
Sorry, yeah, haven't read your code.
How did you compile it? |
That is intriguing, do you have an idea why this would happen? |
Well, first thing is to make sure you have compiled and installed torch according to official instructions. |
Lua5.1, gcc-4.9 linked against system gcc. |
I've installed with Lua 5.2, I believe it is supported as per http://torch.ch/docs/getting-started.html running the code with |
Since I never used Lua 5.2 with Torch I can only suggest you compile and install Torch with Lua 5.1 and check again. There is absolutely no reason to have Lua 5.2 unless you want to deal with such unexpected behaviour. |
I just reinstalled with Lua 5.1, but still getting the same result. I'm using mac OS. |
|
I just ran the same code on linux with Lua 5.2 installed and it gave the correct result. |
In this working standalone code example, an nn is initialized with 2 linear layers.
The inputs are then filled with 0s and passed through the NN.
As you can see, the nn outputs are identical for the first 4 inputs of the batch, but the 5th one is different from the 4th.
output:
The text was updated successfully, but these errors were encountered: