Optical learning neurochips for pattern recognition, classification, and association