Layer-wise training of feedforward neural networks based on linearization and selective data processing