# US 2018/0322392 A1 · Apparatus and method for executing reversal training of artificial neural network

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0322392 A1
- Document ID: US20180322392A1
- Status: Published application
- Kind: A1
- Application number: 16/038,872
- Filed: 2018-07-18
- Published: 2018-11-08
- Earliest claimed: 2016-01-20
- Assignees: Cambricon Technologies Corporation Limited
- Applicants: Cambricon Technologies Corporation Limited
- Inventors: Shaoli Liu; Qi Guo; Yunji Chen; Tianshi Chen
- Web page: https://patentgrep.com/patent/US20180322392A1

## CPC

- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06F 9/22: Microcontrol or microprogram arrangements
- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F 15/17318: {Parallel communications techniques, e.g. gather, scatter, reduce, roadcast, multicast, all to all}
- G06N 3/048: Activation functions
- G06N 3/0499: Feedforward networks
- G06N 3/063: using electronic means
- G06N 3/09: Supervised learning
- G06F 13/28: using burst mode transfer, e.g. direct memory access {DMA}, cycle steal (G06F13/32 takes precedence)
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An apparatus for executing backpropagation of an artificial neural network comprises an instruction caching unit, a controller unit, a direct memory access unit, an interconnection unit, a master computation module, and multiple slave computation modules. For each layer in a multilayer neural network, weighted summation may be performed on input gradient vectors to calculate an output gradient vector of this layer. The output gradient vector may be multiplied by a derivative value of a next-layer activation function on which forward operation is performed, so that a next-layer input gradient vector can be obtained. The input gradient vector may be multiplied by an input neuron counterpoint in forward operation to obtain the gradient of a weight value of this layer, and the weight value of this layer can be updated according to the gradient of the obtained weight value of this layer.

## Claims

### Claim 1

An apparatus for backpropagation of a multilayer neural network, comprising:
a plurality of computation modules connected via an interconnection unit; and
a controller unit configured to decode an instruction into one or more groups of micro-instructions, wherein the one or more groups of micro-instructions respectively control operations of one or more groups of the plurality of computation modules.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the plurality of computation modules further comprise:
a master computation module configured to calculate an input gradient vector based on a first output gradient vector from an adjacent layer; and
multiple slave computation modules configured to parallelly calculate portions of a second output gradient vector based on the input gradient vectors calculated by the master computation module.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the interconnection unit is configured to combine the portions of the second output gradient vector to generate the second output gradient vector.

### Claim 4 (depends on 1)

The apparatus of claim 1, further comprising:
an instruction caching unit configured to store the instruction; and
a direct memory access unit configured to read data from caching units of the computation modules to an external memory device and write data from the external memory device to the caching units of the computation modules.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the controller unit is further configured to:
instruct the master computation module to perform one of the one or more groups of micro-instructions; and
instruct the slave computation modules to perform other groups of the micro-instructions.

### Claim 6 (depends on 2)

The apparatus of claim 2, wherein the slave computation modules are configured to parallelly calculate gradients of weight values based on the input gradient vector; and
update the weight values based on the respectively calculated gradients.

### Claim 7 (depends on 2)

The apparatus of claim 2, wherein the master computation module is further configured to respectively multiply each element of the input gradient vector with a derivative of an activation function of an adjacent layer.

### Claim 8 (depends on 2)

The apparatus of claim 2, wherein each of the slave computation modules further includes a slave neuron caching unit configured to store input data.

### Claim 9 (depends on 3)

The apparatus of claim 3,
wherein the interconnection unit is structured as a binary tree including one or more levels, each of which includes one or more nodes,
wherein each of the nodes at one level is connected to two nodes at a lower level, and
wherein each of the nodes transmits same data to the two nodes at the lower level and combines data received from the two nodes at the lower level.

### Claim 10 (depends on 2)

The apparatus of claim 2, wherein the master computation module includes:
a master neuron caching unit configured to cache data;
a master computation unit configured to receive the first output gradient vector from the interconnection unit; and
a master data dependency relationship determination unit configured to temporarily prevent the instruction from being executed based on a determination that a conflict exists between the instruction and other instructions.

### Claim 11 (depends on 2)

The apparatus of claim 2, wherein each of the slave computation modules includes:
a slave computation unit configured to receive the one or more groups of micro-instructions and to perform arithmetic logical operations; and
a slave data dependency relationship determination unit configured to perform reading/writing operations to a slave neuron caching unit, a weight value caching unit, and a weight gradient caching unit based on a determination that no conflict exists between the reading/writing operations.

### Claim 12 (depends on 1)

The apparatus of claim 1, wherein the instruction is selected from the group consisting of
a CONFIG instruction for configuring constants required by computation of the current layer prior to starting computation of the artificial neural network of each layer, a COMPUTE instruction for completing arithmetical logic computation of the multilayer neural network of each layer, and
an IO instruction for reading in the input data required by computation from an external address space and storing the data back into the external space after completion of computation.

### Claim 13 (depends on 1)

The apparatus of claim 1, wherein at least one of the computation modules, the controller unit, the instruction caching unit, the direct memory access is an application-specific integrated circuit.

### Claim 14

A method for backpropagation of a multilayer neural network, comprising:
receiving, by a controller unit, an instruction;
decoding, by the controller unit, the instruction into one or more groups of micro-instructions; and
assigning, by the controller unit, the one or more groups of micro-instructions respectively to a plurality of computation modules.

### Claim 15 (depends on 14)

The method of claim 14, further comprising:
calculating, by a master computation module of the plurality of computation modules, an input gradient vector based on a first output gradient vector from an adjacent layer; and
parallelly calculating, by multiple slave computation modules of the plurality of computation modules, portions of a second output gradient vector based on the input gradient vector calculated by the master computation module.

### Claim 16 (depends on 15)

The method of claim 15, further comprising:
combining, by an interconnection unit that communicates with the plurality of computation modules, the portions of the second output gradient vector to generate the second output gradient vector.

### Claim 17 (depends on 14)

The method of claim 14, further comprising:
storing, by an instruction caching unit, the instruction;
reading, by a direct memory access unit, data from caching units of the computation modules to external memory devices; and
writing, by the direct memory access unit, from the external memory devices to the caching units of the computation modules.

### Claim 18 (depends on 15)

The method of claim 15, further comprising:
instructing, by the controller unit, the master computation module to perform one of the one or more groups of micro-instructions; and
instructing, by the controller unit, the slave computation modules to perform other groups of the micro-instructions.

### Claim 19 (depends on 15)

The method of claim 15, further comprising:
parallelly calculating, by the slave computation modules, gradients of weight values based on the input gradient vector; and
updating, by the slave computation modules, the weight values based on the respectively calculated gradients.

### Claim 20 (depends on 15)

The method of claim 15, further comprising:
temporarily preventing, by a master data dependency relationship determination unit of the master computation module, the instruction from being executed based on a determination that a conflict exists between the received instruction and other instructions.
