Path: news.mathworks.com!not-for-mail
From: "Titus" <titus.edelhofer@mathworks.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Code optimization
Date: Thu, 23 Aug 2007 15:24:57 +0200
Organization: The MathWorks, Inc.
Lines: 41
Message-ID: <fak1ra$qhg$1@fred.mathworks.com>
References: <fajmoa$3nv$1@fred.mathworks.com>
NNTP-Posting-Host: 172.16.78.181
X-Trace: fred.mathworks.com 1187875499 27184 172.16.78.181 (23 Aug 2007 13:24:59 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 23 Aug 2007 13:24:59 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Xref: news.mathworks.com comp.soft-sys.matlab:425195




"Martin " <macin@o2.pl> schrieb im Newsbeitrag 
news:fajmoa$3nv$1@fred.mathworks.com...
> Dear All,
>
> I am struggling with my algorithm to work fast enough. Is
> there any possibility to make this work faster?
> Thank you very much for any advice:
>
> function o = netoutput( vw, in, n )
> % n - number of hidden neurons
> % vw - weights string
> % in - input neurons values
>
> sIn = max( size( in, 2 ) ); % number of input neurons
>
> Y = in';
> k = 1;
> j = 1;
>
> for i = sIn : sIn + n - 1
>
> tmp = sum(vw( k : k + i -1 )'.*Y );
> k = k + i;
>
> tmp = exp( 2 * tmp );
> tmp = ( tmp - 1 )./ ( tmp + 1 );
>
> Y( i+1, 1 ) = tmp;
> j = j + 1;
> end
>
> o = Y( end, 1 );

Hi Martin,
it would probably make the help somewhat easier to give, if you could give 
some sample call to your function...

Titus