Create learning function in first layer