text
stringlengths
128
2.05k
In this paper, we explore the use of MTJ crossbars for the hardware implementation of the synaptic weight matrices of a neural network. We propose the in-situ training of such an MTJ crossbar NN, which allows us to exploit its inherent parallelism for significantly faster training and also accounts for device variation...
2. Background In this section we describe the basics of neural networks and the parallelism offered by the crossbar architecture, and introduce the characteristics of Magnetic Tunnel Junctions.
2.1. Neural Networks The computation performed by any layer of an NN during the inference (forward propagation) phase basically comprises a matrix-vector multiplication. Say, [MATH] is the input to a layer and [MATH] represents the synaptic weight matrix, then the output [MATH] is
[EQUATION] where f() is an activation function. Training of the NN can be done by backpropagation using the gradient descent optimization method. The weight update of the synapse connecting the [MATH] input to the [MATH] output is given as
[EQUATION] where E is the cost function of the presented input sample [MATH] [MATH] is the learning rate and [MATH] is the error calculated at the [MATH] output using [MATH] and the desired output. It is worth noting that such a weight update is local in nature, in that it depends only on the information available at t...
[EQUATION] The major computational cost of this algorithm comes from the [MATH] complexity of eqns. ( ) and ( ) whose implementation on general-purpose hardware requires time and memory of the same order, thereby not motivating their use for large-scale applications. Fortunately, the nature of computation in eqn. ( ) a...
2.2. The Crossbar Architecture The physical realization of a synaptic weight matrix is possible using the grid-like crossbar structure where each junction has a resistance corresponding to one synapse. Fig LABEL:sub@crossbar_general shows a simplified crossbar with each row corresponding to an input and each column to ...
[EQUATION] which bears similarity to the dot products in ( ). This can then be fed to suitable analog circuits for implementing the activation function.
Since the outputs are obtained almost instantaneously after the inputs are applied, the matrix-vector multiplication of eqn. ( ) is performed in parallel with constant time complexity. As for the update phase, the crossbar resistances can be modified by suitably modeling the required change as the product of 2 physical...
2.3. Magnetic Tunnel Junction The Magnetic Tunnel Junction (MTJ) is a 2-terminal spintronic device consisting primarily of 2 ferromagnetic layers separated by a thin tunnel barrier (typically MgO). The magnetic orientation of one of the magnetic layers is fixed, whereas that of the other is free, as shown in fig LABEL:...
It is possible to switch the state of the MTJ by passing spin-polarized current of appropriate polarity which flips the magnetization of the free layer through the mechanism of spin-transfer torque (et al., 2003 . The time required to switch is heavily dependent on the magnitude of the switching current. Not only that,...
Depending on the magnitude I of the current and the critical current [MATH] (et al., 2016d , the switching probability in the high-speed precessional regime [MATH] is expressed as
[EQUATION] where [MATH] [MATH] is the pulse width, [MATH] is the thermal stability and [MATH] is the mean switching time (which is dependent on [MATH] (et al., 2011
The spin transfer efficiency ( [MATH] ) of an MTJ is different for the 2 switching directions, with [MATH] having a smaller value than [MATH]
(et al., 2012b . This makes [MATH] , which means that the same magnitude and duration of current will correspond to different switching probabilities for the 2 switching directions. Fig. shows the dependence of the switching probability on pulse width and switching current for the [MATH] transition. Observe the similar...
3. MTJ Crossbar based Neural Networks The stochastic switching nature of MTJs has necessitated the usage of high write currents or write duration in memory applications to ensure low write errors. Alternatively, one can also use them to implement the synaptic weights in a crossbar where each cross-point would be an MTJ...
Training Binary Networks: Obtaining optimal binary weights for an NN is an NP-hard problem with an exponential time complexity, and hence a solution must involve training of the binary network of some form. This prompts the use of a probabilistic learning technique since the required weight update is continuous whereas...
In (et al., 2015a , Vincent et al. exploit the stochastic switching behavior of MTJs to propose its use as a ”stochastic memristive synapse” in an SNN taught using a simplified STDP rule. However, there is no theoretical guarantee of the convergence of STDP for general inputs (et al., 2005a . We propose using a probabi...
3.1. The Motivation for In-situ Training There are 2 ways (primarily) in which MTJs in the crossbar can be connected to their respective input and output terminals -
(1) With selector devices (1T1R) - Here each MTJ synapse is connected in series with an MOS transistor (as in fig. LABEL:sub@crossbar_1t1r_general ), resulting in [MATH] transistors in the crossbars.
(2) Without selector devices (1R) - Synapses are directly connected to the crossbar terminals; there are no transistors within the crossbar, such as the one in fig. LABEL:sub@crossbar_general . While a 1R structure provides greater scalability, it does so at the cost of reduced control of and access to individual synap...
Stochastic learning can be done (simulated) offline and the final weights obtained can be programmed on to the crossbar deterministically. But, since MTJs have an inherently stochastic switching behaviour, deterministically programming them on a crossbar would require currents having high magnitude and duration to guar...
3.2. Network Binarization Simply using [MATH] 1 as the binary weight values, represented by the [MATH] and [MATH] states of an MTJ, is naive and estimating a good scaling factor [MATH] is essential for overall network performance. An appropriate way to determine a suitable [MATH] is to minimize the L2 loss between the ...
4. In-situ Training of MTJ Crossbars We first provide a high-level understanding of how an MTJ synaptic crossbar implementing an NN should work. For the sake of simplicity, all operations are described for a single-layer NN and can be easily scaled to multiple layers (more details subsequently). We then illustrate how ...
4.1. Overview of Operations The training process is carried out as follows. Read Phase : Upon receiving a training input [MATH] , the input terminals are applied with voltages [MATH] proportional to [MATH] , whereas the output terminals are maintained at ground potential. Current [MATH] flows through the [MATH] synapse...
Write Phase : Using [MATH] and the desired output, calculate the error [MATH] . Table lists the 4 possible cases of weight update depending on [MATH] and [MATH] . The gradient descent algorithm requires a weight update of the form of eqn. ( ). An appropriate way to realize this, as suggested in (et al., 2007 , is to se...
The process of read and write are carried out for each input sample and repeated for several iterations until convergence is achieved.
4.2. Stochastic Learning of an MTJ Synapse We will now describe how the stochasticity of MTJ switching can be used to perform weight updates with gradient descent method. Just as the weight update in eqn ( ) is a function of 2 variables (the input and the error), the probabilistic switching of MTJs can be controlled by...
We therefore model switching probabilities by a linear mapping of [MATH] and [MATH] to write current [MATH] and duration [MATH] respectively as follows. Usually [MATH] , and henceforth assume for simplicity that [MATH] (can be ensured by normalizing and adjusting with [MATH] ). The pulse width [MATH] is set at a minimu...
[EQUATION] Similarly, the write current ( [MATH] ) would be a minimum of [MATH] and increase linearly with [MATH] as [EQUATION] We now wish to find coefficients [MATH] and [MATH] that yield MTJ switching probabilities ( [MATH] ) close to the desired probabilities of weight update. A certain probability of switching can...
[EQUATION] where [MATH] is a small value. So now even if [MATH] is (as high as) [MATH] [MATH] . In our experiments, we chose [MATH] to be about [MATH]
A symmetric argument holds when [MATH] . For [MATH] , we want [MATH] if [MATH] , (because [MATH] for [MATH] ). But [MATH] should start increasing as soon as [MATH] increases, that is
[EQUATION] Fig shows how well the linear model approximates the required [MATH] switching probabilities (similar curve fitting for [MATH] as well). Table shows the write currents and duration for boundary values of [MATH] and [MATH] and table lists the values of the coefficients in eqns. ( ) and ( ). One could use non-...
Next, we describe the 1T1R and 1R crossbar architectures implementing the NN. We show how these can be trained in-situ using the stochastic learning technique described above.
4.3. The 1T1R Architecture This is the conventional architecture for memory applications where each cell has a selection transistor. One major advantage of being able to selectively turn off certain cells is that it disallows the presence of undesired sneak currents which lead to unnecessary power consumption at a mini...
Fig LABEL:sub@signals_1t1r plots the signals during both the read and write phases. During the read phase ( [MATH] ), all transistors are turned on: [MATH] so that all columns (neuron outputs) are read simultaneously. Inputs [MATH] are provided to their respective input CLs which convert them to read voltages [MATH] . ...
Updating the crossbar: Decide the write currents that should be provided to each input row and the pulse widths for each output column as described in sec. 4.2 . Recall that the former depend on [MATH] and the latter on [MATH] . The direction of the currents would depend on the sign of the desired weight update. Apply ...
For the [MATH] synapse, the write pulse width depends on only [MATH] , and the write current magnitude depends on [MATH] . But the direction of switching depends on the signs of [MATH] and [MATH] (see Table ) and has to be decided by the polarity of current. For eg. two MTJ synapses belonging to the same row but differ...
Since the transistor gate control signals are connected to the output CLs, we can select or deselect a certain column based on information at its respective CL, which is the error [MATH] . We therefore program the crossbar sequentially in 2 stages, with the columns updated in a given stage depending on the signs of [MA...
(1) Phase 1: [MATH] . Update the weights of the columns which had [MATH] . Then, the transistor control signals would be [EQUATION]
And the write voltages applied at the input terminals would be [EQUATION] where [MATH] is the unit step function. (2) Phase 2: [MATH] . Update the weights of those columns which had [MATH] . Here, the signals are opposite to those in phase 1 as shown in fig. LABEL:sub@signals_1t1r
Here [MATH] [MATH] is the voltage applied to switch from P [MATH] AP (AP [MATH] P) and can be obtained using ( ) and [MATH] [MATH] and [MATH] still depend on [MATH] , but for brevity explicit mention will be omitted henceforth. Let MTJs in the crossbar be arranged in a way that positive (negative) current from the [MAT...
Thus we can see that the read and update operations are completed in [MATH] time which is [MATH] . Due to limitations on the scalability of 1T1R architecture, it is worth exploring the feasibility of transistor-less crossbars to achieve even higher density of integration.
4.4. The 1R Architecture Eliminating the need to have an access transistor for every synapse in the crossbar will allow for compact designs having an integration density of about [MATH] device. But the inability to select the synapses to be updated during programming results in leakage currents through alternate paths ...
4.4.1. Two-phase update: Let’s analyze the impact of sneak paths on the 1R crossbar with the 2-phase update strategy used previously. We first demonstrate the presence of sneak paths with a small example. Fig LABEL:sub@sneak_2phase_demo shows a [MATH] crossbar with transistors only at the output terminals (to choose co...
We now state a worst-case scenario for a crossbar with [MATH] inputs. If [MATH] is large, analysis using Kirchhoff’s Current Law shows that the potential difference across an MTJ synapse could go as high as [MATH] . The current through such an MTJ, if in the [MATH] state, is [MATH] and is high enough (recall [MATH] ) t...
It is also necessary to mention an average (expected) case. Here these currents reduce to [MATH] and [MATH] , respectively, which are half of those found previously, but still have some probability of switching MTJs (because these currents are roughly the same as [MATH] and [MATH] ). Thus, chances of unwanted flips of ...
4.4.2. Four-phase Update: The large sneak currents in the 2-phase writing strategy, potentially resulting in false switching, is due to the high potential difference [MATH] between input terminals having different signs of inputs. One simple way to mitigate this issue is to further split the 2 phases of weight update s...
Let us now see how bad the issue of sneak-path leakage is with this strategy. Fig LABEL:sub@sneak_4phase_equiv shows the equivalent circuit for the [MATH] crossbar with the same set of assumptions (only synapses providing alternate current paths are shown). For an [MATH] crossbar, in the worst-case scenario, sneak curr...
4.5. Multi-Layer NNs Multi-layer NNs can be implemented on cascaded crossbars (each representing one layer) with the output of one fed as the input to the next. It is pretty straightforward to implement the backpropagation algorithm on such a structure. Consider a 2-layer NN with weight matrices [MATH] and [MATH] . For...
[EQUATION] If [MATH] is the error of the second layer (output), then that of the first layer (hidden) is [MATH] where [MATH] is the derivative of activation function [MATH] , and [MATH] represents a component-wise product. This operation can be done on the crossbar (of the output layer) itself by reversing the roles of...
For the MTJ crossbar NN we described, during forward propagation, the total duration of the read phase would be [MATH] for an [MATH] -layer NN. Backpropagation of errors to hidden layers would require an extra [MATH] -long read phase for each such layer, during which the error at (the output of) a layer is fed as an in...
Further, it must be mentioned that a large layer in an NN could be split into multiple crossbars, some of which which share inputs or outputs. All these crossbars can still be read and written in parallel, thanks to the locality of the weight update operations.
5. Experimental Setup and Results To see how successfully the MTJ crossbar NNs can be trained in-situ, we performed system level simulations by modeling the functionality of the crossbar architecture in MATLAB and training it on some datasets with supervised learning. To capture the MTJ device parameters, we used an HS...
The performance of the neural network was evaluated in the following scenarios (code-named for further reference). All training processes used the Mean Square Error cost function and neurons had the tanh activation function.
(1) RV: We first train and evaluate a neural network with eal- alued weights in MATLAB. Binary quantization step ( [MATH] ) is obtained from this trained network as shown in sec. 3.2
(2) DP: Suitable binary weights are obtained by doing probabilistic learning in software on a binary network. Then a 1T1R crossbar and a 1R crossbar are eterministically rogrammed to these weights. We see the effect of device variations on the former, and of alternate current paths and resulting false switchings on the...
(3) ST: An MTJ synaptic crossbar is modeled and tochastically rained in-situ using the linear model of stochastic weight update described in sec. 4.2 for the
(a) 1T1R architecture, with the 2-phase write strategy (sec. 4.3 ). (b) 1R architecture, with both the 2-phase (to see the effects of sneak currents) and the 4-phase update strategies (sec. 4.4 ).
(4) DV: evice ariations of different extent are introduced in the stochastic training of both the 1T1R and 1R crossbars. It reflects in the variations in the resistance of the [MATH] and [MATH] states, which usually doesn’t exceed [MATH] as per experiments (et al., 2010a
We use the following datasets for evaluation. SONAR, Rocks vs Mines Lichman 2013 : Three different NN architectures are considered - one with 1 layer (1L), and two with 2 layers having 15 and 25 hidden neurons respectively, and named 2L15 and 2L25. They were trained, and then tested on 104 samples of the test dataset.
MNIST Digit Recognition et al. 1998 : Three 2-layer networks of 50, 100 and 150 hidden units respectively and a 3-layer network of 50+25 hidden units were evaluated on the 10000 images of the test dataset.
Wisconsin Breast Cancer (Diagnostic) (WBCD) (Lichman, 2013 : A single-layer network (1L) and 2 two-layer networks (2L10 and 2L20) were considered, and the test dataset had 200 samples.
Table summarizes the accuracy obtained with these networks under the different training scenarios mentioned above. The effect of device variations of different extents on the in-situ stochastic training is highlighted for some of the networks in table , with fig. plotting the mean square error as the training progresse...
It is evident from these results that When an MTJ synaptic crossbar without access transistors is stochastically trained in-situ (ST-1R), it shows classification accuracy only slightly lower (about [MATH] at worst) than when the same network is trained in software with real-valued weights (RV, which can be considered t...
In-situ training also benefits the crossbar with transistors (ST-1T1R against DP-1T1R) in the presence of device variations by slightly improving accuracy (by about [MATH] ).
It is possible to compensate for the loss in accuracy due to use of a binary network by increasing the size of the network (adding more hidden layers and/or neurons).
Further, the trained crossbar has robustness even in the face of device variations, owing primarily to the fault-tolerant nature of NN and its learning algorithms. As can be seen in table , increase in misclassification rates remain within [MATH] even with [MATH] variation.
The accuracy degradation of [MATH] that we achieve (on going from RV to ST) is comparable to the [MATH] reported by (et al., 2016d and the [MATH] in (et al., 2015a . However, it must be mentioned and emphasized that any comparison is fair only if they are on the same dataset and network architecture. The benefit of usi...
6. Conclusion In this work, we show how MTJ crossbars representing weights of an ANN can be trained in-situ by exploiting the stochastic switching properties of MTJs and performing weight updates in a way akin to gradient descent. We demonstrate how the learning algorithm can be implemented on crossbars with and withou...
# Source: arxiv 1806.09318 # Title: Hopf rings for grading and differentials # Sections: all # Downloaded: 2026-03-03T02:41:00.950626+00:00
\amsclass 18E05 16T05, 16T10, 16T15, 16W50, 16E45, \eaddress branko.nikolic@mq.edu.au, ross.street@mq.edu.au Hopf rings for grading and differentials
(2018) Abstract In the category of abelian groups, Pareigis constructed a Hopf ring whose comodules are differential graded abelian groups. We show that this Hopf ring can be obtained by combining grading and differential Hopf rings using semidirect product in fairly general symmetric monoidal additive categories.
keywords: differential graded abelian group, chain complex, Hopf monoid, coalgebra, semidirect product Introduction Chain complexes of abelian groups (also called differential graded abelian groups) form a symmetric monoidal closed category DGAb (explained in detail in Section ) which can be obtained as a category of c...
[MATH] in the symmetric monoidal closed category Ab of abelian groups . DGAb has a full symmetric monoidal closed subcategory GAb, consisting of graded abelian groups seen as complexes with zero differential, which can also be obtained as a category of comodules of a different Hopf ring in Ab.
The main new insight, our first construction, occurs in a braided monoidal additive category [MATH] , begins with an object [MATH] for which the braiding [MATH] is minus the identity morphism of
[MATH] , and produces a Hopf ring structure on the object [MATH] (where [MATH] is the unit for tensor [MATH] ). The second construction imports the additive group of integers [MATH]
into a symmetric monoidal additive category [MATH] by tensoring with the unit to obtain a Hopf ring [MATH] equipped with a braiding coelement [MATH]
The third construction, called bosonization in , is a generalisation of the semidirect product [MATH] of a group [MATH] with a [MATH] -module [MATH] At a very general level
it concerns the question of (co)monadicity of a composite of two (co)monadic functors. We work in any symmetric monoidal category [MATH] (additivity is not needed). Given any (Hopf) bimonoid [MATH] equipped with a braiding coelement [MATH] in [MATH] , the category [MATH] of
[MATH] -comodules becomes braided monoidal (as explained for example in for the case where [MATH] is vector spaces). So the concept of Hopf monoid [MATH] makes sense in [MATH] The semidirect product [MATH] is a Hopf monoid in [MATH] for which
[EQUATION] In Sections and we review the monoidal categories of differential graded and graded abelian groups. Section explains the semidirect product construction. The heart of the paper is Section
where we see the first and second constructions. It culminates by showing that the Pareigis Hopf ring [MATH] is an example of the third construction [MATH]
where [MATH] is obtained by the second construction and [MATH] the first. Differential graded abelian groups The category DGAb (differential graded abelian groups) has chain complexes [MATH] as objects. They are defined by diagrams
[EQUATION] in Ab with group homomorphisms [MATH] satisfying [MATH] An arrow [MATH] , called a chain map, consists of group homomorphisms
[MATH] , indexed by integers, satisfying [EQUATION] DGAb is monoidal with tensor product defined by [EQUATION] The unit is given by [MATH] (Kronecker delta). There is a symmetry
[EQUATION] and a closed structure [EQUATION] The monoidal category DGAb (with direction of arrows in ( ) inverted) can be obtained (see
) as the category of Eilenberg-Moore (EM) coalgebras for the monoidal comonad obtained by tensoring with the Hopf ring [MATH] defined by
[EQUATION] where [MATH] is the comultiplication, [MATH] is the antipode, and corner brackets denote non-commutativity. We will see in the end how this ring can be slightly modified to give the direction of arrows as in ( ). It amounts to exchanging [MATH] and [MATH]
Graded abelian groups The category GAb of graded abelian groups can be seen as a full subcategory of DGAb consisting of chain complexes with all [MATH] GAb inherits a symmetric monoidal closed structure, which follows from ( ) and ( ). On the other hand, there is a forgetful functor [MATH] , with adjoints [MATH]
given by [EQUATION] [MATH] reflects isomorphisms, since [MATH] satisfies ( ) if and only if [MATH] does. The functor [MATH] , having both adjoints, preserves all limits and colimits, in particular [MATH] split equalizers and coequalizers. Hence, [MATH] is both comonadic and monadic (see Chapter 3, Theorem 10 of
where the word “triple” is used for “monad”). There is a functor [MATH] that takes the coproduct (sum) of all components. It has a right adjoint which creates [MATH] copies of each abelian group. The diagram below summarises all relevant adjunctions.
[EQUATION] Both [MATH] and [MATH] are comonads isomorphic to tensoring with a certain Hopf ring in Ab and GAb respectively. In Section we discuss the semidirect product construction in general, and then in section show that the Pareigis biring is the semidirect product of the two birings generating [MATH] and [MATH]
Semidirect product Let [MATH] be the category of comodules for a (Hopf) bimonoid [MATH] in a symmetric monoidal [MATH] For [MATH] to be braided we need [MATH] to have a braiding coelement
[MATH] satisfying the duals of the three axioms at page 58 of , which we quote here in the form we are going to use later (we read the string diagrams from bottom to top):
[EQUATION] [EQUATION] [EQUATION] Explicitly, the braiding of [MATH] and [MATH] is [EQUATION] For an [MATH] -comodule [MATH] define
[EQUATION] Proposition 4.1 If [MATH] is a comonoid in [MATH] , then [MATH] is a distributive law in [MATH] (or equivalently, of the comonad [MATH] over the comonad [MATH] ).
Proof. There are four axioms to check. The two involving counit and comultiplication for [MATH] use the compatibility of counit with the multiplication of [MATH] , and the bimonoid axiom, respectively. The two involving counit and comultiplication for [MATH] follow from the fact that they are [MATH] -comodule morphisms...
Let [MATH] be a bimonoid in [MATH] It automatically inherits a (co)monoid structure in [MATH] by forgetting that (co)unit and (co)multiplication maps are [MATH] -comodule morphisms. Note that, unless [MATH]
[MATH] need not be a bimonoid in [MATH] Definition 4.1 The semidirect product [MATH] of a bimonoid [MATH] in [MATH] and a bimonoid [MATH] in [MATH]