Added net training and testing.