Theano data loading function