# Stochastic Memristor Modeling Framework Based on Physics-Informed Neural Networks
## 4 Result and Discussion
The red solid line represents the maximum probability point over time. The noise-free state exhibits a similar shape to the maximum point of the probability density over time. When \(\Gamma=1\times 10^{-2}\) is applied in the noise-free state, the random fluctuations converge within the contours of the probability density function. Consequently, Figures 8a and 9a represent experimental data [22] under various voltage conditions. These experimental data exhibit random fluctuations within the contours in the PINN. The probability density function has a probability close to 1 under initial conditions, similar to a sinusoidal simulation in a pulse simulation, and this probability decreases over time. This means that in Figure 9b, the probability of deviating from the outline increases over time. As a result, this demonstrates that the results can be interpreted in the context of noise under various voltage conditions, including those with different sinusoidal components. Figure 8: In sinusoidal conditions, stochasticity in Equation (2) and probability variation due to noise: (**a**) random states depending on the time at \(\Gamma=1\times 10^{-2}\) s\({}^{-1}\); (**b**) two-dimensional contour plot for PINN. Figure 7: Comparison of loss functions for various activation functions: (**a**) Gaussian function; (**b**) sigmoid function; (**c**) hyperbolic tangent function. Numerical solutions of PDEs with noise are difficult to apply in circuit simulators. However, the weights and biases obtained from PINNs can be implemented in the circuit simulators using the simple operations of Equations (11)-(13). Moreover, the properties of the probability density function are calculated through the operations in Equations (15) and (16). The expressions as a function of weights and biases obtained from the PINN can be implemented into Verilog-A. Table 1 provides a pseudo-code for Verilog-A simulation, which consists of a simple circuit with a two-terminal structure. I-V curves are obtained by using the mean and standard deviation implemented by PINN. The results of I-V curves are shown in Figure 10. The blue area represents the broadening of I-V obtained by applying \(\sigma\) of the probability density function in the PINN. The black solid line represents I-V curves for the maximum probability at each time point in the PINN solution. The stochasticity of I-V derived from Equation (2) is illustrated by the pink solid lines. The dashed line represents the I-V experiment data averaged over 100 realizations of the stochastic process [22]. As shown in Figure 10, all stochastic I-V curves are located within \(\pm 3\sigma\) of the probability distribution, including experimental data. \begin{table}
\begin{tabular}{l} \hline module memristor\_noise\_model(p,n); \\ // inout, input and electrical declarations \\ analog begin \\ // First and second hidden layer calculations in (11) and (12), 20 neurons \\ h11 = exp (\(-\)(wx1 \(*\) x \(+\) wt1 \(*\) t \(+\) \(\ldots\) \(+\) b11) \(*\) 2); \\... \\ h21 = exp (\(-\)(w211 \(*\) h11 \(+\) w221 \(*\) h12 \(+\) \(\ldots\) \(+\) b21) \(**\) 2); \\... \\ // Output layer calculations in (13) \\ P\_xt = w0 \(*\) h21 \(+\) w0 \(*\) h22 \(+\) \(\ldots\) \(+\) bo1; \\ for (x length) // mean state integral \\ mean = mean + (x \(*\) P\_xt \(*\) dx); \\ for x length // standard deviation \\ variance = variance + (x\(*\)\(*\)\(2*\) P\_xt \(*\) dx); \\ sigma = sqrt(variance); \\ M = Ron \(*\) (mean \(\pm\) 3 \(*\) sigma) + Roff \(*\) (1 \(-\) (mean \(\pm\) 3 \(*\) sigma)); \\ I\_sigma = V(vin)/M; // current calculation \\ If(p,n) \(<\) + L\_sigma; \\ endmodule \\ \hline \end{tabular}
\end{table} 
Table 1: Pseudo Verilog-A code of memristor noise model. Figure 9: In pulse conditions, stochasticity in Equation (2) and probability variation due to noise: (**a**) random states depending on the time at \(\Gamma=1\times 10^{-2}\) s\({}^{-1}\); (**b**) two-dimensional contour plot for PINN.