<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239322</link>
    <title>MATLAB Central Newsreader - [HELP] Unknow error in my neural network</title>
    <description>Feed for thread: [HELP] Unknow error in my neural network</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 16 Nov 2008 13:57:01 -0500</pubDate>
      <title>[HELP] Unknow error in my neural network</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239322#611150</link>
      <author>Tak </author>
      <description>My code is design for image classification, skin cancer one. Should I put all the benign and malignant image into training session? And how to set the target? I saw some people do malignant as [0.9 0.1] and benign as [0.1 0.9] But I not understand how does it mean. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
This is the error message:&lt;br&gt;
??? This index expression yields only one result.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; ClassificationBNN at 54&lt;br&gt;
[net,tr,out,E] = train(net, train.P, [0.9, 0.1]);&lt;br&gt;
&lt;br&gt;
Here is the code:&lt;br&gt;
net = newff(train.P, train.T, [15, 1], {'tansig', 'purelin'}, 'trainlm');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
net.performFcn = 'mae';         % Mean absolute error performance function&lt;br&gt;
net.trainParam.goal = 0.01;      % Performance goal&lt;br&gt;
net.trainParam.show = NaN;       % Epochs between displays (NaN for no displays)&lt;br&gt;
net.trainParam.epochs = 1000;    % Maximum number of epochs to train&lt;br&gt;
net.trainParam.lr = 0.05;       % Learning rate&lt;br&gt;
[net,tr,out,E] = train(net, train.P, train.T);&lt;br&gt;
&lt;br&gt;
Where &lt;br&gt;
train.P is a [70x358 double]&lt;br&gt;
train.T is a [1x213 double]</description>
    </item>
    <item>
      <pubDate>Mon, 17 Nov 2008 00:45:54 -0500</pubDate>
      <title>Re: Unknow error in my neural network</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239322#611203</link>
      <author>Greg Heath</author>
      <description>On Nov 16, 8:57 am, &quot;Tak &quot; &amp;lt;lauho...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; My code is design for image classification, skin cancer one.&lt;br&gt;
&amp;gt; Should I put all the benign and malignant image into training session?&lt;br&gt;
&amp;gt; And how to set the target? I saw some people do malignant as&lt;br&gt;
&amp;gt; [0.9 0.1] and benign as [0.1 0.9] But I not understand how does it mean.&lt;br&gt;
&lt;br&gt;
For a classifier with only two classes you can use one output&lt;br&gt;
with the target 1 for malignant and 0 for benign.&lt;br&gt;
&lt;br&gt;
For Ntrn training cases, and I input variables,&lt;br&gt;
&lt;br&gt;
size(train.P) = [ I Ntrn]&lt;br&gt;
size(train.T) = [ 1 Ntrn]&lt;br&gt;
&lt;br&gt;
the size of the net will be I-H-1 where H is the&lt;br&gt;
number of hidden nodes. H is determined by trial and error.&lt;br&gt;
&lt;br&gt;
Using defaults,&lt;br&gt;
&lt;br&gt;
net = newff(train.P, train.T, H);&lt;br&gt;
&lt;br&gt;
[net,tr,Y,E] = train(net, train.P, train.T);&lt;br&gt;
&lt;br&gt;
net.trainParam.goal = var(train.T)/100&lt;br&gt;
net.trainParam.show = 10;&lt;br&gt;
&lt;br&gt;
Go to Google groups and search on&lt;br&gt;
&lt;br&gt;
greg-heath pretraining-advice&lt;br&gt;
greg-heath Neq Nw&lt;br&gt;
&lt;br&gt;
Hope this helps.&lt;br&gt;
&lt;br&gt;
Greg</description>
    </item>
    <item>
      <pubDate>Mon, 17 Nov 2008 20:22:02 -0500</pubDate>
      <title>Re: Unknow error in my neural network</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239322#611357</link>
      <author>Tak </author>
      <description>Thx Greg. And here I have more questions about it.&lt;br&gt;
&lt;br&gt;
1) How can I set the &quot;target 1 for malignant and 0 for benign&quot;?&lt;br&gt;
&lt;br&gt;
2) Should I include all benign and malignant image inside the train.P?&lt;br&gt;
&lt;br&gt;
3) Currently I set the target class as the mean of the train image, &lt;br&gt;
therefore, train.T = mean(train.P, 1);&lt;br&gt;
where Row:Features of the images, Column:Images&lt;br&gt;
&lt;br&gt;
4) Should i set row as image and column as feature? Since my dataset, no of features is 80 and no of image is 350. That will cause error due to dataset has more rows than columns.</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 02:37:07 -0500</pubDate>
      <title>Re: [HELP] Unknow error in my neural network</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239322#611411</link>
      <author>Tak </author>
      <description>Continuous from above question, normally [x, y] = size(dataset), row(x) or column(y) should be go to the input nodes of the network? for example, I have 60features (row(x) or column(y) value!?), is that mean my input nodes will be 60?&lt;br&gt;
&lt;br&gt;
Also because I am a newbie to Matlab and nntool, How can I find out the accuracy of the trainned network? &lt;br&gt;
&lt;br&gt;
For example, now I have new image which is not include of the training examples. Should I use &quot;sim&quot; function to test it?&lt;br&gt;
&lt;br&gt;
And I have 300 images for training, is there any efficiency way to test them all which is classify correctly? a plot function or I have to write my own equation?&lt;br&gt;
&lt;br&gt;
Many thanks,&lt;br&gt;
Tak</description>
    </item>
    <item>
      <pubDate>Tue, 02 Dec 2008 23:06:57 -0500</pubDate>
      <title>Re: Unknow error in my neural network</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239322#614601</link>
      <author>Greg Heath</author>
      <description>On Nov 17, 3:22=A0pm, &quot;Tak &quot; &amp;lt;lauho...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Thx Greg. And here I have more questions about it.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 1) How can I set the &quot;target 1 for malignant and 0 for benign&quot;?&lt;br&gt;
&lt;br&gt;
For each column in train.P put either a 1 or a zer0 in train.T&lt;br&gt;
&lt;br&gt;
&amp;gt; 2) Should I include all benign and malignant image inside the train.P?&lt;br&gt;
&lt;br&gt;
No, you need to split your data into a training set and a test set.&lt;br&gt;
&lt;br&gt;
or a training, validation and test set. These are defined in the&lt;br&gt;
comp.ai.neural-nets FAQ as well as in many of my Google Group&lt;br&gt;
posts.&lt;br&gt;
&lt;br&gt;
&amp;gt; 3) Currently I set the target class as the mean of the train image,&lt;br&gt;
&amp;gt; therefore, train.T =3D mean(train.P, 1);&lt;br&gt;
&lt;br&gt;
No.&lt;br&gt;
&lt;br&gt;
&amp;gt; where Row:Features of the images, Column:Images&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 4) Should i set row as image and column as feature? Since my dataset, no =&lt;br&gt;
of features is 80 and no of image is 350. That will cause error due to data=&lt;br&gt;
set has more rows than columns.&lt;br&gt;
&lt;br&gt;
For an I-H-O toplology,&lt;br&gt;
&lt;br&gt;
size(train.P) =3D [I Ntrn]&lt;br&gt;
size(train.T) =3D {O Ntrn]&lt;br&gt;
&lt;br&gt;
Hope this helps.&lt;br&gt;
&lt;br&gt;
Greg</description>
    </item>
    <item>
      <pubDate>Tue, 02 Dec 2008 23:40:02 -0500</pubDate>
      <title>Re: Unknow error in my neural network</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239322#614607</link>
      <author>Greg Heath</author>
      <description>On Nov 17, 9:37=A0pm, &quot;Tak &quot; &amp;lt;lauho...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Continuous from above question, normally [x, y] =3D size(dataset), row(x)=&lt;br&gt;
&amp;nbsp;or column(y) should be go to the input nodes of the network? for example, =&lt;br&gt;
I have 60features (row(x) or column(y) value!?), is that mean my input node=&lt;br&gt;
s will be 60?&lt;br&gt;
&lt;br&gt;
See my previous post.&lt;br&gt;
&lt;br&gt;
&amp;gt; Also because I am a newbie to Matlab and nntool, How can I find out the a=&lt;br&gt;
ccuracy of the trainned network?&lt;br&gt;
&lt;br&gt;
y =3D sim(net,p);&lt;br&gt;
MSE =3D mse(y-t)&lt;br&gt;
&lt;br&gt;
&amp;gt; For example, now I have new image which is not include of the training ex=&lt;br&gt;
amples. Should I use &quot;sim&quot; function to test it?&lt;br&gt;
&amp;nbsp;yes&lt;br&gt;
&lt;br&gt;
&amp;gt; And I have 300 images for training, is there any efficiency way to test t=&lt;br&gt;
hem all which is classify correctly? a plot function or I have to write my =&lt;br&gt;
own equation?&lt;br&gt;
&lt;br&gt;
You have to write your own. For each column of y&lt;br&gt;
the row of the maximum has to be the same as the&lt;br&gt;
row of t that contains the &quot;1&quot;.&lt;br&gt;
&lt;br&gt;
One of my posts may have it, Try searching&lt;br&gt;
Google Groups with&lt;br&gt;
&lt;br&gt;
greg-heath confusion matrix&lt;br&gt;
&lt;br&gt;
Hope this helps.&lt;br&gt;
&lt;br&gt;
Greg</description>
    </item>
  </channel>
</rss>

