Code Monkey home page Code Monkey logo

Comments (7)

vivin avatar vivin commented on August 25, 2024

@Fokko You're right; the derivative for LinearActivationStrategy should be 1. But I don't see how the derivative for ThresholdActivationStrategy would be 1? Wouldn't it be 0 at all points except at the threshold, where it is not differentiable?

from digitrecognizingneuralnetwork.

Fokko avatar Fokko commented on August 25, 2024

Well, at first, you should never use non-differential functions when using the back-propagation of error algorithm. We could state that at the threshold value the derivative is +inf and otherwise 0. Personally I would not use the type of activation, or I would set it to one so it will not cancel out the error. As for the example, where it is used at the input-layer, it is fine and will not cause any troubles.

I found this repository by Stackoverflow, as it is given as an example, but it should of course be correct :)

from digitrecognizingneuralnetwork.

vivin avatar vivin commented on August 25, 2024

Right, you don't want to use non-differentiable functions. I think I'll take the ThresholdActivationStrategy out. I think I threw it in there as I was learning about Neural Nets. This was a learning exercise for me and so it is littered with stuff I experimented with as I was learning. I agree that it should be correct. :)

from digitrecognizingneuralnetwork.

vivin avatar vivin commented on August 25, 2024

Ah, I remember now. I was using it for the XOR Neural Network, which it seemed to train successfully using this strategy. But it should be easy to change it to use it the logistic function instead, which should also work.

Actually, it wasn't that. I was using it to build AND and OR neural networks, but I wasn't actually training them. I think this was when I was just trying to figure out how they worked.

from digitrecognizingneuralnetwork.

vivin avatar vivin commented on August 25, 2024

I've added a comment on the file that says that it shouldn't be used with the backpropagation algorithm.

The threshold stuff works for perceptron networks, which is what the AND and OR networks in the code are, which is why I had it in there (i.e., when I was learning about NN).

from digitrecognizingneuralnetwork.

Fokko avatar Fokko commented on August 25, 2024

Good, fine by me. The error wil asymptotically decrease to zero, as long as your network is powerful enough of course. The final rounding of the output value should be done outside the network. For the rest, nice work!

from digitrecognizingneuralnetwork.

vivin avatar vivin commented on August 25, 2024

Thank you!

from digitrecognizingneuralnetwork.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.