  Resistive memory technologies promise to be a key component in unlocking the
next generation of intelligent in-memory computing systems that can act and
learn locally at the edge. However, current approaches to in-memory machine
learning focus often on the implementation of models and algorithms which
cannot be reconciled with the true, physical properties of resistive memory.
Consequently, these properties, in particular cycle-to-cycle conductance
variability, are considered as non-idealities that require mitigation. Here by
contrast, we embrace these properties by selecting a more appropriate machine
learning model and algorithm. We implement a Markov Chain Monte Carlo sampling
algorithm within a fabricated array of 16,384 devices, configured as a Bayesian
machine learning model. The algorithm is realised in-situ, by exploiting the
devices as random variables from the perspective of their cycle-to-cycle
conductance variability. We train experimentally the memory array to perform an
illustrative supervised learning task as well as a malignant breast tissue
recognition task, achieving an accuracy of 96.3%. Then, using a behavioural
model of resistive memory calibrated on array level measurements, we apply the
same approach to the Cartpole reinforcement learning task. In all cases our
proposed approach outperformed software-based neural network models realised
using an equivalent number of memory elements. This result lays a foundation
for a new path in-memory machine learning, compatible with the true properties
of resistive memory technologies, that can bring localised learning
capabilities to intelligent edge computing systems.
