Comments (3)
Yes, this is indeed a very desirable functionality. Although, the ability to modify the activation function so freely should come hand in hand with the ability to modify its derivation for the gradient decent process during the back propagation step. Another functionality that I would love to add to my class. Eventually.
As mentioned in my README, more than anything, this library was (and still is) written for learning purposes. My main goal was to implement a neural net that actually works. That is, LEARN. I never intended it to end up in any professional or commercial use (or even research).
I would, however, encourage newcomers to machine learning to experiment with my class, especially in C++, since it is so easy to install, read, initialize, and play with.
There are other, more pressing matters that I would like to address before adding these kinds of abstractions. For example, I need better matrix multiplications. More convenient Matrix constructors for arrays, vectors, and std::initializer_list. I want to add multiple epoch learning with early stopping, etc.
Nevertheless, thank you for your awesome feedback and for taking the time to write out such a descriptive example!
TL;DR - I agree with your comment. I think that it would improve the code significantly and allow for more control if this library was written for professional/commercial uses. But since this is not the case, I think this kind of optimization is lower on my priority list.
from nnplusplus.
No offense --- I did not mean anything bad. I just wanted to point out to some generalization without much code overhead. You can rely on templates and some basic inheritance, and still learn. Well, you can learn even more in this case. Eventually, when you and/or newcomers are using the source you have provided, they might need to experiment with the functionality by plugging in their favourite loss functions.
Above example can still be of help. Either you can extend the classes with gradient
methods, or you can redefine the operator()
method operating on an input variable and returning both the loss/function value and the gradient as its output parameters when either or both are wanted. Anyways, you seem to be knowing what you are supposed to do.
Cheers!
from nnplusplus.
No offense taken! And I hope I didn't come off too defensive. Was not my intention :)
I do agree there's a lot of learning to do from what you proposed, and like I said, I agree with your point. I am definitely going to refer back to your example when I want to extend user control by adding more hyper-parameters.
Thanks again for your wonderful input.
Cheers!
from nnplusplus.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnplusplus.