|
Ublas : |
From: Fernando Herrero Carrón (fernando.herrero_at_[hidden])
Date: 2006-06-16 09:26:45
No, I haven't tried it. The first reason why I used a class of my own is
that it actually does some more computation.
What I'm doing is training a perceptron with a list of patterns and
accumulating the classification error.
Now I see that with std::accumulate one can also use a custom operator,
so maybe that will do the trick. Another possibility would be to use
transform for the training method, storing outputs in another list, an
them "accumulate"ing over that list for the error. That would, of
course, be more expensive.
So thanks for the insight. Nevertheless, I am still curious why the
other way around does not work.
Kind regards,
Fernando
El vie, 16-06-2006 a las 09:03 -0400, Simon Perreault escribió:
> Fernando Herrero Carrón wrote:
> > I have a container of vectors and want to use some sort of accumulator
>
> Have you tried using the accumulate() function? See
> http://www.sgi.com/tech/stl/accumulate.html. Maybe this would work:
>
> vector<double> sum(3);
> sum(0) = 0; sum(1) = 0; sum(2) = 0;
> sum = accumulate( l.begin(), l.end(), sum );
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>
>