quantling / JudiLing.jl

JudiLing: An implementation for Linear Discriminative Learning in Julia.
MIT License
8 stars 3 forks source link

Use views in wh_learn? #40

Closed dmbates closed 3 years ago

dmbates commented 3 years ago

I notice that the wh_learn has some matrix multiplications using mul! inside a loop on epochs and that the arguments are slices of matrices. It may be more efficient to use views as they do not require copying. So an expression like

      mul!(pred, X[i:i, :], W)

involves copying the i'th row of X but

      mul!(pred, view(X, i:i, :), W)

doesn't.

MegamindHenry commented 3 years ago

Thank you Prof. Bates! It is done!