MATLAB Tranining with Matlab

  • Thread starter chamrik
  • Start date
Hi all,

Can anyone of you guys please help me figure out what could be wrong here.

I have built a classifier to use in predicting the secondary structure of my proteins. Since I have the data of 357*10766 inputs and 3*10766 targets. I tried separating the training set(357*8324) into two sets, and left the remaining data for testing. However, I dont seem to be getting anywhere with training. Separating the training set is most important as I will be working with larger data.

Suppose I have something like this:
x = inputs;
>> data = inputstrain;
>> targets = target_arrayK_Htrain;
>> testdata = inputstest;
>> testtargets = target_arrayK_Htest;
>> mmx = minmax(x);
>> net = newff(mmx,[2,2],{'logsig','purelin'},'trainrp');
>>wm1 =net.IW{1,1};
>>wm2 = net.b{2,1};
>>b1 = net.b{1};
>>b2 = net.b{2};
>>for k = 1:100
>>[wm1,b1,wm2,b2] = protein_step1(mmx,data2,targets2,wm1,b1,wm2,b2);
>> [wm1,b1,wm2,b2] = protein_step1(mmx,data1,targets1,wm1,b1,wm2,b2);
and protein_step is given as an m.file below:
function [wm1,b1,wm2,b2] = protein_step1(mmx,data,targets,wm1,b1,wm2,b2)

% inputs: data1, targets1,weightmatrix1,bias1,weightmatrix2,bias2,m mx=minmax(data)(created outside the function);
% Output: new weightmatrix1, new bias1, new weightmatrix2, b2.

net = newff(mmx,[2,2],{'logsig','purelin'},'trainrp');

net.IW{1,1} = wm1;
net.b{1} = b1;
net.LW{2,1} = wm2;
net.b{2} = b2;

epochnumber = 1;
net.trainParam.epochs = epochnumber;

net = train(net,data,targets);

wm1 = net.IW{1,1}; % new weights and biases obtained after training.
b1 = net.b{1};
wm2 = net.LW{2,1};
b2 = net.b{2};

Why is it that it does not train the data the way I may want it to? I am just stuck. Its even worse when I want to repeat the training process because I doubt if it ever does that.

Thank you.

Last edited by a moderator:

Want to reply to this thread?

"Tranining with Matlab" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving