Path classification by stochastic linear recurrent neural networks