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

derivative of sigmoid at nnbp.m #165

Open
GrifisJP opened this issue Sep 24, 2016 · 3 comments
Open

derivative of sigmoid at nnbp.m #165

GrifisJP opened this issue Sep 24, 2016 · 3 comments

Comments

@GrifisJP
Copy link

I have a question in nnbp.m.

case 'sigm'

d{n} = - nn.e .* (nn.a{n} .* (1 - nn.a{n}));

and

case 'sigm'

d_act = nn.a{i} .* (1 - nn.a{i});

derivative of sigmoid is
sigmoid(x)/dx = sigmoid(x)*(1-sigmoid(x))

so.. shouldn'T it be like below?

case 'sigm'

d_act =sigm( nn.a{i}) .* (1 - sigm(nn.a{i}));

thank you

@wajihullahbaig
Copy link

In nnff.m, the sigmoid is already being calculated and stored in nn.a. Just need to do 1-sigm(x) in back propagation.

@GrifisJP
Copy link
Author

Thank you.
I see, so this is why every iteration in training, nnff is also called before nnbp to update nn.a.
With Bishop notation in his book, nn.a is rewritten to ---> z = sigmoid( nn.a )

@wajihullahbaig
Copy link

Well its clear now :)

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