help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speedup/Refaktoring loop? Extended...


From: Andreas Romeyke
Subject: Re: Speedup/Refaktoring loop? Extended...
Date: Tue, 19 Aug 2008 14:36:47 +0200

Hello,

Am Tue, 19 Aug 2008 13:20:42 +0200
schrieb "Jaroslav Hajek" <address@hidden>:

> 
> try:
> 
> for iteration = 1:maxit
>    a=transpose(U) * X;
>    tmpU = transpose(U)*U;
>    for i=1:n
>        bi=tmpU(i,:)*V;
>        V(i,:) = V(i,:) .* a(i,:) / b;
>    end
> 
>    .. and analogously for the second loop
> end

Thanks to Jaroslav the algorithm could be described much simpler.
Because the paper of Lee and Seung is not very clear the update rules
seems more difficult as exist.

In the paper they wrote:

              (U^TX)_ij
V_ij <-- V_ij ---------------
              (U^TUV)_ij

and
              (XV^T)_ki
U_ki <-- U_ki ---------------
              (UVV^T)_ki

I thought that every rule infects the other one by incrementing indices
k,i and j. But in reality (tested in experiments) the stuff could be
written in terms of Octave as:

    a=transpose(U) * X;
    b=transpose(U) * U * V;
    V=V .* a ./ b;
    a=X * transpose(V);
    b=U * V * transpose(V);
    U=U .* a ./ b;

Bye Andreas
-- 
Software Developer / Dipl. Inform. (FH)
Max Planck Institute for Human Cognitive and Brain Sciences
Department of Psychology
Stephanstr. 1a, 04103 Leipzig, Germany

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]