Abstract
Combining and analyzing efficiently the information incoming from a large number of sensors is essential for developing the Internet of Things. However, today, data incoming from sensors is usually transmitted to external processors for analysis, which is costly in terms of energy. Using nanoscale devices to analyze sensory data would allow building small sensory processing units on the sensor itself. In addition, taking inspiration from biological sensors to build these circuits is a promising route for lowering their energy consumption. Here, we propose an intelligent sensory processor based on nanoscale and stochastic magnetic tunnel junctions emulating populations of sensory neurons. We demonstrate the ability of this system to perform learning, coordinate transformations and sensory fusion through simulations based on an experimentally validated model. Our study shows the feasibility of this intelligent bio-inspired sensory system as well as its robustness to device variability and its low energy consumption, opening the path to experimental realizations.

Our society sees the appearance of connected objects, based on a wide variety of sensors, which collect, transmit and process data to assist us in our daily lives. For fulfilling the entire potential of this "Internet of Things", these objects should become more efficient than current implementations. A critical bottleneck in terms of energy cost is the transfer of information between the sensors and the chips processing their information 1 . An ideal solution would be that the sensors process information themselves. However, with current technologies, this approach is limited by the area of computing circuits 2 : several processing-capable sensors have been designed, but their processing abilities are usually restricted to important features extraction from the sensed signal 3 . Using smaller circuits based on nanoscale devices is an attractive approach: it would allow sensors to perform advanced operations, such as sensor fusion, learning, or even motor control.
To achieve this vision, sensors in the brain are a remarkable source of inspiration 4 : their energy consumption is extremely low, and they closely associate sensing with data processing 5 . An important ingredient of the brain power efficiency is that it operates at the thermal limit, at an optimum tradeoff between low energy and computational reliability 6 . Neurons spike with a given average frequency, but the interval between voltage pulses is highly stochastic 7 . Many theoretical models assume that neurons are Poisson oscillators 8, 9 , with random intervals between each spike (Figure 1(a,b) ). In particular, when a sensory neuron is submitted to a stimulus, its firing frequency varies with the stimulus value 10, 11 . The frequency versus stimulus response, called tuning curve, typically possesses a bell-shape centered on a preferred value of the stimulus (Figure 1(c) ). For example a retina sensory neuron fires more frequently when observing a target at a particular orientation 12 . Sensitivity to the whole range of possible orientations is provided by assemblies of neurons tuned to different orientations. Mathematical frameworks enabling to encode and decode information through the firing frequency of such populations of neurons have been developed 13 , as well as schemes to perform cognitive tasks such as Bayesian inference, sensory fusion, coordinates transformation and transfer of information 13-18. In this context, the implementation of stochastic neurons populations using nanotechnologies such as Mott-insulators 19 and phase-change memories has been recently proposed 20 . However the realization of computations by these devices remains to be explored. The performance of computing tasks by populations of stochastic neurons has been studied both for abstract 15 and CMOS neurons 21 . Yet these works use computationally complex and therefore energy hungry techniques to implement learning. In this article, we propose using nanoscale magnetic tunnel junctions as stochastic neurons. Indeed, the multifunctionality, endurance and CMOS-compatibility of this spintronic device make it a promising candidate for novel forms of computing [22] [23] [24] . In addition, its stochasticity is intrinsic and not linked to difficultly controllable defects. As such, the physics of these stochastic junctions is well understood.
Here, using a model validated through experiments 25, 26 , we first show that stochastic magnetic tunnel junctions can emulate stochastic sensory neurons. We then describe how populations of these stochastic junctions can be organized to build a nanoscale sensory processor inspired from biology. Then, we use the example of a robotic task to demonstrate that this intelligent sensory processor can realize complex computations through a simple learning process, as well as optimally fuse information from different sources.
Stochastic magnetic tunnel junctions as sensory neurons
Magnetic tunnel junctions, schematized in Fig. 1(d) , are composed of two ferromagnets: one with a fixed magnetization and the other with a free magnetization that can be parallel (P) or antiparallel (AP) to the fixed magnet. The resistance of the junction depends on the magnetic state through the tunnel magnetoresistance effect. While large junctions are stable and used as non-volatile memory cells, thermal noise causes small junctions -called superparamagnetic -to oscillate stochastically between the P and AP states 26, 28 . The resulting random resistive switches follow a Poisson process. In our sensory processor, the input to the junction is a voltage that can either be the stimulus to be analyzed itself, or come from another sensor, such as a photodetector. When this voltage is applied across a superparamagnetic tunnel junction, the escape rates of the Poisson process are modified through spin transfer torque (STT) 27, 28 : a positive voltage stabilizes the anti-parallel state while a negative voltage stabilizes the parallel state. As a consequence, the frequency of the stochastic oscillator -defined as the mean number of oscillations per second -varies with the value of the applied voltage, as shown in Fig.  1 (e-f-g). The tuning curve of the junction is bell-shaped and centered on zero voltage ( Fig. 1(h 
where  0 is an attempt time (1 ns), the energy barrier, k B T the thermal energy, V the applied voltage and V c the critical voltage. The frequency is maximum at V = 0, which, in analogy with sensory neurons, means that the junction is tuned to zero voltage. Small junctions have lower energy barriers, and therefore higher maximum frequencies and lower programming energy costs. For that reason, smaller junctions are preferable for computing.
In the brain, a sensor such as the eye is not connected to a single neuron but to an assembly of neurons, called population ( Fig. 1(a) ). All neurons in a population have similar shapes of tuning curves but each of them is tuned to a different orientation of the target. Some studies have suggested that the brain uses this solution to fight variability and cell death 29 . The tuning curves then act as a set of basis functions which cover the wide range of orientations, and can be used to encode information and to perform computations. In order to implement an intelligent spintronic sensory system sensitive to a whole range of voltages, we must design a population of superparamagnetic tunnel junctions in which each junction is tuned to a different voltage value ( Fig. 1(h) ). Therefore the tuning curves of the junctions have to be all shifted differently along the voltage axis. A straightforward solution is to use individual voltage biases or a dedicated electronic circuit. However, we propose here an alternative approach, based on spin-orbit torques 30 . In that case, the junctions should be grown from the free layer to the pinned layer, on top of a heavy metal underlayer with variable width ( Fig. 1(i) ). Choosing carefully the shape of the underlayer then allows shifting differently each junction and building a population of junctions all tuned to different voltages (see Methods). The black curve corresponds to the natural tuning curve of a junction while the green, red, purple and blue curves correspond to biased junctions. The stars on the non-biased curve mark the frequency at -0.1V (orange), 0V (blue) and +0.1V (grey). (i) Schematic of a possible solution to bias the junctions through spin orbit torque. The junctions are positioned on a heavy metal underlayer of variable width in which a current is injected. Spin orbit torque biases the junctions. The stimulus is applied by a voltage common to all junctions, through spin transfer torque.
Learning to catch a target with interconnected assemblies of stochastic junctions
Here we propose to link different populations of stochastic magnetic tunnel junctions to realize sensory processing. We first use the example of the robotic task of Figure 2 (a): a robot observes a target with a visual sensor and attempts to grasp it with a gripper. The sensor and the motor controlling the gripper are each connected to a different population of junctions. The sensory junctions switch with frequencies according to the stimulus received by the visual sensor (i.e. the orientation of the target). On the other hand, the frequencies of the motor junctions control the motor by setting the orientation of the gripper (see Methods). In order to achieve the grasping task, the sensory and motor populations need to be coordinated, even if the sensory and motor populations of junctions differ by their physical properties, or by the total number of junctions. We now demonstrate that the intelligent spintronic sensory processor that we propose can learn this coordination between a sensor and an actuator using methods inspired by neural networks.
Mechanisms to achieve transfer of information from a sensory to a motor neural population and coordinate transformations have been proposed 15, 21, 31, 32 , as well as population coding schemes for learning from sensory information in general 33,34 . However, in this literature, computationally complex learning processes are used, requiring for example to compute the motor neurons frequencies leading to any given gripper orientation 15 . Here we propose a learning mechanism more adapted to hardware constraints. It only requires knowing if the gripper was in the "LEFT", "RIGHT" or "CATCH" zone instead of a precise measurement of the error. Following Salinas and Abbott 15 , we propose to connect the two populations of junctions by a matrix of "synaptic" weights W ij such that the sensory junctions influence the motor junctions through:
where fm i is the frequency of the i-th motor junction and fs j the frequency of the j-th sensory junction. Depending on the value of the weights, different tasks can be realized as we discuss below.
Initially the weights are chosen randomly, so that the orientation of the gripper is disconnected from the orientation of the target. The sensory processor then learns the appropriate weights through supervised training. As the weights are progressively modified, the motor becomes increasingly coordinated with the sensor and allows the gripper to catch the target no matter its orientation. At each learning step the target is presented to the sensor with a randomly chosen orientation. At each attempt to grasp the target ("learning step"), the weights are modified according to the learning rule:
where α is the learning rate.
1) If the gripper succeeds -i.e. if its orientation is close enough to the orientation of the target to be in the "CATCH" zone -the weights are unchanged. 2) If the gripper strikes in the "LEFT" zone, the synaptic weights connecting the sensor network to motor junctions which are tuned to orientations on the left of the gripper are decreased. On the contrary, synaptic weights connecting the sensor network to motor junctions tuned to orientations on the right of the gripper are increased. 3) If the gripper strikes in the "RIGHT" zone, the opposite is implemented.
We perform numerical simulations of this task (see Methods). Figure 2 (b) shows that the distance between the target and the gripper is progressively decreased through repeated learning steps: learning is successful. Here, after 3,000 learning steps the average error is below 1.5% of the range. This corresponds to successfully catching over 90% of the time a target with 5.5° width anywhere within a 180° range. For applications requiring more precision the total number of learning steps should be increased.
In addition, the precision of the sensor is directly linked to the accuracy in determining the junctions' frequencies. Therefore, it is improved when the total number of switching events occurring in the measurement time window increases. As a consequence, larger populations of junctions enable reaching lower gripper-target distances. This is shown through the black stars in Fig. 2 (c): the distance between the target and the gripper decreases when the number of junctions in each network increases. Our simulations also indicate that the precision of the system is essentially set by the total number of junctions used in the circuit, rather than by the size of each population (red circles in Fig. 2(c) ). For the data presented in Figure 2 , the natural frequency is about 23 kHz and the observation length 1 ms. Reducing the size of junctions increases their maximum frequencies and the total number of switching events in the window of observation, thus refining the sensory processing precision (blue squares in Fig.  2(c) ). Finally, precision can also be enhanced by narrowing the tuning curves and observing the junctions switching over a longer period of time. However increasing the observation length increases the energy consumption. For a given sought precision, the required observation length is inversely proportional to the natural frequency of the junctions.
Our system exhibits a strong robustness to device to device variability due to the lithography process: simulations show that up to 4 nm variability on a 10 nm diameter junction can be tolerated without any precision loss (see Figure 2 (d) and Supplementary Information 1), due to the inherent redundancy in the population coding scheme. Similarly, large temperature variations can be tolerated without precision loss as long as the system is calibrated for the bottom of the working temperature range (see Supplementary Information 2). As shown in Figure 3 , the proposed spintronic sensory processor can also learn more complex tasks, such as transformations of coordinates. It can perform computations such as the square, the inverse and the sine of the stimulus with an excellent precision. It can also convert information incoming in polar coordinates from two sensors into Cartesian coordinates (see Methods). More details can be found in Supplementary Information 3. 
Sensory fusion
The Internet-of-things will feature numerous types of sensors, making it essential to perform sensory fusion: collect data from various sensors and merge them optimally to obtain as trustable information as possible. We now show that the spintronic device that we propose can perform such fusion of information. We take the example of a robot receiving information from both visual and auditory sensors. In that case, as illustrated in Fig. 4(a) , each sensor is connected to a different population of stochastic magnetic tunnel junctions. Because the sensors have a finite precision and process real-world noisy data, they each perceive a slightly different orientation and therefore a different voltage stimulus is applied to each population of junctions.
In a neuroscience study, Pouget et al have shown theoretically how optimal fusion of identical populations of Poisson neurons can be realized 13 . Here, we extend this concept and propose to use learning in order to perform sensory fusion of non-identical populations of different sizes, containing elements with different tuning curves. Learning enables to transfer information from the two different sensory networks to two identical networks which are then fused into the motor network (Figure 4(a) ). The theoretical voltage V th resulting from optimal sensory fusion is an average of the stimuli V vs and V as received by the visual and auditory sensors 13 : , where N vs (N as ) is the number of junctions in the visual (auditory) sensor and F vs (F as ) is the maximal frequency of the visual (auditory) junctions. Figure 4 (b) shows how the distance between the gripper and the optimal fusion result decreases when increasing the number of junctions in the networks. Near optimal fusion is achieved by our intelligent sensor (for a hundred junctions in each sensor the error is about 1.1% of the range). We observe that sensory fusion (blue squares) gives a lower error than the single sensor case (black stars): an additional sensor collects more information about the stimulus and increases the precision. Figure 4(c) shows that the intelligent sensory processor also enables the fusion of two sensors with different features. Grey triangles show the fusion of sensory populations with different numbers of junctions while keeping the total number of junctions (and therefore the precision) constant. Red triangles show that increasing the junctions' frequencies in one of the sensory populations increases the overall precision. 
Each sensory network receives a different voltage. Learning is performed for each sensor in the same way as in the single sensor case. The two resulting motor networks are identical.
Sensory fusion of the two identical populations of motor superparamagnetic tunnel junctions is then achieved as follows 13 . The motor junctions are paired two by two according to their preferred stimuli. A third identical population is constructed: each node corresponds to a pair of junctions from the initial populations. For each node of the third population, the number of switches is the sum of the numbers of switches of the two corresponding junctions. The third motor population is then decoded as described previously to give an orientation to the gripper.
Implementation
Building this intelligent sensory processor system able of learning, signal transformation and fusion requires implementing the synaptic weights in hardware. This can be done with larger stable magnetic tunnel junctions, used as non-volatile memory cells as in magnetic random access memories (MRAMs). This would allow using the same magnetic stack for neurons and synapses. Our simulations indicate that only 8 bits per synapse (1 bit of sign, 7 of value) are sufficient to achieve the same precision as analog weights. For a hundred junctions in each of the sensor and motor populations, this amounts to a total of 80,200 magnetic tunnel junctions. As hybrid spintronic-CMOS memory chips composed of millions of magnetic tunnel junctions are already commercialized 35 , this number is very reasonable. In the future, synaptic weights can also be implemented using magnetic memristors 36 , which opens the possibility of using unsupervised learning schemes.
The stochastic magnetic tunnel junctions' populations can be realized with superparamagnetic junctions with an area of typically hundred nanometer squares. This is small compared to CMOS neurons which are larger than a hundred micrometer squares 37 . As we have seen in Fig. 2(c) , having a hundred stochastic junctions in each population (sensory and motor) allows reaching a reasonable precision of processing most of the time. As detailed in Methods, we estimate that the energy consumption for analyzing a given stimulus with a population of a hundred scaled down junctions can be as small as 60 pJ.
In addition, implementing the proposed spintronic sensory processor requires limited CMOS overhead: linking the frequencies of the motor junction to the frequencies of the sensory junctions according to (2) , and modifying the weights according to (3) . In particular, the computation of the junctions' frequencies can be realized using binary count-up counters, and the learning rule with simple integer addition circuits.
Perspectives
In this article, we have proposed an intelligent sensory processor system composed of interconnected populations of stochastic magnetic tunnel junctions imitating sensory neural assemblies. We have demonstrated its ability to learn the realization of complex tasks, such as data transformations and sensory fusion. We have chosen the example of a robotic task as means of illustration but the method we propose can be adapted to much more complex contexts, and a wide range of situations such as vision or olfaction. It can also be easily extended to the fusion of data incoming from more than two different sensors.
The perspectives of this work are to realize in hardware this intelligent bioinspired sensory processor system. We have shown here the technical feasibility of an implementation, which now opens the path to integrate this nanoscale circuit close to a sensor, on the same chip. In addition, in order to propose a realistic system, we have been led to developing simpler methods than existing ones for realizing learning and fusion with diverse populations of spiking units. In particular, we have proved the efficiency of a simple learning rule (Eq. 3) for realizing complex tasks. We have shown that optimal sensory fusion is possible even between populations of different sizes and comprising elements with different features. These findings apply well beyond the case of stochastic magnetic junction assemblies, and will be useful for building hardware leveraging population coding in assemblies of CMOS or any type of emerging technology neurons [19] [20] [21] .
34.
Sugiarto, I. & Conradt, J. Discrete belief propagation network using population coding and factor graph for kinematic control of a mobile robot. in 136-140 (IEEE, 2013 
METHODS

Orientation of the target
The target has a range of possible orientations, corresponding to different voltage stimuli. The voltage range is here from -1 V to +1 V for the simple learning case.
Population of superparamagnetic tunnel junctions
We consider superparamagnetic tunnel junctions with in-plane magnetization. Their default parameters are (where is the energy barrier, k B is the Boltzmann constant, T is the temperature) and V c = 0.7 V (the critical voltage). This corresponds to a diameter of 10 nm and a maximal frequency of 23 kHz.
Each junction has a different bias which corresponds to its preferred stimulus. The preferred stimuli are here chosen linearly spaced on the voltage range.
Using the Spin-Orbit torque to bias the junctions
In that case, the junctions should be grown from the free layer to the pinned layer, on top of a heavy metal underlayer with variable width, as shown in Fig. 1(i) . When a current I SOT is injected in the underlayer, spin-orbit torques influence the magnetization of the free layer and modify the spin transfer term in the expression of the switching rates 30 . This is equivalent to biasing the tuning curve with a voltage proportional to the current density in the metallic layer. As the width of the metallic layer is different for each junction, the effective bias is different. The frequency of a junction located above an underlayer of width w is:
, In this expression, V STT is the voltage stimulus, applied through a common voltage to all the junctions. V c is the critical voltage linked to spin transfer torque, d is the diameter of the junction, t j is the thickness of its free layer and I c is the critical current linked to spin orbit torque. Through spin orbit torque, the injected current in the underlayer I SOT induces a shift of the tuning curve F(V,w), which depends on the width w of the heavy metal underlayer and its thickness t u . Choosing carefully the shape of the heavy metal underlayer can then allow shifting differently the different junctions located on top and building a population of junctions all tuned to different voltages.
Sensing by the sensory junctions
When the sensor observes the target, a voltage V is applied to the superparamagnetic tunnel junctions. The escape rates of each state are modified:
Where is the attempt frequency and V 0 is the preferred stimulus which is different for each junction. The probabilities for the junctions to switch during an interval dt are:
The numerical simulations are run as follows. At every time step dt=10 -5 s and for each junction the probability to switch state is computed and a random number is generated to decide if the switch occurs. After 100 time steps, the frequency of each junction is computed 25 .
Orientation of motion given by the motor junctions
The number of switches for each motor junction is computed. This is decoded into the orientation given to the motor through a standard population coding technique 13 : ∑ ∑ Where V is the voltage corresponding to the decoded orientation, f i is the observed frequency of the i-th junction and V 0i is the voltage for which the frequency of the i-th junction is maximal.
Learning rate
Low values of  slow down the learning while high values of  fasten the learning but limit its performance. Here we found  = 0.01 appropriate.
Error for the single sensor case
The error is the absolute value of the difference between the orientation of the target and the orientation given by the motor junctions to the gripper. It is expressed as a percentage of the range of possible orientations (here from -1 V to +1 V). It is computed as an average over 50 randomly chosen trials.
1-dimension coordinate transformations
The task is performed in the same way as in the catching target case, with the orientation of the target being replaced by the result of the transformation operation. The distance gripper-target is computed as the absolute difference between the expected value of the transformation and the numerically computed value. It is expressed as a percentage of the range of possible expected values. For "z": the stimulus range is -1 to +1V and the result range -1 to +1 V. For "2z": the stimulus range is -1 to +1V and the result range -2 to +2 V. For "z^2": the stimulus range is -1 to +1V and the result range 0 to +1 V. For "1/z": the stimulus range is +0.5 to +1V and the result range is +1 to +2 V. For "sin(z)" the stimulus range is 0 to +1.5 V and the result range 0 to +1 V.
2-dimensions coordinate transformations
The stimulus ranges are 0 to 1V for R and 0 to 1.5V for φ. The range for both x and y is 0 to 1V. Four populations of junctions encode the four coordinates R, φ, x and y.
The two sensory populations R and φ are concatenated into a single population. Its number of junctions is the sum of the number of junctions in each population N s = N R + N φ . Two weights matrices (W x and W y ) connect the sensory (R, φ) to the motor junctions (x, y). The weights matrices W x and W y have the dimensions N x × N s and N y × N s . Where N x (N y ) is the number of junction encoding x (y). Learning of the weights is implemented as described previously.
The distance gripper-target is computed as the absolute 2D-distance between the target and the gripper and is expressed as a percentage of the range for x and y.
Error in the sensory fusion case
The error is the distance between the gripper and the result of the optimal sensory fusion. It is computed as an average over 100 randomly chosen trials where the two voltages applied to the sensors are kept separated by less than 0.4 V.
Power/energy consumption
We suppose junctions of parameters and V c = 0.1 V, shifted by individual voltage biases between -0.1 V and 0.1 V. This corresponds to a natural frequency of 1.23 MHz.
The power consumption due to the shifting is ∑ Where N = 100 is the number of junctions, V shift is the maximal firing voltage for the i-th junction and R is the resistance of the junctions.
For a RA = 20 µOhm×cm 2 and a d= 7.7 nm diameter the resistance is R = 424 kOhm. The power consumption is P shift = 0.8 µW. The maximal power consumption for the stimulus is P stim = N × 0.1 2 / R = 2.4 µW. So the total power is P = 3.2 µW. For a 20 microseconds measurement the energy consumption is E = 63 pJ.
We consider the variability on the junctions' diameter. The energy barrier is proportional to the surface of the elliptic base of the junction. In consequence it is proportional to the square of the diameter of the junction:
. This enables us to compute the variability on the energy barrier as a function of the variability on the diameter of the junction. The variability on the energy barrier has a uniform distribution between and . The average frequency of a junction is:
Therefore, the average frequency < F > is higher than the theoretical frequency F 0 . The blue circles curve in Figure S1 shows the distance between the gripper and the target versus the variability on the diameter of the junctions. The theoretical diameter is 10 nm. The error decreases until about 3 nm variability. Variability on the size of the junctions increases the average maximal frequency of the population and thus increases the precision. Above 5 nm, mismatch between the expected theoretical tuning curves and the observed tuning curve is too important so the precision is worse than without variability.
In the case where the shifting of the different junctions in the population is implemented by spin-orbit torque, one needs to consider the variability on the width of the underlayer. The voltage for which the frequency is maximal is proportional to the inverse of the heavy metal underlayer width:
. This enables us to compute the variability on the maximal voltages as a function of the variability on the width of the underlayer. The red triangles curve in Figure S1 shows the distance between the gripper and the target versus the variability on the width of the underlayer. This variability only affects the values of the voltages at which the tuning curves are maximal, which has a purely negative impact on the precision.
When both the underlayer width and the junctions' diameters are affected by variability, the two effects balance each other and up to 4 nm variation on the feature size can be tolerated without any precision loss (black squares in Figure S1 ). Our intelligent sensor therefore exhibits a strong robustness to the unavoidable variability resulting from the lithography process. Figure S1 : Distance between the gripper and the target as a function of the variability on feature size of the lithography process, when variability affects the junction only (blue disks), the metal underlayer only (red triangles) and both the junction and the metal underlayer (black squares). 50 junctions in each network and 3,000 steps were used. The results are averages over 50 learning trials. The error bars correspond to the standard deviations over these trials.
SECTION 2: ROBUSTNESS TO TEMPERATURE VARIATIONS
We tested our system's resilience to temperature changes. Figure S2 shows the evolution of the distance between the gripper and the target versus the temperature. Two cases are studied: the system is calibrated to function at T th = 270 K (red circles) and the system is calibrated to function at T th = 300 K (black squares). As can be seen from Eq. (1), temperature variations induce deformations of the junctions' tuning curves, which have a negative effect on the performance. However, raising the temperature increases the natural frequency of the junctions. We observe that this balances the deformation and actually increases the precision of the system. This is only valid up to a certain point: when the temperature is too different from T th , the error rises again. On the contrary, decreasing the temperature lowers the natural frequency and adds up with the mismatch to strongly reduce the precision, as can be observed for the T th = 300 K case. In consequence, programming the sensory processor for the bottom of the working temperature range (as illustrated here by the T th = 270 K case) allows a high robustness to temperature variations. Figure S2 : Distance gripper-target versus the temperature for two calibration temperature, 300 K (black squares) and 270 K (red circles). In each case, 50 junctions in each network and 3,000 steps were used. The results are averages over 10 learning trials.
SECTION 3: PERFORMING COORDINATES TRANSFORMATIONS
The proposed spintronic sensory processor can learn to transform information. In this case, the orientation of the target is a function of the perceived stimulus. In order to catch the target, the sensory processor has to perform an operation on the value of the stimulus. Figure S3 compares the evolution of the distance between the gripper and the target versus the number of sensory junctions for different operations: the simple value of the stimulus ("z"), the double of the stimulus ("2z"), the square of the stimulus ("z^2"), the inverse of the stimulus ("1/z") and the sine of the stimulus ("sin(z)").
The task is performed in the same way as in the catching target case, with the orientation of the target being replaced by the result of the transformation operation. The distance gripper-target is computed as the absolute difference between the expected value of the transformation and the numerically computed value. It is expressed as a percentage of the range of possible expected values. For "z": the stimulus range is -1 to +1V and the result range -1 to +1 V. For "2z": the stimulus range is -1 to +1V and the result range -2 to +2 V. For "z^2": the stimulus range is -1 to +1V and the result range 0 to +1 V. For "1/z": the stimulus range is +0.5 to +1V and the result range is +1 to +2 V. For "sin(z)" the stimulus range is 0 to +1.5 V and the result range 0 to +1 V.
The results in Figure S3 show that the same precision can be achieved for coordinate transformations as for simple sensor-motor coordination. Our nanoscale sensory processor is able to learn linear and nonlinear transformations. The method can be extended to learning of 2D coordinates transformation. Here we have two sensors, one sensitive to the orientation of the target (φ) and one sensitive to the distance of the target (R). The 2D motor is controlled by instructions in Cartesian coordinates (x and y). The stimulus ranges are 0 to 1V for R and 0 to 1.5V for φ. The range for both x and y is 0 to 1V. Four populations of junctions encode the four coordinates R, φ, x and y.
The two sensory populations R and φ are concatenated into a single population. Its number of junctions is the sum of the number of junctions in each population N s = N R + N φ . Two weights matrices (W x and W y ) connect the sensory (R, φ) to the motor junctions (x, y). The weights matrices W x and W y have the dimensions N x × N s and N y × N s . Where N x (N y ) is the number of junction encoding x (y). Learning of the weights is implemented as described in the main text.
The distance gripper-target is computed as the absolute 2D-distance between the target and the gripper and is expressed as a percentage of the range for x and y. The grey spheres ("2D") in Figure S3 show that, although the error is larger than for 1D transformations, our system can perform 2D coordinates transformations. Figure S3 : Distance between the gripper and the target versus the number of sensory junctions N s , for the different coordinate transformations. Red circles: simple sensor-motor coordination ("z"). Purple down triangles: double of the stimulus ("2z"). Black squares: square of the stimulus ("z^2"). Green up triangles: inverse of the stimulus ("1/z"). Blue squares: sine of the stimulus ("sin(z)"). Grey spheres: two dimensions coordinates transformations from polar to Cartesian. 50 junctions in each network and 3,000 steps were used. The results are averages over 10 learning trials. The error bars correspond to the standard deviations over these trials. 

{'paper_id': '9628367', 'title': 'Bio-inspired intelligent sensory processing with nanoscale stochastic magnetic tunnel junctions.', 's2_url': 'https://api.semanticscholar.org/CorpusID:9628367', 'source': 'S2ORC'}