-
Notifications
You must be signed in to change notification settings - Fork 237
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
Issue with changing activation functions #31
Comments
You can set |
Tanh and ReLU are non linear activation functions right? So I should be able to use those two functions for the examples. However, when I run using those functions it doesn't pass some of the examples. I'm assuming its because the ranges are different than sigmoid. Would I have to change anything in the source code to allow it use tanh or relu? |
Actually, in the code, the backpropagation algorithm is written only for the sigmoid activation function. We have to change the code for any generic activation function. If no one is working, I can work on this. |
Yes, back-propagation is only implemented for sigmoid. Other training methods can still work with other activation functions. If back-prop is needed, it'll need to be implemented. |
Hey @codeplea can I work on this issue? I would like to add back prop for tanh and relu activation functions. If no one else is working on this, pls assign me this issue. |
@msrdinesh Sure. Give it a go. Just please keep it short and simple. I think you can mirror the way that output and hidden activation functions are used. |
Ok, I will do it. Thanks. |
@msrdinesh, @codeplea hello any follow up on that matter? Have a good day. |
I'm waiting too for update about changing the activation function :) |
@moe123 @ScratchyCode It's trivial to adapt backprop to any function you want. Read this, preferably with a pen and paper, redoing the calculation on your own until it becomes crystal clear. |
@lucasart computing the derivative is not the problem, the problem is to have a redesign of the code that reflects the current activation function, so something needs to be known and pass along: a state. We can all patch dirty; we already all do; however, we would prefer a clean redesigned approach to support this option + would let the opportunity to run several instances set up differently without tweaking and stirring the code. When you start maintaining third-party forks and patches, it's already too much. I think we all have a float-single version running on an approx of the exp function somewhere. |
I wrote my own nn library library, if anyone's interested. Same functionality as genann. Also uses a flat memory layout for weights+neurons+delta (great for cache efficiency and use with more advanced gradient optimisations methods, so user code can directly adress the weights vector). But also better, because:
|
@lucasart ; the implementation is interesting; meanwhile, I would go deeper, adding a layer of indirection on any internal arithmetic operations then moving |
I was wondering how to change the default sigmoid activation function to something else. I've tried changing it to tanh and it's not working. I've also tried using the linear activation function on the examples given and it's failing that as well
The text was updated successfully, but these errors were encountered: