Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Tranining with Matlab

  1. Oct 4, 2006 #1
    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: Oct 5, 2006
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?