# How we can add new data in training time of neural network without stopping it in MATLAB?

I have a binary classification problem. Now I'm using patternnet in MATLAB R2014b to design a neural network for this problem. We have a system that data-set is increasing in time (for example every hour we have new 100 samples in this data set).

How we can add this new data-set to training process? I read somewhere some structures of neural network have this ability to do this in real use of neural network. Adding new data in time with shorter training time. How can I do this?

• You would have to implement some kind of gradient descent step for a pretrained network. – Marc Claesen Nov 7 '14 at 8:53
• @Marc Claesen Can you describe it with details and samples? thanks. – user2991243 Nov 7 '14 at 9:20

## 1 Answer

Ok so first you should have a infinite training loop, in which at each iteration you have improved weights. This is necessary as you will have new samples and therefore your training data will change. Further, as typical stochastic NN are more influenced by more recent samples you should pick a random sample to train every time (or otherwise shuffle your dataset).

Now for the increased training dataset I would do it in the following way. Have a loop for the acquisition where you update the training dataset, and another for the NN training (as explained above). Have this variable shared between then through, for example, local or global variables. This should be the core of the training. For classification you can again share the updated weights and use this to classify new samples at any time. Have a look how GUI work in MATLAB and you shall be able to accomplish this.