Give matrices right size before calling predict.
Improved caching