Harnessing noise in optical computing for AI