Lecture 8 implementation of delta rule