The network training phase