# US 2019/0318246 A1 · Computation method

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

- Number: US 2019/0318246 A1
- Document ID: US20190318246A1
- Status: Published application
- Kind: A1
- Application number: 16/455,347
- Filed: 2019-06-27
- Published: 2019-10-17
- Earliest claimed: 2016-12-28
- Assignees: Shanghai Cambricon Information Technology Co., Ltd.
- Applicants: Shanghai Cambricon Information Technology Co., Ltd.
- Inventors: Yunji CHEN; Xinkai SONG; Shaoli LIU; Tianshi CHEN
- Web page: https://patentgrep.com/patent/US20190318246A1

## CPC

- G06N 3/063: using electronic means
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06F 13/28: using burst mode transfer, e.g. direct memory access {DMA}, cycle steal (G06F13/32 takes precedence)
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/08: Learning methods
- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Aspects of data modification for neural networks are described herein. The aspects may include a connection value generator configured to receive one or more groups of input data and one or more weight values and generate one or more connection values based on the one or more weight values. The aspects may further include a pruning module configured to modify the one or more groups of input data and the one or more weight values based on the connection values. Further still, the aspects may include a computing unit configured to update the one or more weight values and/or calculate one or more input gradients.

## Claims

### Claim 1

A neural network processor, comprising:
a connection value generator of a data modifier configured to:
receive one or more groups of input data and one or more weight values,
generate one or more connection values based on the one or more weight values; and
a pruning module of the data modifier configured to modify the one or more groups of input data and the one or more weight values based on the connection values.

### Claim 2 (depends on 1)

The neural network processor of claim 1, further comprising a computing unit configured to:
multiply one or more output gradients with the modified input data to generate one or more weight differences, and
subtract the one or more weight differences from the one or more modified weight values to generate one or more updated weight values.

### Claim 3 (depends on 2)

The neural network processor of claim 2,
wherein the data modifier is connected to a memory and a direct memory access (DMA) module,
wherein the data modifier is configured to store the one or more output gradients and the modified input data in the memory, and
wherein the computing unit is further configured to store the output gradients and the modified input data respectively in a weight cache and a data cache.

### Claim 4 (depends on 2)

The neural network processor of claim 2, wherein the computing unit is further configured to:
multiply the one or more output gradients with the one or more modified weight values to generate one or more multiplication results,
add the one or more multiplication results to generate an intermediate sum,
multiply the intermediate sum with a learning rate to generate an intermediate multiplication result, and
apply a derivative of an activation function to the intermediate multiplication result to generate one or more input gradients.

### Claim 5 (depends on 4)

The neural network processor of claim 4,
wherein the data modifier is connected to a memory and a direct memory access (DMA) module,
wherein the data modifier is configured to store the modified weight values and the one or more output gradients in the memory, and
wherein the computing unit is further configured to:
read the modified weight values and the one or more output gradients from the memory in response to an instruction received from a controller, and
store the one or more output gradients and the weight values respectively in a weight cache and a data cache.

### Claim 6 (depends on 1)

The neural network processor of claim 1, further comprising a computing unit configured to respectively multiply the modified groups of input data with the modified weight values to generate one or more groups of output data.

### Claim 7 (depends on 1)

The neural network processor of claim 1,
wherein the data modifier is connected to a weight cache and a data cache, and
wherein the data modifier is configured to store the modified weight values and the modified input data respectively in the weight cache and the data cache.

### Claim 8 (depends on 1)

The neural network processor of claim 1, wherein one or more of the connection values are generated as zero when absolute values of the weight values that correspond to the one or more of the connection values are less than or equal to a first threshold value.

### Claim 9 (depends on 1)

The neural network processor of claim 1, wherein one or more of the connection values are generated as one when absolute values of the weight values that correspond to the one or more of the connection values are greater than or equal to a second threshold value.

### Claim 10 (depends on 1)

The neural network processor of claim 1, wherein the connection values are respectively generated based on a distance between input nodes corresponding to the one or more groups of input data.

### Claim 11

A method for modifying data for neural networks, comprising:
receiving, by a connection value generator of a data modifier, one or more groups of input data and one or more weight values;
generating, by the connection value generator of the data modifier, one or more connection values based on the one or more weight values; and
modifying, by a pruning module of the data modifier, the one or more groups of input data and the one or more weight values based on the connection values.

### Claim 12 (depends on 11)

The method of claim 11, further comprising
multiplying, by a computing unit, the one or more output gradients with the modified input data to generate one or more weight differences; and
subtracting, by the computing unit, the one or more weight differences from the one or more modified weight values to generate one or more updated weight values.

### Claim 13 (depends on 12)

The method of claim 12, further comprising:
storing, by the data modifier, the one or more output gradients and the modified input data in a memory, wherein the data modifier is connected to the memory and a direct memory access (DMA) module, and
storing, by the computing unit, the output gradients and the modified input data respectively in a weight cache and a data cache.

### Claim 14 (depends on 12)

The method of claim 12, further comprising:
multiplying, by the computing unit, the one or more output gradients with the one or more modified weight values to generate one or more multiplication results,
adding, by the computing unit, the one or more multiplication results to generate an intermediate sum,
multiplying, by the computing unit, the intermediate sum with a learning rate to generate an intermediate multiplication result, and
applying, by the computing unit, a derivative of an activation function to the intermediate multiplication result to generate the one or more input gradients.

### Claim 15 (depends on 14)

The method of claim 14, further comprising:
storing, by the data modifier, the modified weight values and the one or more output gradients in a memory, wherein the data modifier is connected to the memory and a direct memory access (DMA) module,
reading, by the computing unit, the modified weight values and the one or more output gradients from the memory in response to an instruction received from a controller, and
storing, by the computing unit, the one or more output gradients and the weight values respectively in a weight cache and a data cache.

### Claim 16 (depends on 11)

The method of claim 11, further comprising multiplying, by a computing unit, the modified groups of input data with the modified weight values respectively to generate one or more groups of output data.

### Claim 17 (depends on 11)

The method of claim 11, further comprising storing, by the data modifier, the modified weight values and the modified input data respectively in a weight cache and a data cache, wherein the data modifier is directly connected to the weight cache and the data cache.

### Claim 18 (depends on 11)

The method of claim 11, further comprising generating, by the connection value generator, one or more of the connection values as zero when absolute values of the weight values that correspond to the one or more of the connection values are less than or equal to a first threshold value.

### Claim 19 (depends on 11)

The method of claim 11, further comprising generating, by the connection value generator, one or more of the connection values as one when absolute values of the weight values that correspond to the one or more of the connection values are greater than or equal to a second threshold value.

### Claim 20 (depends on 11)

The method of claim 11, further comprising generating, by the connection value generator, based on a distance between input nodes corresponding to the one or more groups of input data.

### Claim 21

A neural network processor for training neural networks, comprising:
a connection value generator of a data modifier configured to:
receive one or more groups of input data and one or more weight values at one or more input nodes of a current layer,
generate one or more connection values based on the one or more weight values;
a pruning module of the data modifier configured to modify the one or more groups of input data and the one or more weight values based on the connection values; and
a computing unit configured to:
update the one or more modified weight values of the current layer based on the modified input data and one or more output gradients received at one or more output nodes of the current layer from a next layer,
calculate one or more input gradients of the current layer based on the modified weight values and the one or more output gradients, and
respectively multiply the modified input data with the modified weight values to generate one or more groups of output data at the one or more output nodes of the current layer.

### Claim 22 (depends on 21)

The neural network processor of claim 21,
wherein the data modifier is connected to a memory and a direct memory access (DMA) module,
wherein the data modifier is configured to store the one or more output gradients received at the one or more output nodes from the next layer and the modified input data in the memory, and
wherein the computing unit is further configured to store the output gradients and the modified input data respectively in a weight cache and a data cache.

### Claim 23 (depends on 21)

The neural network processor of claim 21,
wherein the data modifier is connected to a memory and a direct memory access (DMA) module,
wherein the data modifier is configured to store the modified weight values and the one or more output gradients in the memory, and
wherein the computing unit is further configured to:
read the modified weight values and the one or more output gradients from the memory in response to an instruction received from a controller, and
store the one or more output gradients and the weight values respectively in a weight cache and a data cache.
