Method and apparatus for performing close-loop programming of resistive memory devices in crossbar array based hardware circuits and systems. Invention provides iterative training of memristor crossbar arrays for neural networks by applying voltages corresponding to selected training patterns. Error is detected and measured as a function of the actual response to the training patterns versus the expected response to the training pattern.
Please help me write a proper abstract based on the patent claims. CLAIM: 1. A method for programming neural networks having row and column arrays of resistive memory devices, said method comprising the steps of: initializing said resistive memory devices to a predetermined resistance value; determining whether a training status tracker indicates that an overall training process is completed; selecting a training pattern; inputting said training pattern to said arrays and outputting a resulting signal; detecting error by computing the difference between said output signal and an expected output signal value; determining whether said detected error is within a near zero threshold and if so, updating said training progress in said training status tracker; and returning to said step of determining whether said overall training process is completed; otherwise, generating programming signals and adjusting resistance states of said resistive memory devices in said arrays by applying said programming signals; resetting the training progress as in the status tracker; and returning to said step of determining whether said overall training process is completed. 2. The method of claim 1, wherein said resistive memory devices comprise memristors. 3. The method of claim 2, wherein said step of inputting said training pattern to said arrays further comprises the step of converting said training pattern to a set of input voltages within a predetermined voltage boundary range. 4. The method of claim 3 wherein said voltage boundary range is between −0.1 volts and +0.1 volts. 5. The method of claim 2, wherein said step of selecting a training pattern further comprises the step of identifying and excluding from said selection patterns those that have previously been trained and recorded by said training status tracker. 6. The method of claim 1 wherein said detected error is discretized to any one of −1, 0, or +1. 7. The method of claim 1, wherein said step of detecting error further comprises determining whether |Vout(i)−λ·Vin(i)|<θ where θ is the predetermined tolerable difference; Vout(i) is the value of an output bit of an output vector; Vin(i) is the value of an input bit of an input vector; and λ is scalar that when multiplied by Vin(i) produces an expected target output signal vector. 8. The method of claim 2, wherein said step of inputting said training pattern to said arrays further comprises the steps of inputting said training pattern into one of said arrays of resistive memory devices at a time. 9. The method of claim 8, wherein said step of inputting said training pattern further comprises applying a vector of programming signals to all said rows of said one said column of said arrays of resistive memory devices. 10. The method of claim 9, wherein the amplitude and polarity of said programming signals applied to a particular column is determined by said detected error corresponding to said column. 11. The method of claim 10, wherein for a first of said arrays of resistive memory devices, said programming signals are a currently selected training/prototype pattern when error detection output is 1; otherwise its element-wise negated version when error detection output is −1. 12. The method of claim 9, wherein said programming signals for a first of said arrays of resistive memory devices has an opposite polarity from a set of programming signals for second of said arrays of resistive memory devices. 13. The method of claim 9, wherein for a second of said arrays of resistive memory devices, the programming signals are either the currently selected training/prototype pattern when error detection output is −1; otherwise its element-wise negated version when error detection output is 1. 14. The method of claim 13, wherein the voltage of said programming signals is greater than the programming threshold voltage of any said memristor in a column being programmed. 15. An apparatus for programming neural networks having row and column arrays of resistive memory devices, said apparatus comprising: a training status tracker (ST) for tracking overall training progress so as to keep record of training patterns to be excluded for a subsequent training pattern selection, and determining whether said overall training is completed; a read/write (R/W) control component that controls a recall and programming mode of a BSB recall circuit; a programming signal generator for generating signals to said arrays of resistive memory devices so as to adjust the resistance states of said resistive memory devices; an error detector for computing the difference between said training pattern input into said neural network and an output signal therefrom; an arbiter for determining whether said detected error is a vector of logic zero values and if so, said arbiter causes said status tracker to update training progress; and checks said status tracker to determine whether said overall training is completed; otherwise, said arbiter causes said programming signal generator to enable a programming mode of said arrays of resistive memory devices so as to adjust memristor resistance states; causes said status tracker to reset training progress; and checks said status tracker to determine whether said neural overall training is completed. 16. The apparatus of claim 15, wherein said R/W control component converts said training pattern to a set of input voltages within a predetermined voltage boundary range. 17. The apparatus of claim 16 wherein said voltage boundary range is between −0.1 volts and +0.1 volts. 18. The apparatus of claim 15, wherein said arbiter identifies and excludes from said selection patterns those that have been marked as trained by said status tracker (ST). 19. The apparatus of claim 15 wherein said detected error is discretized to any one of −1, 0, or +1. 20. The apparatus of claim 15, wherein said error detector determines whether |Vout(i)−λ·Vin(i)|<θ where θ is the predetermined tolerable difference; Vout(i) s the value of an output bit of an output vector; Vin(i) is the value of an input bit of an input vector; and λ is scalar that when multiplied by Vin(i) produces a target output signal vector. 21. The apparatus of claim 15, wherein said apparatus trains one of said arrays of resistive memory devices at a time. 22. The apparatus of claim 21, wherein said apparatus applies a group of programming signals to all said rows of said one said column of said arrays of resistive memory devices. 23. The apparatus of claim 22, wherein the amplitude and polarity of said programming signals applied to a particular column is determined by said detected error corresponding to said column. 24. The method of claim 23, wherein for a first of said arrays of resistive memory devices, said programming signal is a currently selected training pattern when said error detection output is 1; otherwise said programming signal is its element-wise negated version when said error detection output is −1. 25. The apparatus of claim 24, wherein said programming signal for a first of said arrays of resistive memory devices has an opposite polarity from a programming signal for a second of said arrays of resistive memory devices. 26. The apparatus of claim 25, wherein for said second of said arrays of resistive memory devices, said programming signal is a currently selected training pattern when said error detection output is −1; otherwise said programing signal is its element-wise negated version when said error detection output is 1. 27. The apparatus of claim 15, wherein said resistive memory devices comprise memristors. 28. The apparatus of claim 27, wherein said voltage of said programming signal is greater than the programming threshold voltage of any said memristor in a column being programmed.