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:
Elman network with 2 input vectors. How?

Subject: Elman network with 2 input vectors. How?

From: Christine

Date: 13 Mar, 2008 09:01:04

Message: 1 of 11


The question I want to ask is that is it possible to create
elman network with two input vectors. If yes, how?

FYI, two input vectors and 2 input elements are different
things.

--------------------------------------------------------------

Example of one input vector for elman network:

P = round(rand(1,20));
T = [0 (P(1:end-1)+P(2:end) == 2)];
Pseq = con2seq(P);
Tseq = con2seq(T);


% CREATE an Elman network whose input varies from 2 to 4,
% and has 15 TANSIG hidden neurons and 1 LOGSIG output
% neuron
net = newelm([2 4],[15 1],{'tansig','logsig'});

net = train(net,Pseq,Tseq);
Y = sim(net,Pseq)

--------------------------------------------------------------

Example for two input vectors:

P = [1 2 3 4 ; 3 2 1 4]
T = [1 1 1 1 ; 0 0 0 1]

Pseq = con2seq(P);
Tseq = con2seq(T);

--------------------------------------------------------------

I hope someone can guide me to create elman network with two
input vectors.

Subject: Elman network with 2 input vectors. How?

From: Christine

Date: 5 Aug, 2008 08:52:02

Message: 2 of 11

pls help.

Subject: Elman network with 2 input vectors. How?

From: Farsa AD

Date: 7 Dec, 2008 21:00:17

Message: 3 of 11

Any luck with your question so far????

"Christine " <christine_gee@hotmail.com> wrote in message <fraqgf$gfm$1@fred.mathworks.com>...
>
> The question I want to ask is that is it possible to create
> elman network with two input vectors. If yes, how?
>
> FYI, two input vectors and 2 input elements are different
> things.
>
> --------------------------------------------------------------
>
> Example of one input vector for elman network:
>
> P = round(rand(1,20));
> T = [0 (P(1:end-1)+P(2:end) == 2)];
> Pseq = con2seq(P);
> Tseq = con2seq(T);
>
>
> % CREATE an Elman network whose input varies from 2 to 4,
> % and has 15 TANSIG hidden neurons and 1 LOGSIG output
> % neuron
> net = newelm([2 4],[15 1],{'tansig','logsig'});
>
> net = train(net,Pseq,Tseq);
> Y = sim(net,Pseq)
>
> --------------------------------------------------------------
>
> Example for two input vectors:
>
> P = [1 2 3 4 ; 3 2 1 4]
> T = [1 1 1 1 ; 0 0 0 1]
>
> Pseq = con2seq(P);
> Tseq = con2seq(T);
>
> --------------------------------------------------------------
>
> I hope someone can guide me to create elman network with two
> input vectors.

Subject: Elman network with 2 input vectors. How?

From: Christine

Date: 10 Jul, 2009 08:49:01

Message: 4 of 11

No luck yet :(

"Farsa AD" <farsa24@yahoo.com> wrote in message <ghhdh1$e68$1@fred.mathworks.com>...
> Any luck with your question so far????

Subject: Elman network with 2 input vectors. How?

From: Greg

Date: 10 Jul, 2009 09:00:58

Message: 5 of 11

On Jul 10, 4:49 am, "Christine " <christine_...@hotmail.com> wrote:
> No luck yet :(
>
>
>
> "Farsa AD" <fars...@yahoo.com> wrote in message <ghhdh1$e6...@fred.mathworks.com>...
> > Any luck with your question so far????- Hide quoted text -
>
> - Show quoted text -

Try

net = newelm(minmax(P),[15 1],{'tansig','logsig'});

Hope this helps.

Greg

Subject: Elman network with 2 input vectors. How?

From: Ömer Faruk Ertu?rul

Date: 12 Dec, 2010 10:35:04

Message: 6 of 11

Hi,
there is an example for using more than one input; It works...

p1=sin(1:20);
p2=2*sin(1:20);

t1=ones(1,20);
t2=2*ones(1,20);

P1=[p1 p2 p1 p2 p1 p2];
P2=[p1 p2 p1 p2 p1 p2];
T=[t1 t2 t1 t2 t1 t2];

for i=1:120
    P(i,1)=P1(i);
    P(i,2)=P2(i);
end
P=P';
Pseq=con2seq(P);
Tseq=con2seq(T);
net=newelm(P,T,4);
net=train(net,Pseq,Tseq);
Y=sim(net,Pseq);

ek=seq2con(Y);
Y=ek{1,1};


"Christine " <christine_gee@hotmail.com> wrote in message <fraqgf$gfm$1@fred.mathworks.com>...
>
> The question I want to ask is that is it possible to create
> elman network with two input vectors. If yes, how?
>
> FYI, two input vectors and 2 input elements are different
> things.
>
> --------------------------------------------------------------
>
> Example of one input vector for elman network:
>
> P = round(rand(1,20));
> T = [0 (P(1:end-1)+P(2:end) == 2)];
> Pseq = con2seq(P);
> Tseq = con2seq(T);
>
>
> % CREATE an Elman network whose input varies from 2 to 4,
> % and has 15 TANSIG hidden neurons and 1 LOGSIG output
> % neuron
> net = newelm([2 4],[15 1],{'tansig','logsig'});
>
> net = train(net,Pseq,Tseq);
> Y = sim(net,Pseq)
>
> --------------------------------------------------------------
>
> Example for two input vectors:
>
> P = [1 2 3 4 ; 3 2 1 4]
> T = [1 1 1 1 ; 0 0 0 1]
>
> Pseq = con2seq(P);
> Tseq = con2seq(T);
>
> --------------------------------------------------------------
>
> I hope someone can guide me to create elman network with two
> input vectors.

Subject: Elman network with 2 input vectors. How?

From: Greg Heath

Date: 12 Dec, 2010 12:59:52

Message: 7 of 11

On Dec 12, 5:35 am, "Ömer Faruk Ertu?rul"
<omerfarukertug...@gmail.com> wrote:
> Hi,
> there is an example for using more than one input; It works...
>
> p1=sin(1:20);
> p2=2*sin(1:20);
>
> t1=ones(1,20);
> t2=2*ones(1,20);
>
> P1=[p1 p2 p1 p2 p1 p2];

help repmat
doc repmat

> P2=[p1 p2 p1 p2 p1 p2];

Typo?
It makes no sense to have
P2 = P1. 1. It adds no new information.
2. It makes the input matrix P
singular (zero singular values)
3. Singular input matrices can
cause training algorithms to fail.

> T=[t1 t2 t1 t2 t1 t2];
>
> for i=1:120
>     P(i,1)=P1(i);
>     P(i,2)=P2(i);
> end
> P=P';

Matlab was designed to avoid unnecsary
for loops:

P = [P1' P2']';

> Pseq=con2seq(P);
> Tseq=con2seq(T);
> net=newelm(P,T,4);
> net=train(net,Pseq,Tseq);
> Y=sim(net,Pseq);
>
> ek=seq2con(Y);
> Y=ek{1,1};

Typo? This statement makes no sense.

> "Christine " <christine_...@hotmail.com> wrote in message <fraqgf$gf...@fred.mathworks.com>...

-----SNIP

 1. PLEASE DO NOT TOP-POST (Putting your reply before
the question). In this and most other newgroups it
is considered to be extremely rude.
2. Christine started the thread almost 3 years ago
(Mar 08) when an obsolete version of newelm was used
that required the bound of the input variables as the
first argument.
3. My reply a year and a half ago (Jul 09) solved
her problem.

Hope this helps.

Greg

Subject: Elman network with 2 input vectors. How?

From: Ömer Faruk Ertu?rul

Date: 16 Dec, 2010 06:39:51

Message: 8 of 11

Hi,
I want to give another answer for this question;

%Vector

t=0.01:0.01:1
P=sin(10*t)+0.5*sin(30*t)-0.1*sin(50*t);
T=P(5:end);
P=P(1:end-4);

%Elman YSA create and educate

Pseq = con2seq(P);
Tseq = con2seq(T);

net = newelm([P P],T,4);

net = train(net,Pseq,Tseq);
YYY = sim(net,Pseq);
YY=seq2con(YYY);
Y=YY{1,1};

"Christine " <christine_gee@hotmail.com> wrote in message <fraqgf$gfm$1@fred.mathworks.com>...
>
> The question I want to ask is that is it possible to create
> elman network with two input vectors. If yes, how?
>
> FYI, two input vectors and 2 input elements are different
> things.
>
> --------------------------------------------------------------
>
> Example of one input vector for elman network:
>
> P = round(rand(1,20));
> T = [0 (P(1:end-1)+P(2:end) == 2)];
> Pseq = con2seq(P);
> Tseq = con2seq(T);
>
>
> % CREATE an Elman network whose input varies from 2 to 4,
> % and has 15 TANSIG hidden neurons and 1 LOGSIG output
> % neuron
> net = newelm([2 4],[15 1],{'tansig','logsig'});
>
> net = train(net,Pseq,Tseq);
> Y = sim(net,Pseq)
>
> --------------------------------------------------------------
>
> Example for two input vectors:
>
> P = [1 2 3 4 ; 3 2 1 4]
> T = [1 1 1 1 ; 0 0 0 1]
>
> Pseq = con2seq(P);
> Tseq = con2seq(T);
>
> --------------------------------------------------------------
>
> I hope someone can guide me to create elman network with two
> input vectors.

Subject: Elman network with 2 input vectors. How?

From: sugandha20mar@gmail.com

Date: 28 Feb, 2013 06:03:22

Message: 9 of 11

On Thursday, 16 December 2010 12:09:51 UTC+5:30, Ömer Faruk Ertu?rul wrote:
> Hi,
> I want to give another answer for this question;
>
> %Vector
>
> t=0.01:0.01:1
> P=sin(10*t)+0.5*sin(30*t)-0.1*sin(50*t);
> T=P(5:end);
> P=P(1:end-4);
>
> %Elman YSA create and educate
>
> Pseq = con2seq(P);
> Tseq = con2seq(T);
>
> net = newelm([P P],T,4);
>
> net = train(net,Pseq,Tseq);
> YYY = sim(net,Pseq);
> YY=seq2con(YYY);
> Y=YY{1,1};
>
> "Christine " <christine_gee@hotmail.com> wrote in message <fraqgf$gfm$1@fred.mathworks.com>...
> >
> > The question I want to ask is that is it possible to create
> > elman network with two input vectors. If yes, how?
> >
> > FYI, two input vectors and 2 input elements are different
> > things.
> >
> > --------------------------------------------------------------
> >
> > Example of one input vector for elman network:
> >
> > P = round(rand(1,20));
> > T = [0 (P(1:end-1)+P(2:end) == 2)];
> > Pseq = con2seq(P);
> > Tseq = con2seq(T);
> >
> >
> > % CREATE an Elman network whose input varies from 2 to 4,
> > % and has 15 TANSIG hidden neurons and 1 LOGSIG output
> > % neuron
> > net = newelm([2 4],[15 1],{'tansig','logsig'});
> >
> > net = train(net,Pseq,Tseq);
> > Y = sim(net,Pseq)
> >
> > --------------------------------------------------------------
> >
> > Example for two input vectors:
> >
> > P = [1 2 3 4 ; 3 2 1 4]
> > T = [1 1 1 1 ; 0 0 0 1]
> >
> > Pseq = con2seq(P);
> > Tseq = con2seq(T);
> >
> > --------------------------------------------------------------
> >
> > I hope someone can guide me to create elman network with two
> > input vectors.

can the elman network be used for more then one inputs for single output....

Subject: Elman network with 2 input vectors. How?

From: sugandha20mar@gmail.com

Date: 28 Feb, 2013 06:04:35

Message: 10 of 11

On Sunday, 12 December 2010 18:29:52 UTC+5:30, Greg Heath wrote:
> On Dec 12, 5:35am, "mer Faruk Ertu?rul"
> <omerfarukertug...@gmail.com> wrote:
> > Hi,
> > there is an example for using more than one input; It works...
> >
> > p1=sin(1:20);
> > p2=2*sin(1:20);
> >
> > t1=ones(1,20);
> > t2=2*ones(1,20);
> >
> > P1=[p1 p2 p1 p2 p1 p2];
>
> help repmat
> doc repmat
>
> > P2=[p1 p2 p1 p2 p1 p2];
>
> Typo?
> It makes no sense to have
> P2 = P1. 1. It adds no new information.
> 2. It makes the input matrix P
> singular (zero singular values)
> 3. Singular input matrices can
> cause training algorithms to fail.
>
> > T=[t1 t2 t1 t2 t1 t2];
> >
> > for i=1:120
> > P(i,1)=P1(i);
> > P(i,2)=P2(i);
> > end
> > P=P';
>
> Matlab was designed to avoid unnecsary
> for loops:
>
> P = [P1' P2']';
>
> > Pseq=con2seq(P);
> > Tseq=con2seq(T);
> > net=newelm(P,T,4);
> > net=train(net,Pseq,Tseq);
> > Y=sim(net,Pseq);
> >
> > ek=seq2con(Y);
> > Y=ek{1,1};
>
> Typo? This statement makes no sense.
>
> > "Christine " <christine_...@hotmail.com> wrote in message <fraqgf$gf...@fred.mathworks.com>...
>
> -----SNIP
>
> 1. PLEASE DO NOT TOP-POST (Putting your reply before
> the question). In this and most other newgroups it
> is considered to be extremely rude.
> 2. Christine started the thread almost 3 years ago
> (Mar 08) when an obsolete version of newelm was used
> that required the bound of the input variables as the
> first argument.
> 3. My reply a year and a half ago (Jul 09) solved
> her problem.
>
> Hope this helps.
>
> Greg

can we use elman network to find single output for more than one inputs

Subject: Elman network with 2 input vectors. How?

From: Greg Heath

Date: 1 Mar, 2013 08:00:17

Message: 11 of 11

sugandha20mar@gmail.com wrote in message <a5c592fe-2d69-46e9-8e64-2ec67ecc67d9@googlegroups.com>...
> On Sunday, 12 December 2010 18:29:52 UTC+5:30, Greg Heath wrote:
> > On Dec 12, 5:35am, "mer Faruk Ertu?rul"
> > <omerfarukertug...@gmail.com> wrote:
> > > Hi,
> > > there is an example for using more than one input; It works...
> > >
> > > p1=sin(1:20);
> > > p2=2*sin(1:20);
> > >
> > > t1=ones(1,20);
> > > t2=2*ones(1,20);
> > >
> > > P1=[p1 p2 p1 p2 p1 p2];
> >
> > help repmat
> > doc repmat
> >
> > > P2=[p1 p2 p1 p2 p1 p2];
> >
> > Typo?
> > It makes no sense to have
> > P2 = P1. 1. It adds no new information.
> > 2. It makes the input matrix P
> > singular (zero singular values)
> > 3. Singular input matrices can
> > cause training algorithms to fail.
> >
> > > T=[t1 t2 t1 t2 t1 t2];
> > >
> > > for i=1:120
> > > P(i,1)=P1(i);
> > > P(i,2)=P2(i);
> > > end
> > > P=P';
> >
> > Matlab was designed to avoid unnecsary
> > for loops:
> >
> > P = [P1' P2']';
> >
> > > Pseq=con2seq(P);
> > > Tseq=con2seq(T);
> > > net=newelm(P,T,4);
> > > net=train(net,Pseq,Tseq);
> > > Y=sim(net,Pseq);
> > >
> > > ek=seq2con(Y);
> > > Y=ek{1,1};
> >
> > Typo? This statement makes no sense.
> >
> > > "Christine " <christine_...@hotmail.com> wrote in message <fraqgf$gf...@fred.mathworks.com>...
> >
> > -----SNIP
> >
> > 1. PLEASE DO NOT TOP-POST (Putting your reply before
> > the question). In this and most other newgroups it
> > is considered to be extremely rude.
> > 2. Christine started the thread almost 3 years ago
> > (Mar 08) when an obsolete version of newelm was used
> > that required the bound of the input variables as the
> > first argument.
> > 3. My reply a year and a half ago (Jul 09) solved
> > her problem.
> >
> > Hope this helps.
> >
> > Greg
>
> can we use elman network to find single output for more than one inputs

Look up 4 lines:

> > 3. My reply a year and a half ago (Jul 09) solved
> > her problem.

Greg

P.S. Elman must be obsolete now. I cannot find it on 2011b.

Tags for 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