As new data becomes available, how to incrementally train a FANN? - neural-network

I built and trained a neural network using FANN library. This is an initial training; majority of data will be collected online.
When online data becomes available I want to improve the network using this new data (not re-train, but make previous training more accurate).
How to do this kind of incremental training with FANN?

Train from a file that change to:
set_training_algorithm(FANN_TRAIN_INCREMENTAL)
and subsequently train incrementally (online)
Otherwise consult this:
http://fann.sourceforge.net/fann.html

Related

Loading a dataset in parts for training a neural network

This is my first post so please ask me if something is not clear.
I am currently working on training a neural network on a custom dataset that I have created. This dataset consists of 1000 folders which contain 81 images (512x512 px) each that are going to be loaded, processed and used as an input. My issue is that my computer cannot handle such a large dataset and I have to find a way to use the whole dataset.
The neural network that I am working on can be found here https://github.com/chshin10/epinet.
On the EPINET_train.py file you can see the data generator that is being used.
The neural network uses the RMSProp optimizer.
What I did to deal with this issue is that I split the data into 2 folders one for training and one for testing with an 80%-20% split. Then I load 10% of the data from each folder in order to train the neural network (data was not chosen randomly). I train the neural network for 100 epoches and the I load the next set of data until all of the sets have been used for training. Then I repeat the procedure.
After 3 iterations it seems to me that the loss function is not getting minimized more for each set of data. Is this solution used in a similar scenario? Is there something I can do better.

During ML agent training, If I want to change observations, do I have to run the training from the beginning again?

During ML agent training, If I want to change observations(sensor shape, number of sensors, etc), do I have to run the training from the beginning again?
Short answer: Yes!
A bit longer answer: Changes in anything model structure or training data related will lead to starting the training from the beginning. All the popular frameworks transfer their model structure to the GPU while building/compiling the model and there is no way of hot-swapping this during runtime.

Is it possible to simultaneously use and train a neural network?

Is it possible to use Tensorflow or some similar library to make a model that you can efficiently train and use at the same time.
An example/use case for this would be a chat bot that you give feedback to. Somewhat like how pets learn (i.e. replicating what they just did for a reward). Or being able to add new entries or new responses they can use.
I think what you are asking is whether a model can be trained continuously without having to retrain it from scratch each time new labelled data comes in.
Answer to that is - Online models
There are models that can be trained continuously on data without worrying about training them from scratch. As per Wikipedia definition
Online machine learning is a method of machine learning in which data becomes available in sequential order and is used to update the best predictor for future data at each step, as opposed to batch learning techniques which generate the best predictor by learning on the entire training data set at once.
Some examples of such algorithms are
BernoulliNB
GaussianNB
MiniBatchKMeans
MultinomialNB
PassiveAggressiveClassifier
PassiveAggressiveRegressor
Perceptron
SGDClassifier
SGDRegressor
DNNs

Adapt neural network after training

What is the best way to adapt a neural network after its initial training?
I.e. I want to do some image recognition and the network should get better the more new pictures I present it. That could be done with reinforced learning but for a fast progress at the beginning I want to use back propagation. Is it possible to update a network?
And what about creating new categories later on?
Is there another way than retraining it with the complete dataset since that would take a lot of time.
Sorry for my basic questions but I couldn't find much information about this.
Neural networks can be adapted by training them with small learning rates on the new data. Maybe even training the last layers with a larger learning rate than the others (incase you are using a deep neural network).
For the second part of your question, about creating new categories, a deep neural network can be used as a feature extractor on top of any other classifier (maybe another small neural network). When you want to add a new category, you have to re-train the small classifier (or neural network). This would mean that you will retain the training values of the feature detector (the deep neural network) and use it to detect new categories.

neural network data for training and testing

I have a question regarding Training and testing data for my ANN .
Should the testing data going trough a feature extraction process before it can be classified?
I am new to this field. Is what I am doing right?
I separate the dataset to 80% train and 20 % test. Both sets , I extract the features. for train data I put it into training network but not for the test data. Then go to classification. Is this correct? because my SV said the test data should not go through the feature extraction process. I am wondering how the ANN can recognize the input if not specific feature is being extract. Apologize my bad English.
If anyone have link or journal that I can refer please provide it..
Thanks a lot.
Both the training and the test data needs to be in the same format - thus your training data and test data should go through the same pre-processing steps else your network will not learn correctly.
You are doing it right (as far as I understand your question).
Example: If you were to show me 10 images of faces (training data) on paper and then present me 2 people (training data) by their name only (different feature representation) - I wouldn't be able to classify what I didn't learn. You can't train the network with images and then test it with audio or any representation other than the one you used for training. I can't link any papers for that as it's just common sense.
You can modify the training set, e.g. by adding noise. But whatever you do, the representation format has to be the same.