first network training code