Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Load my own testing file

Subject: Load my own testing file

From: Jess J

Date: 11 Mar, 2009 14:56:02

Message: 1 of 4

Hi all, I'm doing a project on neural network. After training my data, i would like to load my own testing file to test my network.
Inside the neural network toolbox, the data will be automatically divide the data set into train, validation and testing. However, i want to divide them/load another testing file by myself.

Below is something i tried:

trainInd = [(1:100)];
valInd = [(101:200)];
testInd = [(201:300)];
[trainP,valP,testV] = divideind(p,trainInd,valInd,testInd);
[trainT,valT,testT] = divideind(t,trainInd,valInd,testInd);

%where p is input, t is target.

However, the training stopped too early. Can anyone help?

Subject: Load my own testing file

From: Greg Heath

Date: 11 Mar, 2009 20:52:14

Message: 2 of 4

On Mar 11, 10:56=A0am, "Jess J" <jessie_...@yahoo.co.uk> wrote:
> Hi all, I'm doing a project onneuralnetwork. After training my data, i wo=
uld like to load my own testing file to test my network.
> Inside theneuralnetwork toolbox, the data will be automatically divide th=
e data set into train, validation and testing. However, i want to divide th=
em/load another testing file by myself.
>
> Below is something i tried:
>
> trainInd =3D [(1:100)];
> valInd =3D [(101:200)];
> testInd =3D [(201:300)];
> [trainP,valP,testV] =3D divideind(p,trainInd,valInd,testInd);
> [trainT,valT,testT] =3D divideind(t,trainInd,valInd,testInd);
>
> %where p is input, t is target.
>
> However, the training stopped too early. Can anyone help?

No.

Not enough details.

Hope this helps.

Greg

Subject: Load my own testing file

From: Jess J

Date: 12 Mar, 2009 01:20:19

Message: 3 of 4

Greg Heath <heath@alumni.brown.edu> wrote in message <921f59da-fd2a-4bfb-81e4-4f0e482941bf@z1g2000yqn.googlegroups.com>...
> On Mar 11, 10:56=A0am, "Jess J" <jessie_...@yahoo.co.uk> wrote:
> > Hi all, I'm doing a project onneuralnetwork. After training my data, i wo=
> uld like to load my own testing file to test my network.
> > Inside theneuralnetwork toolbox, the data will be automatically divide th=
> e data set into train, validation and testing. However, i want to divide th=
> em/load another testing file by myself.
> >
> > Below is something i tried:
> >
> > trainInd =3D [(1:100)];
> > valInd =3D [(101:200)];
> > testInd =3D [(201:300)];
> > [trainP,valP,testV] =3D divideind(p,trainInd,valInd,testInd);
> > [trainT,valT,testT] =3D divideind(t,trainInd,valInd,testInd);
> >
> > %where p is input, t is target.
> >
> > However, the training stopped too early. Can anyone help?
>
> No.
>
> Not enough details.
>
> Hope this helps.
>
> Greg

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Sorry.

load test
p = p';
t = t';

net = newff(p,t,[120],{'logsig','tansig'},'trainrp');
trainInd =[(1:100)];
valInd =[(101:200)];
testInd = [(201:300)];
[trainP,valP,testV] =divideind(p,trainInd,valInd,testInd);
[trainT,valT,testT] =divideind(t,trainInd,valInd,testInd);

net = train(net,p,t);

Inside the test file, column 1 to 100 i want to use for training, 101 to 200 use for validation and 201 to 300 use for testing.

**erm... why need to add 3D in front? what's the purpose for adding 3D?

Thanks.

Best Regards,
Jess

Subject: Load my own testing file

From: Greg Heath

Date: 12 Mar, 2009 18:10:14

Message: 4 of 4

On Mar 11, 8:20=A0pm, "Jess J" <jessie_...@yahoo.co.uk> wrote:
> Greg Heath <he...@alumni.brown.edu> wrote in message <921f59da-fd2a-4bfb-=
81e4-4f0e48294...@z1g2000yqn.googlegroups.com>...
> > On Mar 11, 10:56=3DA0am, "Jess J" <jessie_...@yahoo.co.uk> wrote:
> > > Hi all, I'm doing a project onneuralnetwork. After training my data, =
i wo=3D
> > uld like to load my own testing file to test my network.
> > > Inside theneuralnetwork toolbox, the data will be automatically divid=
e th=3D
> > e data set into train, validation and testing. However, i want to divid=
e th=3D
> > em/load another testing file by myself.
>
> > > Below is something i tried:
>
> > > trainInd =3D3D [(1:100)];
> > > valInd =3D3D [(101:200)];
> > > testInd =3D3D [(201:300)];
> > > [trainP,valP,testV] =3D3D divideind(p,trainInd,valInd,testInd);
> > > [trainT,valT,testT] =3D3D divideind(t,trainInd,valInd,testInd);
>
> > > %where p is input, t is target.
>
> > > However, the training stopped too early. Can anyone help?
>
> > No.
>
> > Not enough details.
>
> > Hope this helps.
>
> > Greg
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> Sorry.
>
> load test
> p =3D p';
> t =3D t';
>
> net =3D newff(p,t,[120],{'logsig','tansig'},'trainrp');
> trainInd =3D[(1:100)];
> valInd =3D[(101:200)];
> testInd =3D [(201:300)];
> [trainP,valP,testV] =3Ddivideind(p,trainInd,valInd,testInd);
> [trainT,valT,testT] =3Ddivideind(t,trainInd,valInd,testInd);
>
> net =3D train(net,p,t);
>
> Inside the test file, column 1 to 100 i want to use for training, 101 to =
200 use for validation and 201 to 300 use for testing.
>
> **erm... why need to add 3D in front? what's the purpose for adding 3D?

I did not add the 3D. It is a format conversion quirk between
MATLAB Central and Google Groups.

You are training 100 points with 120 hidden units.
Search the archives in Google Groups using

greg-heath Neq Nw

to estimate a more reasonable number.

Hope this helps.

Greg

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us