lm()

function [out, Elist]=lm(W,Nit)

Input:

Output:

Implement the line minimization algorithm discussed in lecture,

  1. Initialize $W_0$
  2. Evaluate gradient: $g=\nabla_W E(W_n)$
  3. If not first iteration, do ``linmin test'': check the angle cosine $(g \cdot
d)/\sqrt{(g \cdot g) (d \cdot d)}$, where $d$ is the previous search direction
  4. Set search direction: $d=-g$
  5. Evaluate gradient at trial step: $g_t=\nabla_W E(W_n+\alpha_t d)$
  6. Compute estimate of best step: $\alpha=\alpha_t (g \cdot
d)/([g-gt] \cdot d)$
  7. $W_{n+1}=W_n+\alpha d$
  8. Repeat (2-7)
with a function of the above prototype in the file ``lm.m''. You may wish to experiment with the trial step size. You will find that the algorithm is not very sensitive to this parameter. A trial step size of $\alpha_t=3 \times 10^{-5}$ works well.
Hint: Because of our trick of coding gradients as complex matrices, we must evaluate the dot products according to the formula

\begin{displaymath}
a \cdot b = {\mbox{Re\,}}{\mbox{Tr\,}}\left(a^\dagger b\right).
\end{displaymath}



Subsections
Tomas Arias 2007-04-26