Update adagrad.lua

This will adagrad to work with CUDA weights