Theory of neuromorphic computing by waves: machine learning by rogue waves, dispersive shocks, and solitons