neuroph / neuroph

Java Neural Network Framework Neuroph
http://neuroph.sourceforge.net
346 stars 172 forks source link

Learning networks in online fashion #25

Open danyaljj opened 8 years ago

danyaljj commented 8 years ago

We want to make use of ur library in one of our systems. The issue we came across is that, our architecture assumes that the learners are leaned in online fashion (not batch, i.e. the classifier seems an instances, learns it, moves to the next instance. That said we can still iterate over the data multiple times).

I was checking your examples for multi-layer perceptron, which accepts data as batch:

// create multi layer perceptron
MultiLayerPerceptron myMlPerceptron = new MultiLayerPerceptron(TransferFunctionType.TANH, 2, 3, 1);
// learn the training set
myMlPerceptron.learn(trainingSet);

However I know somewhere (?) internally somewhere you learn the data instance by instance. Anyone can help me find it? Essentially I am looking for something like this:

// create multi layer perceptron
MultiLayerPerceptron myMlPerceptron = new MultiLayerPerceptron(TransferFunctionType.TANH, 2, 3, 1);

// made up code: 
for (someInstance : trainingSet) { 
    // learn the training set
    myMlPerceptron.learnOneInstance(someInstance);
}
danyaljj commented 8 years ago

Would you guys be interested in a PR which uses your network in online fashion? @neuroph

neuroph commented 8 years ago

Hi, that would be nice! :) Actually the code above learns in online mode, Internaly it feeds instances one by one and learns network. Let us know if we can help, and we would also be interested to hear about what are you trying to do.

danyaljj commented 8 years ago

Sure thing. We are adding it into LBJava, but needed to do a bit of surgery in your code and use the internal functions for learning instance by instance... would be nice to have it integrated, so that can just use your release as our dependency.

FYI @yimingjiang