First running part of the code, 1st layer learning.