Simulation-based inference for model parameterization on analog neuromorphic hardware

The BrainScaleS-2 (BSS-2) system implements physical models of neurons as well as synapses and aims for an energy-efficient and fast emulation of biological neurons. When replicating neuroscientific experiments on BSS-2, a major challenge is finding suitable model parameters. This study investigates the suitability of the sequential neural posterior estimation (SNPE) algorithm for parameterizing a multi-compartmental neuron model emulated on the BSS-2 analog neuromorphic system. The SNPE algorithm belongs to the class of simulation-based inference methods and estimates the posterior distribution of the model parameters; access to the posterior allows quantifying the confidence in parameter estimations and unveiling correlation between model parameters. For our multi-compartmental model, we show that the approximated posterior agrees with experimental observations and that the identified correlation between parameters fits theoretical expectations. Furthermore, as already shown for software simulations, the algorithm can deal with high-dimensional observations and parameter spaces when the data is generated by emulations on BSS-2. These results suggest that the SNPE algorithm is a promising approach for automating the parameterization and the analyzation of complex models, especially when dealing with characteristic properties of analog neuromorphic substrates, such as trial-to-trial variations or limited parameter ranges.


Introduction
Mechanistic models, which try to explain the causality between inputs and outputs, are integral to scientific research.On the one hand they can increase the understanding of the mechanisms which cause the phenomena and on the other make predictions about new outcomes which can then be tested experimentally (Baker et al., 2018).After a mechanistic model has been formulated, one of the remaining challenges is to find suitable model parameters which lead to a close agreement between model behavior and experimental observations.Several approaches such as the hand-tuning of parameters, grid searches, random/stochastic searches, evolutionary algorithms, simulated annealing and particle swarm algorithms have been used in neuroscience to find appropriate model parameters (Vanier and Bower, 1999;Van Geit et al., 2008).Drawbacks of these methods are that they rely on a score which represents how close the results of a simulated model are to the target observation and that they in general only yield the best performing set of parameters.Furthermore, these algorithms are often computationally expensive since they require many simulations to find suitable parameters (Gonçalves et al., 2020).
The class of simulation-based inference (SBI) algorithms makes statistical inference methods available for models where the likelihood is not tractable and provides an approximation of the posterior distribution of the model parameters.Advantages of deriving an approximation of the posterior include the possibility to find correlations between model parameters and to evaluate the confidence in the estimated parameters.Early SBI approaches rely on defining a score and are computationally inefficient since they disregard many simulation which have a low score (Sisson et al., 2018).
Recent advances in machine learning lead to a new class of SBI algorithms which promise to be computationally more efficient and do not depend on a score function (Papamakarios and Murray, 2016;Lueckmann et al., 2017;Greenberg et al., 2019;Cranmer et al., 2020;Deistler et al., 2022).In this paper we will focus on the sequential neural posterior estimation (SNPE) algorithm which was already applied to infer parameters for different neuroscientific models (Lueckmann et al., 2017;Gonçalves et al., 2020).More specifically, we want to investigate if this algorithm is suitable to parameterize neuron models which are emulated on the BrainScaleS-2 (BSS-2) analog neuromorphic hardware system (Pehle et al., 2022).
Neuromorphic computation draws inspiration from the brain to find time and energy efficient computing architectures as well as algorithms (Indiveri et al., 2011).The BSS-2 system emulates the behavior of neurons and synapses on analog circuits in continuous time (Billaudelle et al., 2022) and does not solve the model equations mathematically like digital neuromorphic hardware (Furber et al., 2013;Davies et al., 2018;Mayr et al., 2019).
In previous experiments on the BSS-2 system, hardware parameters were set by calibration routines, grid searches, gradient-based optimization or by hand-tuning (Billaudelle et al., 2022;Cramer et al., 2022;Pehle et al., 2023;Aamir et al., 2018;Wunderlich et al., 2019;Kaiser et al., 2022).The handtuning of parameters can be tedious and relies on the domainspecific knowledge of the experimenter such that automated parameter-search methods are inevitable for complex problems (Vanier and Bower, 1999).Similarly, a calibration routine can only be formulated if the relationship between parameters and observations is known.Depending on the dimensionality of the parameter space, grid searches and random searches can be computationally too expensive.The SNPE algorithm promises to find approximations of the posterior even if the parameter space is high-dimensional and the relationship between the parameters and the observation is unknown (Lueckmann et al., 2017;Greenberg et al., 2019;Gonçalves et al., 2020).
Furthermore, the SNPE algorithm is designed for probabilistic models.This makes it a suitable choice for models which deal with intrinsic probabilistic behavior such as analog neuromorphic hardware which is subject to temporal noise.
In the present study we emulated a passive multicompartmental neuron model on BSS-2 and investigated whether the SNPE algorithm can find suitable model parameters to reproduce previously recorded target observations.For a two-dimensional parameter space, we show that the approximated posterior derived with the SNPE algorithm agreeed with a grid search over the whole parameter space and that the correlations between model parameters are in agreement with theoretical predictions.
Finally, we extended the problem to a higher-dimensional (7) parameter space and examined the approximated posteriors with posterior-predictive checks (PPCs).The correlations between parameters of this high-dimensional model did agree with the model equations.
All in all, our results indicate that the SNPE algorithm is able to deal with the intrinsic trial-to-trial variations of analog neuromorphic hardware and is able to approximate posterior distributions which are in agreement with the given target observations.

Methods
This section starts by introducing the BSS-2 neuromorphic system.We chose the attenuation of post-synaptic potentials (PSPs) in a passive chain of compartments to test if the SNPE algorithm is capable to parameterize experiments on BSS-2.Therefore, we introduce the attenuation experiment before we describe the SNPE algorithm.We conclude this section by introducing methods which we used to validate our posterior approximations.

BrainScaleS-2
BSS-2 is a mixed-signal analog neuromorphic system; neuron and synapse dynamics are emulated by analog circuits while spike events and configuration data rely on digital communication, Figure 1(a).More specifically, the dynamics of the analog neuron circuits are designed to resemble the dynamics of the adaptive exponential integrate-and-fire (AdEx) neuron model (Brette and Gerstner, 2005;Billaudelle et al., 2022).Voltages and currents on these analog circuits directly represent the state of the emulated neuron.

Neuron Dynamics
The AdEx neuron model extends the leaky integrate-and-fire (LIF) neuron model by introducing an exponential and an adaptation current (Brette and Gerstner, 2005).The high configurability, see below, of the BSS-2 system allows disabling these currents to model LIF neurons.Furthermore, several neuron circuits can be connected to form multi-compartmental neuron models (Kaiser et al., 2022).
In this publication, we will consider multi-compartmental neuron models for which the membrane potentials in the different compartments Vm adhere to the dynamics of the LIF neuron model, where Cm is the membrane capacitance, g leak the leak conductance and V leak the leak potential.
The two currents in Equation ( 1) arise due to synaptic input, Isyn, and connections to neighboring compartments, I axial .The synaptic current Isyn models current-based synapses with an exponential kernel.The current I axial,i (t) on compartment i1 due to neighboring compartments is given by where the sum runs over all neighboring compartments {j}, g i↔j axial represents the conductance between these compartments and Vj is the membrane potential of the neighboring compartment.
Once the membrane potential Vm crosses a threshold potential V thres a spike is generated and the membrane potential is reset to the reset potential Vreset.2After the refractory time τ ref the reset is released and the membrane potential Vm continues to adhere to the dynamics of Equation (1).

Configurability
The behavior of the neuron circuits on BSS-2 can be controlled by several digital and analog parameters.Digital parameters, for example, control if the adaptation or exponential currents are connected to the membrane (Billaudelle et al., 2022) and how different neuron circuits are connected to each other to form multi-compartmental neuron models (Kaiser et al., 2022).
Analog reference voltages and currents control quantities such as the leak conductance g leak , leak potential V leak or the axial conductance g axial between neuron circuits.These analog references are provided by an analog on-chip memory array which converts digital 10 bit values to currents and voltages (Hock et al., 2013).Since the last value is reserved, reference currents and voltages can be adjusted digitally from 0 to 1022.This large configuration range allows tuning the neuron circuits to a variety of different operating regimes and to compensate manufacturing-induced mismatch between different neuron circuits (Billaudelle et al., 2022).
In the current publication, we use the latest revision of the BSS-2 system (Pehle et al., 2022;Billaudelle et al., 2022).The PyNN domain-specific language (Davison et al., 2009) was used to formulate the experiments and the BSS-2 OS to define as well as to control the experiments (Müller et al., 2020).

Experiment Description -A Linear Chain of Compartments
In order to test the capabilities of the SNPE algorithm, we considered a multi-compartmental model which consisted of a chain of passive compartments, see Figure 2(a).Such multicompartmental models have been used to model dendrites and axons (Rall, 1962;Fatt and Katz, 1951).Each compartment i was connected to a leak potential V leak via a leak conductance g i leak and to the neighboring compartment via an axial conductance g i↔i+1 axial , compare Equation (2).These conductances served as our parameters θ, all other parameters were fixed.
We injected synaptic inputs in the different compartments and observed how the PSPs propagate along the chain.More specifically, we looked at the heights of PSPs; in the following we will use the notation hij to describe the PSP height which was observed in compartment i after an input to compartment j, Figure 2(a).Since we were only interested in the passive propagation, we disabled the spiking threshold, this is equivalent to V thres → ∞.
Due to the low-pass properties of the passive chain, the response in the first compartment broadened and its height decreased as the synaptic input was injected further away from the first compartment, compare first row in Figure 2(a).A similar behavior was visible when we looked at the voltage traces in the second compartment: the PSPs broadened and flattened for inputs further away from the recording site.Since we considered a finite chain, we saw that an input at the end of the chain affected the membrane potential more strongly, for example h10 > h12.
The height of the PSPs depended on the leak and axial conductance (Fatt and Katz, 1951).A higher leak or axial conductance resulted in lower PSP heights at the injection site as less charge can be accumulated on the compartment.Therefore, the PSP heights H or quantities derived form them were suitable observations x that could be used to infer parameters θ.Besides the full matrix of PSP heights, we used the PSP heights which resulted from an input to the first compartment F = [h00, h10, h20, h30] and the decay constant τ from an exponential fit to F as observables.

Sequential Neural Posterior Estimation Algorithm
The SNPE algorithm (Papamakarios and Murray, 2016;Lueckmann et al., 2017;Greenberg et al., 2019) belongs to the class of SBI algorithms and allows finding an approximation of the posterior distribution p (θ | x * ) in cases where the likelihood p (x | θ) is intractable.Here θ are the parameters of a mechanistic model for which we try to find parameters which reproduce a target observation x * .The main idea is to evaluate the model for different parameters {θi}, extract the observations {xi} and fit a flexible probability distribution as a posterior to this set of parameters and observations.As the name suggests the parameters of these probability distributions are determined by neural networks.
The algorithm takes a target observation x * , prior p(θ) and a model for which suitable parameters should be found as an input, Figure 1(b).The prior is used to draw random parameters θ ′ ∼ p(θ).By executing the model with the given parameters θ ′ we implicitly sample from the likelihood x ′ ∼ p(x | θ ′ ).In our case the evaluation of the model is the emulation on the BSS-2 system.
In the second step, a neural density estimator (NDE) is trained to approximate the posterior distribution p(θ | x).The NDE is a flexible set of probability distributions which are parameterized by a neural network.Typical choices are mixturedensity networks (Bishop, 1994;Papamakarios and Murray, 2016;Lueckmann et al., 2017;Greenberg et al., 2019) or masked autoregressive flows (MAFs) (Papamakarios et al., 2017;Papamakarios et al., 2019;Gonçalves et al., 2020   The parameters of the model are given by the leak conductance in each compartment g i leak and the axial conductance between compartments g i↔i+1 axial . In our experiment we observe the propagation of post-synaptic potentials (PSPs).Here we show membrane traces of neurons which were emulated on the BrainScaleS-2 system.We inject a synaptic input (vertical lines) in one compartment after another and record the membrane potential in each compartment (different rows).From these traces we extract the heights of the PSPs hij .We use the matrix of all heights H, the heights resulting from an input to the first compartment F = [h00, h10, h20, h30] or the decay constant τ from an exponential fit to F as observables.The scale bar in the lower right corner indicates the voltage and time in the hardware domain.(b) Grid search on BrainScaleS-2 of the decay constant τ ; the decay constant is given in units of "compartments" and calculated by fitting an exponential to the PSPs which result from an input to the first compartment, compare panel (a).We divided the parameter space in an evenly spaced grid with 40 values in each dimension, recorded the resulting PSP heights in each compartment and extracted the decay constant τ ; Figure A1 shows the exponential fits for some exemplary measurements.The decay constant τ decreases as the leak conductance g leak is increased or the axial conductance g axial is reduced.The white contour lines mark regions with equal decay constant and show a correlation between leak and axial conductance.Traces recorded at the numbered points are displayed in Figure 3. et al., 2021).The NDE is commonly trained by minimizing the negative log-likelihood of the previously drawn samples.Therefore, unlike traditional SBI algorithms the SNPE algorithm does not depend on a user-defined score function.After successful training, the NDE approximates the posterior distribution of the parameters for any observation x.
If we are only interested in a single target observation x * , we can use the estimated posterior distribution in the following rounds as a proposal prior (Papamakarios and Murray, 2016;Lueckmann et al., 2017;Greenberg et al., 2019).While this sequential approach can increase sample efficiency, the obtained approximation of the posterior is no longer amortized, i.e. it can only be used to infer parameters for the target observation x * and not any arbitrary observation x.
In our experiments we applied the algorithm presented in Greenberg et al. (2019) which is implemented in the Python package sbi 3 (Tejero-Cantero et al., 2020).The structure of the NDE as well as other hyperparameters of the SNPE algorithm can be found in Appendix A.2.

Validation
In order to validate the approximated posteriors we used PPCs and calculated the expected coverage for each posterior (Hermans et al., 2022).

Predictive Posterior Check
We performed PPCs to check if an approximated posterior p (θ | x * ) yielded parameters θ which are in agreement with the original observation x * .As discussed in Lueckmann et al. (2021), PPCs do not measure the similarity of the approximated and true posterior and should just be used as a check rather than a metric.Nevertheless, we found that PPC were sensitive enough to highlight posterior approximations which did not agree with our expectation of the posterior based on grid search results.In the appendix, we illustrate examples of mismatching posteriors, Figure A5, and show how we used PPCs to adjust the hyperparameters of the NDE, Figure A6.
with these parameters on BSS-2 and recorded the observables {xi}.We used the mean Euclidean distance between these observations and the target observation x * as an indicator for an successful approximation.

Expected Coverage
Recent publications indicate that the posteriors approximated with the SNPE algorithm tend to yield overconfident posterior approximations, i.e. the posterior distribution is to narrow (Hermans et al., 2022;Deistler et al., 2022).To test the confidence of our posteriors we calculated the expected coverage as suggested in Hermans et al. (2022).
We calculated the expected coverage as follows.First we drew 1000 random samples from the prior distribution, {θ * i } ∼ p(θ).We then performed the experiment with these parameters on BSS-2 to obtain observations {x * i }, yielding pairs {(θ * , x * )i} ∼ p(θ, x).Finally, we calculated the coverage of each pair (θ * , x * )i and averaged over them to get the expected coverage.
The coverage of a single pair was calculated as follows.We drew 10 000 samples for from the amortized posterior {θ ′ j } ∼ p(θ | x * i ) for each pair (i.e.we performed the coverage tests with the first round approximations of the posterior and not the final approximations4 ).Next, we used the posterior probability of the original parameter p(θ * | x * i ) and of the drawn samples {p(θ ′ j | x * i )}j to estimate the coverage.

Results
To simplify the problem, we started by considering a twodimensional parameter space.This was achieved by setting the leak and axial conductance globally.The low dimensionality of the parameter space allowed us to perform a grid search in a reasonable amount of time and to easily visualize the results.
The grid search result can give an intuition about the behavior of the chain and was used as a comparison to the approximated posterior obtained with the SNPE algorithm.
We also executed the SNPE for a high-dimensional (7) parameter space and performed PPCs.For both, the twodimensional and high-dimensional parameter space we looked at different kind of observations and how these influence the approximated posterior.Furthermore, we analyzed the correlation for each posterior and performed coverage tests.

Two-dimensional Parameter Space
We reduced the dimensions of the parameter space to two by setting the leak and axial conductance for all compartments and connections to the same digital value5 ; g i leak = g leak ∀i ∈ {0, 1, 2, 3} and g i↔i+1 axial = g axial ∀i ∈ {0, 1, 2}.

Grid Search
In order to obtain an overview of the model behavior, we performed a grid search over the two-dimensional parameter space.We created a grid of parameters by choosing equally spaced values of the leak and axial conductance which span the whole parameter range.The model was then emulated with these parameters on the BSS-2 system and the membrane traces in the different compartments were recorded.In order to easily visualize the results, we selected a one-dimensional observable.Exponential fits to the maximal height of propagating PSPs were used in other publications to classify the attenuation of PSPs in apical dendrites (Berger et al., 2001).Similarly, we fitted an exponential to the PSP heights which resulted from an input to the first compartment F = [h00, h10, h20, h30] and analyzed the exponential decay constant τ , Figure 2(b).The decay constant increased with increasing axial conductance g axial and decreasing leak conductance g leak .Even though the exponential is just an approximation for the attenuation of transient inputs in multi-compartmental models, a correlation between leak and axial conductance is expected (Fatt and Katz, 1951;Rall, 1962).This behavior can also be understood with Equations (1) and (2): a lower leak conductance g leak leads to less charge leaking from the membrane and consequently a larger charge transfer to the neighboring compartments, which can be counterbalanced by a lower axial conductance g axial .
The responses of the membrane potentials to a synaptic input in the first compartment are displayed in Figure 3(b).For a low leak and a large axial conductance, 0 , the attenuation was the weakest and the PSP was still clearly visible in the last compartment.Parameters on the same contour line showed, as expected, similar attenuation, 1 and 2 , even though the exact shape of the PSPs differed.For a large leak and a low axial conductance, 3 , the PSP decayed quickly and almost vanished in the third compartment.

Simulation Based Inference
We used the SNPE algorithm to infer possible parameters θ = [g leak , g axial ] which reproduce a target observation x * = [τ * ].Furthermore, we investigated how the posterior distribution changed when a more informative observation x * = F * = [h * 00 , h * 10 , h * 20 , h * 30 ] was used, compare Figure 2(a).In the case where a target observation x * is given by an experiment, the true posterior and the optimal model parameters which replicate the observation are typically unknown.This makes it hard to assess the quality of the posterior approximated by the SNPE algorithm.Therefore, we explicitly chose target parameters θ * , emulated our model with these parameters on BSS-2 and measured an "artificial" target observation x * = τ * .This allowed us to perform a closure test and check whether the SNPE algorithm was able to estimate a posterior which agreed with the initial observation.
We picked a target parameter θ * at the center of the parameter space and executed the model with this parameter 100 times to account for trial-to-trial variations due to temporal noise.From the full matrix of PSP heights H we extracted different target observations such as the decay constant τ .The mean of the observed decay constants was our target observation x * = [τ * ] = 1.17 ± 0.04; the decay constant is in units of "compartments".In contrast, while running the SNPE algorithm we executed the model just once for each parameter and did not average over several trials.
We used a uniform distribution over all possible parameters as a prior distribution p(θ) and executed the SNPE algorithm to obtain an approximation of the posterior distribution p (θ | x * ).The uniform distribution covered the whole adjustable range of the leak and axial conductance which ranges from 0 to 1022, see Section 2.1.2.
For a number of problems the SNPE algorithm was reported to be overconfident and ensembles made up of several posteriors were used to retrive a more conservative posterior approximation (Hermans et al., 2022;Deistler et al., 2022).Since some of your posteriors were also overconfident, see later section, we combined five posterior to a posterior ensemble.
In order to facilitate the comparison of the grid search results and the approximated posterior, we display the difference between the target decay constant τ * and the measured decay constant τ during the grid search in Figure 3(a).As expected form the grid search, a correlation between the leak g leak and the axial conductance g axial is clearly visible in the approximated posterior, Figure 3(c).The posterior distribution shows high densities for parameters θ which reproduced observations near the target observation during the grid search.
In order to retrieve a narrow posterior around the original parameters θ * , a more informative observations was needed.While the PSP heights showed a similar decay for different sets of leak and axial conductance, Figure 3(b), the absolute heights of the PSPs differed, Figure 3(e).We therefore used the PSPs heights which resulted from an input to the first compartment F as a target observation, x * = F * , to further constrain possible parameters.The heights in the first compartment F were extracted from the same 100 trials as the decay constant τ .We ran the SNPE algorithm once again to retrieve another approximation of the posterior.Samples {θi} drawn from this posterior were now scattered around the original parameter θ * in the parameter space and the parameters were uncorrelated, Figure 3(d); the Pearson correlation coefficient decreased from 0.92 to 0.004.The marginal distribution of the leak and axial conductance were bell-shaped and showed a high density near the target parameter θ * .
Validation In order to perform a PPC, we drew samples {θi} from the posterior distribution, Figure 3(c), configured our model with them and compared the observations {xi} with the target observation x * .We measured a mean decay constant of τ = 1.18 ± 0.08 which agrees with the target τ * = 1.17 ± 0.04.Therefore, we conclude that the approximated posterior is in agreement with the target observation τ * .The uncertainty of the posterior predictive increased compared to the target observation since it contains the aleatoric uncertainty, due to the inherent trial-to-trial variations, as well as the epistemic uncertainty which stems from the width of the posterior distribution.
To test the calibration of the approximated posterior, we calculated the expected coverage, compare Section 2.4.When we used the decay constant τ as a target, three out of five posteriors were overconfident, Figure 4. We followed the methods In case of the heights F as a target, the single posteriors were already well calibrated.And consequently, the ensemble of five posteriors was also well calibrated.
In the appendix, we compare the results from the emulation on BSS-2 with computer simulations performed in the simulation library Arbor (Abi Akar et al., 2019), Figure A8.

Multidimensional Parameter Space
In order to increase the problem complexity, we set the leak and axial conductance for each compartment and connection individually.For four compartments this resulted in a total of seven parameters; four leak condutances g i leak (i = 0, 1, 2, 3) and three axial conductances g i↔i+1 axial (i = 0, 1, 2).As in the previous section we used a uniform prior and the PSP heights caused by an input to the first compartment as a target (x * = F * ).We then executed the SNPE algorithm, combined five approximated posteriors to an ensemble and drew samples from this posterior p(θ | x * ).
The marginal distribution of the sampled leak conductance in the first compartment g 0 leak was bell-shaped and peaked near the target parameter, Figure 5(a).The almost uniform distributions of the leak conductances in the other compartments indicated that they were not relevant for the chosen observation.In contrast, the marginal distribution of all axial conductances were bell-shaped with a high density around the original parameters.The distributions of the axial conductance became broader for conductances later in the chain, suggesting that the influence of these conductances on the observable was weaker.
Similar to the two-dimensional case, we considered a higherdimensional observation as a target to retrieve narrower posterior distributions, i.e., we chose all PSP heights as a target (x * = H * ), Figure 5(a).Now the one-dimensional marginals of all parameters were bell-shaped.The marginals of the axial conductance showed a narrower distribution than these of the leak conductance, indicating that the given observation was more sensitive to the axial conductance.
Correlation In Figure 5(b) we display the correlation between posterior samples, the one-and two-dimensional marginals of posterior samples can be found in Figures A3 and A4.When we considered the PSP heights which resulted from an input to the first compartment F as an observable we saw strong Figure 5: Results of the sequential neural posterior estimation algorithm for a compartment chain of 4 compartments and setting parameters individually for each compartment and connection between them.Emulations were performed on the neuromorphic BrainScaleS-2 system.(a) Histograms of 10 000 parameters drawn from the approximated posterior.For the heights F of the post-synaptic potentials (PSPs) which resulted from an input to the first compartment as a target observation (blue), the distribution of the leak conductance in the first compartments is bellshaped and peaks near the target parameter (dotted line).The leak conductance is roughly uniformly distributed in later compartments.The distributions of the axial conductance are bell-shaped and broaden for later compartments.Choosing all heights H as a target (orange) leads to narrower distributions.All histograms are now bell-shaped with a peak near the target (dotted line).(b) Pearson correlations between different parameters.The color denotes the value of the correlation while the radius of the circle encodes the absolute value of the correlation.Left: PSP heights resulting from an input to the first compartment F as a target.The strongest correlations can be observed for the leak conductance in the first compartment g 0 leak and the axial conductance between the first and second compartment g 1↔2 axial ; for parameters later in the chain the correlations shows lower values.Right: All PSP heights H as a target.Overall the correlations decrease for this more informative target.Only between neighboring leak conductances a high negative correlation can be observed.
negative correlations between the leak conductance in the first compartment g 0 leak and the leak conductance in the neighboring compartment g 1 leak as well as the axial conductance between both compartments g 1↔2 axial .This can be explained with Equations (1) and ( 2) and considering the PSP height in the first compartment: when the leak conductance g 0 leak in the first compartment increases, a higher current leaks from the membrane which would result in a smaller PSP height; to counter this effect the charge which flows to the neighboring compartment has to be minimized by reducing the axial conductance g 1↔2 axial between the compartments or the leak conductance g 1 leak of the neighboring compartment.
The leak conductance g 0 leak was also negatively correlated to the other leak and axial conductances, compare first column in Figure 5(b).The magnitude of the correlation decreased for parameters further away from the first compartment.Apart from the correlation with the leak conductance g 0 leak of the first compartment, the correlation between the other leak conductances was low.
Interestingly, the correlations between the axial conductances g i↔i+1 axial and the other leak conductance g i leak , i > 0 was positive.As mentioned above a higher leak conductance leads to a larger leak current which results in a smaller PSP height.Since we only considered an input to the first compartment, this increased leak conductance g i leak could be counteracted by increasing the charge which is injected from the previous compartments and therefore increasing the conductance g j−1↔j axial ; j ≤ i, i > 0 to compartments earlier in the chain.The correlation of the leak conductance g i leak to later axial conductances g j↔j+1 axial ; j ≥ i, i > 0 were still positive but significantly lower.
As expected, all axial conductances were correlated positively.This can be explained when considering one compartment i, i > 0. An increase in the axial conductance g i−1↔i axial leads to a stronger current on compartment i; to prevent an accumulation of charge and therefore a larger PSP height, the conductance to the next compartment g i↔i+1 axial has to increase as well.
When taking all heights H as a target observation, the correlation between the different parameters decreased.Only between neighboring leak conductances g i leak and g i+1 leak rather high negative correlations could be observed.To understand this correlation, we can consider two cases.We look at one compartment i, increase its leak conductance g i leak and consider once an input to the same compartment i and once to a neighboring compartment i ± 1. First, input in the same compartment: as before an increased leak conductance g i leak results in a lower PSP height which can be compensated by a smaller leak conductance g i±1 leak in the neighboring compartments.Similarly, in the second case when the input is injected in a neighboring compartment, an increased leak conductance g i leak would once again lead to an increased leakage and a decreased PSP height.Consequently, the leak conductance g i±1 leak in the neighboring compartment should be reduced such that more charge can flow on compartment i.
Validation We once again used PPCs to check if samples drawn from the approximated posterior {θi} reproduce the target observation.The mean difference between observations {Hi} obtained with these parameters and the target observation H * are displayed in Figure 6(a).H describes all observed PSP heights and the target observation F * was extracted from H * , see Figure 2(a).
The mean of the PSP heights for an input to the first compartment (first column) was near the initial target values; the standard deviation was in the range of 1 to 2 σ * where σ * is the standard deviation of the measurements which were used to extract the target observation H * .For responses in the first compartment (first row) a similar standard deviation could be observed, but the mean observation showed a slightly higher deviation from the target observation.For the other PSP heights the mean was still in the one-sigma range of the initial target observation, but the standard deviation of the observations was significantly higher.The small deviation of the mean observations can be explained by our target parameter which is located at the center of the parameter space; a prior predictive check also yielded mean observations near the target observations, compare Figure A2.The higher standard deviations are expected since these PSP heights have not been part of the observation and can be attributed to the broad posterior distribution of the leak and axial conductance in later compartments, compare Figure 5(a).
The sharpening of the posterior distribution was also visible in the results of the PPC, Figure 6(a).Here the standard deviation of the observations decreased to the range of 1 to 2 σ * for all PSP heights.
As for the two-dimensional case, we calculated the expected coverage for the approximated posteriors and their ensembles, Figure 6(b).With the heights which resulted from an input to the first compartment F as an observable, all five posteriors were overconfident and also an ensemble made up of these five posteriors was still overconfident.When using all heights H as an observation, the expected coverage of the individual posteriors were similar to the case before.However, the expected coverage of the ensemble was near the diagonal; this suggests that the posterior was well calibrated.

Discussion
We have shown that the sequential neural posterior estimation (SNPE) algorithm can be used to parameterize the analog neuromorphic BrainScaleS-2 (BSS-2) system.To be able to investigate the posteriors approximated by the SNPE algorithm, we selected a multi-compartmental model which takes the form of a chain of passive compartments.We chose the leak conductance as well as the axial conductance between compartments as parameters and observed how post-synaptic potentials (PSPs) propagated along the chain.This model allowed us to easily change the dimensionality of the parameter space as well as the choice of observable and evaluate how this influences the approximated posteriors.
In all our experiments, we picked a set of target parameters, extracted an observation with these parameters and then used the SNPE algorithm to approximate the posterior distribution of the parameters which reproduce this given observation.
As a first step, we considered a two-dimensional parameter space where we set all leak conductances and axial conductances to the same value.The low dimensionality of the parameter space allowed us to perform a grid search in a reasonable amount of time.The posterior approximated by the SNPE algorithm agreed with the results from this grid search.In both cases we found a correlation between the leak and axial conductance when looking at the attenuation of PSPs; this argees with theoretical expectations (Fatt and Katz, 1951;Rall, 1962).To be able to find such correlation is one of the advantages of a posterior approximation over traditional parameter search algorithms which usually only yield a set of parameters which reproduce the given observation but do not illustrate the relation between different parameters.
When we chose a more informative observation, specifically the height of the PSPs which result from an input to the first compartment, the posterior distribution of the parameters narrowed and the correlation between leak and axial conductance vanished.We further showed that the algorithm is capable of finding appropriate posterior approximations for several, random values of the target parameters.The approximations were even in agreement with the target parameters if they lie at the edges of the parameter space.This indicates that the algorithm is able to deal with the hard parameter limits which are dictated by the neuromorphic hardware.
Furthermore, we performed coverage tests to assess the calibration of the posterior approximations.The posteriors produced with the less informative observation were overconfident, requiring an ensemble of five posteriors to retrieve a well calibrated posterior.In contrast, all posteriors approximated for the more informative observation were well calibrated.
Next, we increased the dimensionality of the parameter space by adjusting each leak and axial conductance individually; re-sulting in a seven-dimensional parameter space.We showed that the marginal distributions of samples drawn from the posterior approximations have a high density around the target parameters.In addition, we analyzed the correlation between the different parameters and showed that they agree with the model equations.
Furthermore, we conducted posterior-predictive checks (PPCs) to verify that the parameters drawn from the approximated posterior yield emulated results which align with the target observation.Similar to the two-dimensional case, increasing the dimensionality of the observable resulted in a narrower posterior distribution.When using the height of the PSPs which resulted from an input to the first compartment as an observable, we did not find well calibrated posteriors even when combining multiple posteriors into an ensemble.After increasing the dimensionality of the observable, the individual posteriors remained overconfident but the ensemble made up of five of them was well calibrated.

Conclusion
The SNPE algorithm has previously only been utilized to identify suitable parameters for numerical simulations (Lueckmann et al., 2017;Greenberg et al., 2019;Gonçalves et al., 2020;Deistler et al., 2022).In the current work we show that the algorithm can also be employed to parameterize a physical system, namely the BSS-2 neuromorphic system.
In contrast to other search algorithms such as random search, genetic algorithms or gradient-based algorithms, the SNPE algorithm provides an approximation of the full posterior and therefore allows to identify correlations between parameters and to quantify the confidence of the parameter estimation.Additionally, the SNPE algorithm is agnostic to the internal dynamics of the experiment and does not require the calculation of gradients.Compared to traditional simulation-based inference (SBI) methods the SNPE algorithm offers a higher simulation efficiency (Papamakarios and Murray, 2016;Cranmer et al., 2020).As a result, SNPE is a viable alternative to traditional optimization methods.
When one simply optimizes for a single objective and is not concerned with the correlations between parameters, gradient based methods can offer a more directed optimization approach and are potentially faster in recovering suitable parameters; they have successfully been used to find parameters for BSS-2 (Cramer et al., 2022;Pehle et al., 2023;Arnold et al., 2023).However, having access to an approximated posterior distribution and the correlations between different parameters can give valuable insight in the dynamics of the underlying model as shown in the current study.
To evaluate the quality of the approximated posteriors, we generated the target observation from our model.As a result, we knew the true parameters of the target observation and were certain that our model can reproduce the given observation.In subsequent studies, we will use the SNPE algorithm to replicate observations which are generated by another model such as numerical simulations or by physiological experiments.
Furthermore, we only considered passive neuron properties in our current experiments.As seen in the grid search results, this lead to a rather smooth parameter space, where the observations change gradually with the model parameters.More complex neuron models of interest include non-linear behavior such as somatic or dendritic spikes and will potentially have high-dimensional parameter spaces.Gonçalves et al. (2020) and Deistler et al. (2022) have previously shown that the SNPE algorithm and derivatives of it can deal with such highdimensional parameter spaces and non-linear behavior and it These PSP heights were compared to the observation H * which represents the measurement with the target parameters θ * .The vertical lines show the mean deviation of the observations {Hi} from this target H * while the horizontal bars illustrate the standard deviation of this deviation.As mentioned in the introduction, analog hardware is subject to temporal noise.Therefore, the hardware was configured to the target parameters θ * 100 times and the mean PSP heights were chosen as a target H * ; the deviations in this panel are scaled by the standard deviation σ * of these 100 measurements (each height deviation hij is divided by the standard deviation of the height σ * ij ).For all PSP heights the mean observation is within 1 to 2 standard deviations of the initial target.When a more informative observation H is chosen, the standard deviations decreases.A prior-predictive check can be found in the appendix, Figure A2.(b) Coverage tests.The gray lines mark the expected coverage (Hermans et al., 2022;Deistler et al., 2022) of posterior approximations found with the SNPE algorithm, the black line marks the expected overage of the posterior ensemble which is made up of these posteriors.Left: PSP heights resulting from an input to the first compartment F as an observation.The expected coverage is for all confidence levels below the diagonal which suggests that the posteriors are overconfident.Even an ensemble made up of five posteriors is not well calibrated.Right: All PSP heights H as a target.The individual posteriors are overconfident but the ensemble of them is well calibrated.
will be interesting if this success can be transferred to emulations on neuromorphic hardware.
In summary, we demonstrated that the SNPE algorithm is able to find posterior approximations for parameters of the analog neuromorphic BSS-2 system.Contributions J.K., J.S. and S.S. designed research; J.K. and R.S. performed research; J.K., J.S, R.S. and S.S. analyzed data; J.K. and S.S. wrote the paper; all authors edited the paper; E.M., J.K., R.S. and S.S contributed software; and J.S. designed the BrainScaleS-2 neuromorphic system.brated.The synaptic time constant was calibrated to a value of 10 µs.As can be extracted from Figure 2(b), the decay constant varied in our experiments between 0.16 to 4.08 compartments.When varying the leak conductance g leak over the full range specified in Figure 3, the membrane time constant τm = Cm g leak varies in the range of 12 µs to 30 µs.

A.2. Sequential Neural Posterior Estimation Algorithm
We adjusted the number of simulations as well as the properties of the neural density estimator (NDE) and used PPCs to check how these hyperparameters influence the approximated posterior.For each set of hyperparameters we executed the SNPE algorithm ten times with different seeds.The seeds influence the initial weights as well as the parameters θ which are drawn from the prior in the first round.Different sets of hyperparameters shared the same seeds.

A.2.1. Number of Simulations and Rounds
For the two-dimensional parameter space and the decay constant τ as an observable, three times 50 emulations were sufficient to recover a posterior which is in agreement with the target observation.Retrieving the observation of a single emulation (including hardware configuration, experiment execution, data retrieval and evaluation) took about took about 420 ms.
When the observable is changed to the height of the postsynaptic potentials (PSPs) which result from an input to the first compartment F , the SNPE algorithm failed to find a suitable approximation if the number of emulations was too low.This was due to a poor approximation in the first round from which the algorithm needed some time to recover or may not recover in the given emulation budget, Figure A5.We observed that a higher number of emulations in the first round reduced the number of cases where the posterior was approximated poorly.Therefore, we chose 500 emulations in the first round followed by ten rounds of 50 emulations for a two-dimensional parameter space with F as an observable.We used two times 1000 emulations for the multidimensional parameter space, Section 3.2.

A.2.2. Neural Density Estimator
Based on the results in Lueckmann et al. (2021) we use masked autoregressive flows (MAFs) as NDEs (Papamakarios et al., 2017).MAFs transform normal distributions in other probability distributions.We used the values provided by the sbi package (Tejero-Cantero et al., 2020) as defaults; similar values have also been used in previous publications (Lueckmann et al., 2021;Gonçalves et al., 2020).Here the MAF is made up of five transformations which are chained together.Each of these transformation consists of two blocks with 50 hidden units per block.For more information see Papamakarios et al. (2017) and Papamakarios et al. (2021).
In case of a two-dimensional parameter space and the decay constant τ as a target, Section 3.1, a single transformation with two blocks of ten hidden units each was sufficient.If we selected the heights which result from an input to the first compartment F as a target, a single transformation was not sufficient to recover a meaningful posterior, Figure A6.Starting from two transformations and 30 hidden units, the best value of the PPC were obtained.The only exception is the network with three transformations and 20 hidden units for which the algorithm could not recover from a poor approximation in the first round.
A MAF with one transformation and 50 hidden units is made up of 3764 trainable parameters and fails to approximate the true posterior.On the other hand a MAF with five transformations and 10 hidden units in each block offers just 1720 trainable parameters but is able to find approximations which agree with the target observation.We conclude, that a high number of transformations was more important for a good posterior approximation than a high number of trainable parameters.For the results reported in Figure 3(d) we used the NDE with five transformations, two blocks and ten hidden units.

A.3. Choice of the Target Parameters
We chose a target parameter θ * at the center of the parameter space to measure target observations x * .For the experiment with the two-dimensional parameter space and the PSP heights for an input to the first compartment, we want to show that the approximated posterior is also appropriate for other choices of the target parameter θ * .As mentioned in the introduction, the posterior estimation is amortized after the first round of SNPE and can therefore be used to infer parameters θ for any observation x.We draw five random parameters {θ * i } from the uniform prior and emulate the model on BrainScaleS-2 (BSS-2) with the given parameters to record observations {x * i }.For each of these observations, we draw samples from the amortized posterior estimation θ ∼ p(θ | x * i ), Figure A7.For each of the randomly selected observations x * i the drawn samples cluster around the parameters which were used to obtain the given observation θ * i .Even if the target parameters are at the edge of the parameter space, the approximated posterior returns samples near these target parameters.Therefore, we conclude that the SNPE algorithm is suitable to find parameters for observations which were obtained for parameters at arbitrary locations in the parameter space and that our choice of target parameters θ * at the center of the parameter space does not affect the generality of the reported results.

A.4. Simulations
We used the Arbor simulation library (version 0.8.1) to compare our results to computer simulations (Abi Akar et al., 2019).Arbor is a high-performance simulator which supports multicompartmental neuron models.As Arbor solves the model equations numerically, it does not suffer from trial-to-trial variations and thus we expect the posterior distributions to be narrower.
As in the main part of the paper, we simulated a chain with four compartments.The length of a single compartment was set to lcomp = 1 mm, its diameter to dcomp = 4 µm and its capacitance to C = 125 pF.While the length and diameter were

;
Figure A2: Comparison between a prior-predictive check and the posterior-predictive checks (PPCs) in Figure 6(a).The data for the posteriorpredictive checks (PPCs) are copied from Figure 6(a), the PPC was performed for two different observations: post-synaptic potential (PSP) heights which resulted from an input to the first compartment F and all PSP heights H.The prior-predictive check was performed similar to the PPCs but the samples were drawn from the prior distribution p(θ).The vertical lines show the mean deviation of the observations {Hi} from this target H * while the horizontal bars illustrate the standard deviation of this deviation.The hardware was configured to the target parameters θ * 100 times and the mean PSP heights were chosen as a target H * ; the deviations in this figure are scaled by the standard deviation σ * of these 100 measurements (each height deviation hij is divided by the standard deviation of the height σ * ij ).While the mean observation is not so far off from the target observation in most cases, the standard deviation is significantly higher than for the PPCs.
chosen arbitrarily, the capacitance reflected the capacitance of the compartments used during the emulation on BSS-2.The range of the leak conductance g leak was selected such that the membrane time constant of the simulated neurons was in agreement with the emulated neurons on BSS-2.Similarly, the range of the axial conductance g axial was chosen such that the axial conductance along a simulated compartment is comparable to the conductance between compartments on BSS-2.
The results from the grid searches were comparable, Figure A8 and Figure 3, but the chosen parameter ranges led to a slightly higher dynamic range of the length constant.In both cases a correlation between the leak and axial conductance was observed.
The shapes of the approximated posteriors also agreed with the results obtained for emulation on BSS-2.As expected, the approximated posterior distribution for the simulation was narrower than the approximation for BSS-2 due to temporal noise.Posterior-predictive check (PPC) for a emulation budget of 10 rounds with 50 emulations in each round (the PPC was executed with 1000 parameters sampled from the posteriors).The SNPE algorithm was executed 10 times with different seeds.For some executions of the SNPE algorithm, the approximated posterior in the first round poorly replicates observations which are similar to x * ; this is evident in a high mean distance E. In all displayed cases the SNPE algorithm is able to recover a meaningful posterior.(b) Examples for one case where the SNPE algorithm is able to approximate a meaningful posterior and one case in which the algorithm fails to find a good approximation in the frist three rounds.
In both cases, the approximation in the first round does not agree with the true posterior.In the top row, the algorithm is able to quickly recover from the poor approximation while in the bottom row more rounds are needed to obtain a meaningful approximation.The parameter ranges are the same as in Figure 3(c).
( 1 ,  (Papamakarios et al., 2017).We used transformations which are made up of two blocks and change the number of hidden units which are used in each block (Gonçalves et al., 2020).Furthermore, we changed the number of transformations which are chained together.As in Figure A5(a) we performed a posterior-predictive check and used the mean distance between these samples and the target as a measure to decide if the approximation agreed with the target observation x * .Again, we used the post-synaptic potential heights resulting from an input to the first compartment as an observable and repeated the sequential neural posterior estimation algorithm with 10 different seeds for each set of hyperparameters.At least two transformation were needed to recover a meaningful posterior.The number of experiments in which a meaningful posterior could be recovered seemed to increase with the number of transformations.The total number of trainable parameters was not an indicator how well the NDE was able to approximate the true posterior.i .We drew five random parameters θi from a uniform prior and one parameter at the center of the parameter space (marked by black crosses).The target observations {x * i } were obtained by emulating the model 100 times for each parameter on BrainScaleS-2 and taking the mean height of the post-synaptic potential obtained from an input to the first compartment, compare Figure 3(d).As a posterior approximation we used the first round posterior obtained while executing the sequential neural posterior estimation algorithm in Section 3.1.2.The samples drawn from the approximated posterior (small dots) are in the vicinity of the parameters which were used to create the target observations (black crosses).

Figure 1 :
Figure 1: The BrainScaleS-2 (BSS-2) system and the sequential neural posterior estimation (SNPE) algorithm.(a) Photograph of the BSS-2 neuromorphic chip bonded to a carrier board.(b) Visualization of the SNPE algorithm(Papamakarios and Murray, 2016;Lueckmann et al., 2017;Greenberg et al., 2019).This algorithm can be used to find an approximation for the posterior distribution p(θ | x * ) of parameters θ which recreate a target observation x * .The target observation x * , a prior belief about the parameter distribution p(θ) and a model which gives implicit access to the likelihood p(x | θ) are given as inputs to the algorithm.In step 1 , we sample parameters θ ′ from the prior distribution and the model is evaluated with these parameters to obtain observations x ′ .This implicitly allows us to sample form the likelihood p(x | θ ′ ).In the following step 2 , the set of parameters and the corresponding observations are used to train a neural density estimator (NDE).The NDE serves as a surrogate for the posterior distribution p(θ | x).Frequently, we are interested in a single observation x * and we can restrict the NDE to this observation, step 3 .We can now use samples drawn from the posterior θ ′ ∼ p(θ | x * ) to generate new samples and retrain the NDE, repeating step 2 and 3 .Steps 2 to 4 can be repeated several times to improve the estimate of the posterior.The figure is based on(Gonçalves et al., 2020, Figure1).

Figure 2 :
Figure 2: Model of a passive compartment chain and grid search results.(a)The parameters of the model are given by the leak conductance in each compartment g i leak and the axial conductance between compartments g i↔i+1 axial .In our experiment we observe the propagation of post-synaptic potentials (PSPs).Here we show membrane traces of neurons which were emulated on the BrainScaleS-2 system.We inject a synaptic input (vertical lines) in one compartment after another and record the membrane potential in each compartment (different rows).From these traces we extract the heights of the PSPs hij .We use the matrix of all heights H, the heights resulting from an input to the first compartment F = [h00, h10, h20, h30] or the decay constant τ from an exponential fit to F as observables.The scale bar in the lower right corner indicates the voltage and time in the hardware domain.(b) Grid search on BrainScaleS-2 of the decay constant τ ; the decay constant is given in units of "compartments" and calculated by fitting an exponential to the PSPs which result from an input to the first compartment, compare panel (a).We divided the parameter space in an evenly spaced grid with 40 values in each dimension, recorded the resulting PSP heights in each compartment and extracted the decay constant τ ; FigureA1shows the exponential fits for some exemplary measurements.The decay constant τ decreases as the leak conductance g leak is increased or the axial conductance g axial is reduced.The white contour lines mark regions with equal decay constant and show a correlation between leak and axial conductance.Traces recorded at the numbered points are displayed in Figure3.

Figure 3 :Figure 4 :
Figure 3: Propagation of post-synaptic potentials (PSPs) in a passive chain of four compartments emulated on the BrainScaleS-2 system.Leak and axial conductance were set to the same value for all compartments and connections between compartments.(a) Grid search result illustrated as the difference of the measured decay constant τ , compare Figure 2(b), to the target decay constant τ * : |τ − τ * |.Traces recorded at the numbered points are displayed in panel (b) and (e).(b) Example traces recorded at different locations in the parameter space, compare panel (a).The colors of the traces indicate in which compartment the trace was recorded, compare Figure 2(a).The traces are scaled relative to the height in the first compartment h00.Due to the faster emulation of the neural dynamics on BSS-2, the time scales are in the microsecond rather than in the millisecond range.(c) Posterior obtained with the sequential neural posterior estimation (SNPE) algorithm.The posterior shows a high density in the parameter region where the target decay constant τ * was recorded, 2 .As expected from the grid search result in panel (a), a correlation between the leak and axial conductance is visible.Points where the decay constant is significantly lower/higher than the target observation show a low probability density, 0 and 3 .(d) 500 random samples drawn from the approximated posteriors for two different types of observations.The green points represent samples drawn from the posterior which is shown in panel (c).The samples show a correlation between both parameters.If the absolute heights of the PSP which resulted from an input to the first compartment F = [h00, h10, h20, h30] was chosen as observations (blue), the samples scatter around point 2 where the original target F * was recorded.The histograms at the top and right of the scatter plot show histograms of the parameter distribution in one dimension.(e) Same traces as in panel (b) but shown on an absolute scale.While traces 1 and 2 share a similar decay constant τ , compare panel (a) and (b), their absolute heights differs.

Figure 6 :
Figure6: Validation of the approximated posteriors found with the sequential neural posterior estimation (SNPE) for a compartment chain of four compartments and setting parameters individually for each compartment and connection between them, compare Figure5.Emulations were performed on the neuromorphic BrainScaleS-2 system.(a) Posterior-predictive check.The passive chain was configured with 1000 of the parameters {θi} drawn in Figure5(a) and the post-synaptic potential (PSP) heights in all compartments {Hi} were measured on the BrainScaleS-2 system.These PSP heights were compared to the observation H * which represents the measurement with the target parameters θ * .The vertical lines show the mean deviation of the observations {Hi} from this target H * while the horizontal bars illustrate the standard deviation of this deviation.As mentioned in the introduction, analog hardware is subject to temporal noise.Therefore, the hardware was configured to the target parameters θ * 100 times and the mean PSP heights were chosen as a target H * ; the deviations in this panel are scaled by the standard deviation σ * of these 100 measurements (each height deviation hij is divided by the standard deviation of the height σ * ij ).For all PSP heights the mean observation is within 1 to 2 standard deviations of the initial target.When a more informative observation H is chosen, the standard deviations decreases.A prior-predictive check can be found in the appendix, FigureA2.(b) Coverage tests.The gray lines mark the expected coverage(Hermans et al., 2022;Deistler et al., 2022) of posterior approximations found with the SNPE algorithm, the black line marks the expected overage of the posterior ensemble which is made up of these posteriors.Left: PSP heights resulting from an input to the first compartment F as an observation.The expected coverage is for all confidence levels below the diagonal which suggests that the posteriors are overconfident.Even an ensemble made up of five posteriors is not well calibrated.Right: All PSP heights H as a target.The individual posteriors are overconfident but the ensemble of them is well calibrated.

Figure A1 :
Figure A1: Exponential fit to the traces displayed in Figure 3(b) and Figure 3(e).The heights of the post-synaptic potentials (PSPs) are extracted from the recorded membrane traces, compare Figure 2(a), and exponentials (solid lines) are fitted to the measurement points.The numbering is the same as in Figure 3.The x-axis label mark the compartment in which the height of the PSP was measured and in brackets the variable name as defined in Figure 2(a).
Figure A3: One-two-dimensional marginal distributions of 1000 samples which were drawn from the posterior ensembles displayed in Figures 5 and 6, the target observations were the PSP heights F which resulted from an input to the first compartment.

Figure A5 :
Figure A4: One-and two-dimensional marginal distributions of 1000 samples which were drawn from the posterior ensembles displayed in Figures 5 and 6, the target observation were all PSP heights H.

Figure A6 :
FigureA6: Influence of the parameterization of the neural density estimator (NDE) on the approximation of the posterior.We used masked autoregressive flows (MAFs) as NDEs.MAFs transform normal distributions in other distributions(Papamakarios et al., 2017).We used transformations which are made up of two blocks and change the number of hidden units which are used in each block(Gonçalves et al., 2020).Furthermore, we changed the number of transformations which are chained together.As in FigureA5(a) we performed a posterior-predictive check and used the mean distance between these samples and the target as a measure to decide if the approximation agreed with the target observation x * .Again, we used the post-synaptic potential heights resulting from an input to the first compartment as an observable and repeated the sequential neural posterior estimation algorithm with 10 different seeds for each set of hyperparameters.At least two transformation were needed to recover a meaningful posterior.The number of experiments in which a meaningful posterior could be recovered seemed to increase with the number of transformations.The total number of trainable parameters was not an indicator how well the NDE was able to approximate the true posterior.

Figure A7 :
Figure A7: Posterior samples {θj }i ∼ | x * i ) for different observations x *i .We drew five random parameters θi from a uniform prior and one parameter at the center of the parameter space (marked by black crosses).The target observations {x * i } were obtained by emulating the model 100 times for each parameter on BrainScaleS-2 and taking the mean height of the post-synaptic potential obtained from an input to the first compartment, compare Figure3(d).As a posterior approximation we used the first round posterior obtained while executing the sequential neural posterior estimation algorithm in Section 3.1.2.The samples drawn from the approximated posterior (small dots) are in the vicinity of the parameters which were used to create the target observations (black crosses).