fixed exit issue with matlab and cuda
fixed matforward to input other stuff at the end
Merge branch 'weighted_eucloss' of github.com:cbfinn/caffe into weighted_eucloss