Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Neural Network (choose of the target ?)

48 views
Skip to first unread message

Romain

unread,
Mar 1, 2010, 4:33:21 PM3/1/10
to
Hi,

I'm have to create a neural network concerning a work about Milling process, I have my inputs and outputs (cutting speed, cutting force, depth of cut, feed rate and surace roughness) but I have no idea what to put in Target ??

If you can help me please...

Greg Heath

unread,
Mar 2, 2010, 7:26:15 AM3/2/10
to
On Mar 1, 4:33 pm, "Romain " <bigbib...@yahoo.fr> wrote:
> Hi,
>
> I'm have to create aneuralnetwork concerning a work about Milling process, I have my inputs and outputs (cutting speed, cutting force, depth of cut, feed rate and surace roughness) but I have no idea what to put in Target ??

>
> If you can help me please...

The target, t, is the desired output for the given input x.
Train with x and t.
The output of the resulting design, given the input x, is y.
The error is e = t-y.

The most common goal of training is to minimize the
mean-squared-error.

What software are you using?
Is there a manual with examples?

Hope this helps.

Greg

Romain

unread,
Mar 3, 2010, 6:16:04 PM3/3/10
to
Thanks for your answer.
So if I understand correctly I have to put all my outputs as targets ? Is that right ? I'm using Matlab 6.1. I tried the tutorial but it doesn't work... :s

Greg Heath

unread,
Mar 4, 2010, 3:54:15 AM3/4/10
to
On Mar 3, 6:16 pm, "Romain " <bigbib...@yahoo.fr> wrote:
> Thanks for your answer.
> So if I understand correctly I have to put all my outputs as targets ? Is that right ?

Yes

doc newff
help newff

size(p) = [nvarin nobs]
size(t) = [nvarout nobs]

XOR example

p = [ 0 1 1 0; 0 0 1 1]; t = [ 1 0 1 0 ];

I'm using Matlab 6.1. I tried the tutorial but it doesn't work... :s

It didn't work because .. Oh! You didn't explain what you did!

Greg

Romain

unread,
Mar 4, 2010, 4:25:20 AM3/4/10
to
I tried this:

In matlab I enter " nntool" to get the Data Manager box, then I import my inputs:

Cutting speed: [600.04 600.04 600.04 750.06 750.06]
Feed rate: [229.2 229.2 229.2 286.5 286.5]
Depth of cut: [3 6 10 3 6]

and my targets:

Surface roughness: [0.274 0.718 0.472 0.296 0.276]
Cutting force: [12 38 38 14 26]

Then I create a new network, I clcik on train, I have to select my inputs and targets but I can just select one for each ( ??), finally I click on "Train network" and I have this:

"error using => network/train imputs are incorrectly sized for network. Matrices must all have 2 rows."

Greg Heath

unread,
Mar 6, 2010, 11:09:51 PM3/6/10
to

The basic problem is that you are not intimate with your date
(... sorry, I meant data!).
Go to comp.soft-sys.matlab in Google Groups and
search for my post on pre training advice for newbies.

"greg heath" pre training advice

p = [600.04 600.04 600.04 750.06 750.06;...
229.2 229.2 229.2 286.5 286.5;...


3 6 10 3 6]

t = [0.274 0.718 0.472 0.296 0.276;...


12 38 38 14 26]

Check the size, rank and condition numbers of p and t.
If cond(p) is too large a subset of inputs is highly
correlated and dimensionality reduction may be necessary.
Although plots of tj vs pi may add to your understanding,
I recommend first checking the all variable correlation
coefficient matrix

q = [p;t];
Cqq = corrcoef(q')

and plotting the standardized variables

help zscore

Do you see anything significant?

Before designing the NN investigate the
performance of the constant model

y00 = repmat(mean(t,2),1,N)
...
MSE00 = ... % Mean-squared-error

and the linear model

W = t/[ones(1,N);p]
y0 = W*[ones(1,N);p]
...
MSE0 = ...
NMSE0 = MSE0/MSE00 % Normalized MSE
R20 = 1-NMSE0 % R-squared statistic
R0 = sqrt(R20) % Regression correlation coefficent

Do the values in W reveal anything important?

How does R0 compare with the
input/output correlation coefficients
in the last two rows of Cqq?

The knowledge obtained from above should
help in diagnosing your problem.

Hope this helps.

Greg

Romain

unread,
Mar 7, 2010, 2:15:21 PM3/7/10
to
Thanks for your help. I can't find your post, is it still there? If you can send me the link please.

pipa

unread,
Mar 8, 2010, 10:08:08 AM3/8/10
to

Romain

unread,
Mar 8, 2010, 4:49:06 PM3/8/10
to
Why do I need to have the same number of columns for p and t ? Because I have 3 inputs and only 2 outputs... If I reduce at 2 inputs it works.

pipa

unread,
Mar 8, 2010, 6:36:05 PM3/8/10
to
"Romain " <bigb...@yahoo.fr> wrote in message <hn3rci$jrf$1...@fred.mathworks.com>...

> Why do I need to have the same number of columns for p and t ? Because I have 3 inputs and only 2 outputs... If I reduce at 2 inputs it works.

Each input must have a output. Using this input-output pair a network is supposed to learn.
If you have 3 inputs and 2 outputs then use 2 inputs (and respective 2 outputs) to train the network and use the remaining input in "sim" function after training the network. The output from "sim" function will be the simulated output for your 3rd input.

Is that clear? I think Greg may give you a better answer.

pipa

unread,
Mar 8, 2010, 6:58:02 PM3/8/10
to
Sorry....I may have misinterpreted your question. Is it a regression problem or a classification problem?

Greg Heath

unread,
Mar 9, 2010, 7:42:13 PM3/9/10
to
On Mar 8, 6:36 pm, "pipa " <balwindersi...@gmail.com> wrote:
> "Romain " <bigbib...@yahoo.fr> wrote in message <hn3rci$jr...@fred.mathworks.com>...

> > Why do I need to have the same number of columns for p and t ?

To train any of the supervised learning algorithms you have
to specify a target for each input training vector.

>Because I have 3 inputs and only 2 outputs... If I reduce at 2 inputs it works.

You are jumping to false conclusions because you did not follow
my advice.

Look at Cqq(1,2) and W(:,3)

What do those values mean?

> Each input must have a output. Using this input-output pair a network is supposed to learn.
> If you have 3 inputs and 2 outputs then use 2 inputs (and respective 2 outputs) to >train the network and use the remaining input in "sim" function after training the >network. The output from "sim" function will be the simulated output for your 3rd >input.
> Is that clear?

NO.

You are confusing output variable with output vector.

Validation and Test vectors are withheld from training;
not input variables.


Hope this helps.

Greg

Romain

unread,
Mar 10, 2010, 5:53:03 PM3/10/10
to
It is clear when I read it but when I have to do it on matalb... its an other problems, I never had a formation or something to know how to use it and I think I don't have the basis so I try to do some part but if I don't have the basis it doens't make sense...

pipa

unread,
Mar 10, 2010, 6:16:02 PM3/10/10
to
"Romain " <bigb...@yahoo.fr> wrote in message <hn97sf$bj$1...@fred.mathworks.com>...

> It is clear when I read it but when I have to do it on matalb... its an other problems, I never had a formation or something to know how to use it and I think I don't have the basis so I try to do some part but if I don't have the basis it doens't make sense...

Are you having difficulty in running the network or the results from the network doesn't make sense to you?

Romain

unread,
Mar 11, 2010, 2:28:23 PM3/11/10
to
I am having difficulty in running the network for the moment.

I tried this:

q = [p;t];
Cqq = corrcoef(q')

Cqq =

Columns 1 through 6

1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000

Columns 7 through 12

-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000

Columns 13 through 18

-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
-1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000

Columns 19 through 20

-1.0000 -1.0000
-1.0000 -1.0000
-1.0000 -1.0000
-1.0000 -1.0000
-1.0000 -1.0000
-1.0000 -1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000
1.0000 1.0000

And then: y00 = repmat(mean(t,2),1,N) :

y00 =

6.1370
19.3590
19.2360
7.2360
13.1480
23.3800
12.6580
25.6910
42.6890
18.1550

Do this results make sense or not at all ?

Greg Heath

unread,
Mar 13, 2010, 1:29:44 AM3/13/10
to

No.

>> p = [600.04 600.04 600.04 750.06 750.06;...
229.2 229.2 229.2 286.5 286.5;...
3 6 10 3 6] ;

t = [0.274 0.718 0.472 0.296 0.276;...

12 38 38 14 26] ;

q = [p;t];
Cqq = corrcoef(q')

Cqq =

1 1 -0.34855 -0.57496 -0.40825
1 1 -0.34855 -0.57496 -0.40825
-0.34855 -0.34855 1 0.44752 0.86763
-0.57496 -0.57496 0.44752 1 0.79955
-0.40825 -0.40825 0.86763 0.79955 1

%%%%%%%%%%%%%

>> N = size(t,2)
y00 = repmat(mean(t,2),1,N)

N = 5

y00 =

0.4072 0.4072 0.4072 0.4072 0.4072
25.6 25.6 25.6 25.6 25.6

Hope this helps.

Greg

Romain

unread,
Mar 13, 2010, 8:33:05 AM3/13/10
to
Can you please tell me how and where do you write your data ? Directly on matlab or in a file .txt ? Because I think I started wrong with this..

Greg Heath

unread,
Mar 13, 2010, 12:38:12 PM3/13/10
to
On Mar 13, 8:33 am, "Romain " <bigbib...@yahoo.fr> wrote:
> Can you please tell me how and where do you write your data ? Directly on matlab or in a file .txt ?  Because I think I started wrong with this..

For nonlarge data files I create and debug programs by
typing or pasting the data into the assignment statements
of the *.m file. Then I click on the debug button.

Otherwise I use the LOAD command. Type

help load

Hope this helps.

Greg

P.S. Do you have a MATLAB manual?

chris Austin

unread,
Mar 30, 2010, 9:13:07 PM3/30/10
to
Greg Heath <he...@alumni.brown.edu> wrote in message <a435ecc7-c25e-437c...@z35g2000yqd.googlegroups.com>...

hi Greg, I am trying to do some image classification on a feedforward neural net but have little idea of how to do it using the matlab nueral net.

i have a set of image 10x10 pixels (black and white binary image) that i want to give to a NN to output a vector target of [0 0 0 0 0 1 0 0 0 0 0]. The "1" may shift in position depending on the image given to the NN.
Can u please tell me how to apply this?

Thanks.

Mahmood Soltani

unread,
Feb 19, 2016, 6:25:19 PM2/19/16
to
Hi, I got a question, I would appreciate if you help me. I created the neural network problem using Fitting App. I am looking for a way to give some input now to system and the the program gives me the its estimated output from the neural box. Can you help with that?
Thanks,


Greg Heath <he...@alumni.brown.edu> wrote in message <ad7e8986-aa80-4351...@g11g2000yqe.googlegroups.com>...

Greg Heath

unread,
Feb 19, 2016, 10:59:12 PM2/19/16
to
"Mahmood Soltani" <mso...@clemson.edu> wrote in message <na888q$h7s$1...@newscl01ah.mathworks.com>...
> Hi, I got a question, I would appreciate if you help me. I created the neural network problem using Fitting App. I am looking for a way to give some input now to system and the the program gives me the its estimated output from the neural box. Can you help with that?
> Thanks,

Sorry, I haven't used that app in many years.

Greg
0 new messages