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

Why didn't loss function receive the return from the layer "self.fc"? #1

Open
diogofreitasribeiro opened this issue Feb 18, 2022 · 1 comment

Comments

@diogofreitasribeiro
Copy link

diogofreitasribeiro commented Feb 18, 2022

In file nn.py on line 79, the loss function receives the variable temp_out "loss_fn(temp_out, y)", but why didn't loss function receive the variable "out" returned from the layer "out = out + self.fc(temp_out)", instead of "temp_out", then "loss_fn(out, y)"?

@Victordmz
Copy link

Victordmz commented Apr 16, 2023

I feel like your question is justified. However, couldn't it be that instead of temp_out it should be the value of self.fc(temp_out), as evaluated in line 77?

This is because if you choose out, you would do the addition twice and the averaging only once.

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

2 participants