You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value of cnn.Pred is altered by the order of the Sub function.
This means that a substract function alters also the value of the cnn.Pred if it is in the first position.
The value of output in not altered if it is in the first position.
I saw the same behaviour with the Add function
Can someone explain what is happening here?
The text was updated successfully, but these errors were encountered:
I was investigating the Sub and Add functions to learn Gorgonia but I saw some strange behaviour.
I've this line of code:
sub := gorgonia.Must(gorgonia.Add(output, cnn.Pred))
Like in the tutorials, the
cnn.Pred
is the predicted value in thefwd()
function.The
cnn.Pred
is part of the Neural Network struct:It is executed it with a:
I get this as an output:
Looks oké, this is a normal substraction of
output
minuscnn.Pred
But If I turn the parameters around:
sub := gorgonia.Must(gorgonia.Add(cnn.Pred, output))
Then I get this:
The value of
cnn.Pred
is altered by the order of the Sub function.This means that a substract function alters also the value of the
cnn.Pred
if it is in the first position.The value of
output
in not altered if it is in the first position.I saw the same behaviour with the Add function
Can someone explain what is happening here?
The text was updated successfully, but these errors were encountered: