Skip to content

Conversation

schrummy14
Copy link
Contributor

Also removed function so user does not have to choose both the correct activation function with the correct derivative of the activation function

@schrummy14
Copy link
Contributor Author

When testing with the xor..... it is a little sensitive to the learning rate......

lib/nn.js Outdated

setDActivationFunction(dFun = dsigmoid) {
this.d_activation_function = dFun;
setActivationFunction(Fun = 'sigmoid') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind using func instead of Fun?

lib/nn.js Outdated
return Math.tanh(x);
}
function dtanh(x) {
return 1-(tanh(x)*tanh(x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the output of a node has already been passed through tanh() I believe this would be (1-y*y)? (The convention I'm using to note this is y instead of x. Am I mistaken about this?

lib/nn.js Outdated
}

function tanh(x) {
return Math.tanh(x);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind conforming to the 2 space indentation?

@schrummy14
Copy link
Contributor Author

Made changes and fixed a confilict

@arisanguinetti
Copy link
Contributor

this seems to be covered on PR #62...

@shiffman
Copy link
Member

Yes indeed, apologies @schrummy14 but I just couldn't resist the object-oriented solution.

@shiffman shiffman closed this Feb 11, 2018
@schrummy14
Copy link
Contributor Author

That is fine. It will allow for a cleaner solution.

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

Successfully merging this pull request may close these issues.

3 participants