Built-In Self Training Of Hardware-Based Neural Networks