# US 2022/0067491 A1 · Bayesian network in memory

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

- Number: US 2022/0067491 A1
- Document ID: US20220067491A1
- Status: Published application
- Kind: A1
- Application number: 17/006,602
- Filed: 2020-08-28
- Published: 2022-03-03
- Earliest claimed: 2020-08-28
- Assignees: Micron Technology, Inc.
- Applicants: Micron Technology, Inc.
- Inventors: Dmitry Vengertsev; Stewart R. Watson; Jing Gong; Ameya Parab
- Web page: https://patentgrep.com/patent/US20220067491A1

## CPC

- G06N 3/063: using electronic means
- G06N 3/047: Probabilistic or stochastic networks
- G06N 3/0499: Feedforward networks
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/09: Supervised learning
- G06N 5/046: Forward inferencing; Production systems
- G06N 7/01: Probabilistic graphical models, e.g. probabilistic networks
- G11C 11/401: forming cells needing refreshing or charge regeneration, i.e. dynamic cells
- G11C 11/41: forming {static} cells with positive feedback, i.e. cells not needing refreshing or charge regeneration, e.g. bistable multivibrator or Schmitt trigger
- G11C 11/54: using elements simulating biological cells, e.g. neuron
- G11C 13/0009: {RRAM elements whose operation depends upon chemical change}
- G11C 13/004: {Reading or sensing circuits or methods}
- G11C 13/0069: {Writing or programming circuits or methods}
- G11C 16/10: Programming or data input circuits
- G11C 16/26: Sensing or reading circuits; Data output circuits
- H03M 1/36: simultaneously only, i.e. parallel type
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G11C: STATIC STORES (semiconductor memory devices H10B)
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

Apparatuses and methods can be related to implementing a Bayesian neural network in a memory. A Bayesian neural network can be implemented utilizing a resistive memory array. The memory array can comprise programmable memory cells that can be programed and used to store weights of the Bayesian neural network and perform operations consistent with the Bayesian neural network.

## Claims

### Claim 1

An apparatus, comprising:
a memory array;
a controller coupled to the memory array and configured to:
read data from a first plurality of memory cells of the memory array;
generate, using a second plurality of memory cells of the memory array, a first plurality of weight values and a first plurality of bias values based on a plurality of deterministic values read from the first plurality of memory cells;
generate, using a third plurality of memory cells of the memory array, a second plurality of weight values and a second plurality of bias values based on the first plurality of weight values and the second plurality of bias values; and
transmit output data from a fourth plurality of memory cells of the memory array, the output data comprising a result and a confidence in the result that is based at least on:
an input provided by a host,
the second plurality of weight values, and
the second plurality of bias values of a Bayesian neural network.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the deterministic values comprise a weight mean, a weight standard deviation, a bias mean, and a bias standard deviation of a plurality of layers, implemented in the memory array, of the Bayesian neural network.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the controller is further configured to:
access the plurality of deterministic values, generate the first plurality of weight values and the first plurality of bias values, generate the second plurality of weight values and the second plurality of bias values, and determine the result and the confidence in the result utilizing a plurality of banks;
wherein the plurality of banks comprise the first plurality of memory cells, the second plurality of memory cells, the third plurality of memory cells, and the fourth plurality of memory cells.

### Claim 4 (depends on 3)

The apparatus of claim 3, wherein:
the first plurality of memory cells comprises a first bank, the second plurality of memory cells comprises a second bank, third plurality of memory cells comprises a third bank, and the fourth plurality of memory cells comprises a fourth bank; and
the first bank, the second bank, the third bank, and the fourth bank comprise a layer of the Bayesian neural network.

### Claim 5 (depends on 3)

The apparatus of claim 3, wherein:
the first plurality of memory cells, the second plurality of memory cells, and the third plurality of memory cells comprise a first bank and the fourth plurality of memory cells comprises a second bank; and
the first bank and the second bank comprise a layer of the Bayesian neural network.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the controller is further configured to sample the first plurality of weight values, the first plurality of bias values, the second plurality of weight values, and the second plurality of bias values of the Bayesian neural network utilizing a number of Bayesian pulse generators coupled to the memory array.

### Claim 7 (depends on 6)

The apparatus of claim 6, wherein the controller is further configured to sample the first plurality of weight values and the first plurality of bias values of the Bayesian neural network utilizing a first stochastic pulse generator of the number of stochastic pulse generators and a second plurality of weight values of the Bayesian neural network utilizing a second stochastic pulse generator of the number of stochastic pulse generators.

### Claim 8 (depends on 6)

The apparatus of claim 6, wherein the controller is configured to control the number of stochastic pulse generators to:
provide a first plurality of voltage pulses to a first plurality of signal lines to which the second plurality of memory cells are coupled to sample the first plurality of weight values and the first plurality of bias values; and
provide a second plurality of voltage pulses to a second plurality of signal lines to which the third plurality of memory cells are coupled to sample the second plurality of weight values and the second plurality of bias values.

### Claim 9 (depends on 8)

The apparatus of claim 8, wherein:
the first plurality of voltage pulses cause a first plurality of currents to be emitted from the second plurality of memory cells based on a resistance of the second plurality of memory cells; and
the second plurality of voltage pulses cause a second plurality of currents to be emitted from the third plurality of memory cells based on a resistance of the third plurality of memory cells.

### Claim 10 (depends on 9)

The apparatus of claim 9, wherein the second plurality of memory cells are coupled to a first plurality of different signal lines;
wherein the third plurality of memory cells are coupled to a second plurality of different signal lines; and
wherein the controller is further configured to control the memory array to:
provide the first plurality of currents via the first plurality of different signal lines to an analog-to-digital converter, wherein the first plurality of currents represent the first plurality of weight values and the first plurality of bias values; and
provide the second plurality of currents via the second plurality of different signal lines to a different analog-to-digital converter, wherein the second plurality of currents represent the second plurality of weight values and the second plurality of bias values of the Bayesian neural network.

### Claim 11 (depends on 10)

The apparatus of claim 10, wherein the controller is further configured to:
generate, utilizing the analog-to-digital converter, a first plurality of output voltages corresponding to the first plurality of currents;
generate, utilizing the different analog-to-digital converter, a second plurality of output voltages corresponding to the second plurality of currents, wherein the second plurality of output voltages represent the second plurality of weight values and the second plurality of bias values that are sampled.

### Claim 12 (depends on 11)

The apparatus of claim 11, further comprising a plurality of registers and wherein the controller is further configured to:
store a first plurality of values corresponding to the first plurality of output voltages and a second plurality of values corresponding to the second plurality of output voltages in the plurality of registers to make the first plurality of values and the second plurality of values available to the different stochastic pulse generator and the fourth plurality of memory cells.

### Claim 13

A method, comprising:
providing a first data comprising a first partial derivative of a first loss function of a training set and a plurality of parameters to a first bank of a memory device, wherein the first loss function corresponds to a layer of a Bayesian neural network;
utilizing the first bank to generate a second data, comprising a second partial derivative of a second loss function of a plurality of weights and the plurality of parameter, responsive to receipt of the data comprising the first partial derivative;
utilizing the second bank to generate a third data comprising a third partial derivative of the second loss function, wherein the third data is generated using the second data;
utilizing the second bank to generate a fourth data comprising a fourth partial derivative of the second loss function, wherein the fourth data is generated using the second data; and
writing, to another portion of the memory device, updated weight values of the layer of the Bayesian neural network based at least in part on the third data comprising the third partial derivative and the fourth data comprising the fourth partial derivative.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
generating the first loss function at one of a controller of the memory device and a third bank of the memory device; and
wherein the first loss function provides a measure of the divergence between a variational posterior, a prior, and a measure of fit between the plurality of weights and the training data of the Bayesian neural network.

### Claim 15 (depends on 14)

The method of claim 14, further comprising generating the variational posterior and the prior in different banks of the memory device.

### Claim 16 (depends on 13)

The method of claim 13, further comprising storing the second data comprising the second partial derivative in a first plurality of registers of the memory device to make the second partial derivative available to the second bank and available for updating the plurality of deterministic values of the Bayesian neural network.

### Claim 17 (depends on 16)

The method of claim 16, further comprising storing the third data comprising the third partial derivative and the fourth data comprising the fourth partial derivative in a second plurality of registers to make the third partial derivative and the fourth partial derivative available for updating the plurality of deterministic values of the Bayesian neural network.

### Claim 18

A system, comprising:
a memory device;
a plurality of registers;
a controller coupled to the memory device and the plurality of registers and configured to:
access a first data representing a first partial derivative of a loss function of a Bayesian neural network from the plurality of registers;
access a second data representing a second partial derivative of the loss function from the plurality of registers;
access a third data representing a third partial derivative of the loss function from the plurality of registers; and
update a resistance of the plurality of memory cells, to store an updated plurality of deterministic values, utilizing the first data, the second data, and the third data.

### Claim 19 (depends on 18)

The system of claim 18, wherein the controller configured to update the resistance of the plurality of memory cells is further configured to:
apply a first plurality of voltages corresponding to the first partial derivative and the second partial derivative to a first plurality of signal lines; and
apply a second plurality of voltages corresponding to the third partial derivative to a second plurality of signal lines, wherein the each of the plurality of memory cells are coupled to respective ones of the first plurality of signal lines and the second plurality of signal lines and wherein applying the first plurality of voltage sand the second plurality of voltage updates the resistance of the plurality of memory cells.

### Claim 20 (depends on 18)

The system of claim 18, wherein the resistance of the plurality of memory cells represents a plurality of deterministic values of the Bayesian neural network.
