A neuromorphic device comprising a neural network,
- the neural network including:
- an input layer,
- a hidden layer,
- an output layer,
- a first multiply and accumulate calculation device that performs calculation for the hidden layer, and
- a second multiply and accumulate calculation device that performs calculation for the output layer,
- wherein each of the first multiply and accumulate calculation device and the second multiply and accumulate calculation device comprises:
- a variable resistor array having a plurality of variable resistance elements;
- a first reference array of resistors including a reference column having a reference resistance element having a fixed resistance value;
- a second reference array of resistors including a reference row having a reference resistance element having a fixed resistance value;
- a first input signal generator connected to an input side of the variable resistor array, and configured to generate a first input signal from input data, and input the first input signal to the plurality of variable resistance elements and the reference resistance elements of the reference column;
- a first sensor connected to an output side of the variable resistor array, and configured to detect a current flowing through the variable resistor array, based on the first input signal applied to the plurality of variable resistance elements, and output to a first correction calculation circuit;
- a second sensor connected to the output side of the variable resistor array, and configured to detect a current flowing through the first reference array of resistors, based on the first input signal applied to the reference resistance elements of the reference column, and output to the first correction calculation circuit;
- a second input signal generator connected to the output side of the variable resistor array, and configured to generate a second input signal from input data, and input the second input signal to the plurality of variable resistance elements and the reference resistance elements of the reference row;
- a third sensor connected to the input side of the variable resistor array, and configured to detect a current flowing through the variable resistor array, based on the second input signal applied to the plurality of variable resistance elements, and output to a second correction calculation circuit;
- a fourth sensor connected to the input side of the variable resistor array, and configured to detect a current flowing through the second reference array of resistors, based on the second input signal applied to the reference resistance elements of the reference row;
- a first correction calculation circuit configured to perform a predetermined calculation on the output from the first sensor, based on the output from the second sensor;
- a second correction calculation circuit configured to perform a predetermined calculation on the output from the third sensor, based on the output from the fourth sensor;
- a first switch connected to the input side of the variable resistor array, and configured to switch between an input from the first input signal generator and an output to the third sensor;
- and
- a second switch connected to the output side of the variable resistor array, and configured to switch between an input from the second input signal generator and an output to the first sensor,
- wherein when a forward operation is performed, the first switch and the second switch are activated, and the first input signal generator generates a first input signal from input data and inputs the first input signal to the plurality of variable resistance elements and the reference resistance elements of the reference column, and
- when a backward operation is performed, the first switch and the second switch are activated, and the second input signal generator generates a second input signal from input data and inputs the second input signal to the plurality of variable resistance elements and the reference resistance elements of the reference row.