Learning and adaptive linear neural network for enhancing harmonics compensation