Wu Enda's deep learning assignment answer (third lesson)