Re: [eigen] Different computation time when using Eige

[ Thread Index | Date Index | More Archives ]


are those dense or sparse matrices/vectors and what kind of sizes are you considering.
If you are using sparse matrices, do you have about the same number of non-zero elements at every run ?

Best regards,
Adrien Escande

On Mon, Jun 27, 2016 at 6:37 PM, tuch s <tuchfly@xxxxxxxxx> wrote:
I have used eigen to do the following computation in a deep learning programme,
Code: Select all
  cur->i = this->bi;
  cur->i.noalias() += this->Wxi*xt + this->Whi*prev->h;
  cur->f = this->bf;
  cur->f.noalias() += this->Wxf*xt + this->Whf*prev->h;
  cur->o = this->bo;
  cur->o.noalias() += this->Wxo*xt + this->Who*prev->h;
  cur->u = this->bu;
  cur->u.noalias() += this->Wxu*xt + this->Whu*prev->h;

W* is a matrix, and h, f, i, o, u are all vectors.

But I tried several times with the same input data, the time consuming is much different.
Some times it costs 0.4 second to get the output, but some times it cost 2.1 second to get the output.

 How can I solve this problem to get stable time cost ?

Mail converted by MHonArc 2.6.19+