Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Matlab Neural Network Toolkit Question - Online Learning

$
0
0
"Andriy" wrote in message <k67o0k$5c0$1@newscl01ah.mathworks.com>...
> Hi everyone,
>
> I have a question regarding neural network toolkit in matlab.
>
> I have the following situation: I don't have all the training data available to me before I start using my Neural Network. Essentially, once neural network has been trained and I have started using it, some new data becomes available and I want to use it improve my ANN.
>
> From what I understand, in this on-line environment, I should use ADAPT rather than TRAIN command. What more, data needs to be presented in the cell-array format. I do just that, but unfortunately the neural network seems to be reset every time, I may a call to adapt it. Here is my code:
>
> net = fitnet(2);
>
> %Create cell array of my data that comes in vector format
> for i=1:length(targets)
> inputs2{i}=inputs(:,i);
> targets2{i}=targets(:,i);
> end
>
> %initialise weights:
> net=init(net);
>
> %Do incremental learning in batches of 2
> for i=1:100
> [net,tr] = adapt(net,inputs2(:,((i-1)*2+1):i*2),targets2(((i-1)*2+1):i*2));
> end
>
>
> Essentially, the resulting network only contains the results of the last round of learning. What am I doing wrong?
>
> Thank you in advance for your answers!

This is a classic result.

One cure is to either train simultaneously with both sets or with the second set and a "characteristic" subset of the first set. Otherwise, the net will forget the first set.
I recommend still using train. It is much faster.

Another cure is to use a growing net with "local influence" activation functions like Gaussians. NEWRB would be a good choice if it were modified to accept an initial configuration of hidden layer activation functions.

Maybe a way to get around it is to start from scratch and train on the second set and
the centers of the previous hidden layer Gaussians (i.e., the former hidden layer centers
are the aforementioned "characteristic" subset).

My recommendation: Modify NEWRB to allow a specified initial hidden layer.

Hope this helps.

Greg

Viewing all articles
Browse latest Browse all 19628

Trending Articles