400x faster Matrix multiplication for Ruby

A friend called Allan de Medeiros Martins has made me loose some time playing with Restricted Boltzmann Machines just for fun!
Matrix multiplication is a critical operation in respect to the performance of the algorithm we’ve been discussing. Ruby has a Matrix class at the standard library and its Matrix#*  method does the job!
But, the whole thing was really slow compared to the matlab version of the code. Continue lendo “400x faster Matrix multiplication for Ruby”