
translating the weight or structure of a network to a new environment with reduced precision or
increased noise is as problematic as it is the biological counterpart of a head transplant. By
carefully designing neural networks based on their computing environment (digital, analog, or
physical), a significant improvement in the model’s generalizability, accuracy, and ability to learn
the crucial features of the dataset can be seen [17]. For analog DNN accelerators, this can be done
by implementing models on-chip for different hyperparameter combinations and testing each of
them, but this is time-consuming and costly to do. To overcome this problem, we can simulate
computation in the analog domain and test against various hyperparameters virtually. It has already
been shown that even a crude simulation of the target domain can overcome much of the accuracy
and generalizability problems [17], [18].
We have developed the Analog Virtual Neural Network (AnalogVNN) framework [19] to
do exactly this. Distinct from other approaches which typically focus on modeling the physical
response of the analog hardware in question [8], [17], [18], [20]–[22], we have chosen to abstract
the physical properties of the analog hardware and instead model the effects an ensemble of analog
computing elements at a higher level (i.e., normalization, limited precision, stochastic rounding,
and additive noise). This approach greatly simplifies the translation of digital neural network
models to the analog domain, while minimizing the additional computational overhead required to
model analog hardware as illustrated in Figure 1a. We have built AnalogVNN on PyTorch [23] to
easily simulate the effects of optoelectronic noise, limited precision, and signal normalization
present in all photonic analog hardware. While we have designed the AnalogVNN framework with
photonic hardware in mind (e.g., coherent [11], [24], electro-absorptive [25], phase-change [26],
microring resonator [27], and dispersive fiber-based architectures [12] as illustrated in Figure 1b),
the generality of our approach allows all researchers to easily extend our work to other analog
neural networks, such as those based on electronic, magnetic, or spintronic hardware [8], [9], [28]–
[30].
The repository for AnalogVNN is available at https://analogvnn.github.io
Sample code: https://analogvnn.github.io/sample_code
II. The Analog Virtual Neural Network (AnalogVNN) Methodology
The photonic analog domain differs from the digital domain in two major ways. First, one
has to account for continuous variability due to added noise from physical processes and second,
the precision is typically limited by photon shot noise to 8-bits or less for the optical powers and
modulation speeds of interest [31]. In the case of photonic weights, physical processes such as
thermal drift in microring resonators or stochastic effects in the programming of phase-change
photonic memory, introduce stochastic noise to the weight matrix. Photonic analog inputs, on the
other hand, have been limited to even lower precision in practice (e.g., 4-bit for PAM-16
modulators). As high-speed optical modulators have primarily targeted telecommunication
applications, they are typically designed to generate a limited set of optical amplitudes which