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

Cost Function in Backpropagation_Algorithm_using_Softmax #2

Open
Legitao opened this issue Mar 4, 2021 · 0 comments
Open

Cost Function in Backpropagation_Algorithm_using_Softmax #2

Legitao opened this issue Mar 4, 2021 · 0 comments

Comments

@Legitao
Copy link

Legitao commented Mar 4, 2021

The line to calculate the cost of Softmax output is not quite correct. Since Y and A are of shape (n_categories, batch_size), the cost should be
image

So I think the correct version should be np.mean(-np.sum(Y * np.log(A.T), axis=0))

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