Learning Algorithms for RAM-based Neural