## 3 Application and Results
### Particle Waveform Data FPGA Forward Inference Module  
The premise of the FPGA forward extrapolation of particle waveform data is the correctness of the derived weight data. The same forward extrapolation model is constructed using Pytorch and MATLAB (1.0.0) to compute the arbitrarily selected neutron and gamma data, and the two are compared to determine whether the output parameters are correct. The results of the comparison are shown in Table 4. \begin{table}
\begin{tabular}{c c} \hline \hline
**MATLAB** & **Pytorch** \\ \hline
2.0075, \(-\)3.8455 & 2.0075, \(-\)3.8455 \\
1.1923, \(-\)3.0042 & 1.1923, \(-\)3.0042 \\ \(-\)8.7143, 7.0735 & \(-\)8.7143, 7.0735 \\ \(-\)10.65, 9.2606 & \(-\)10.65, 9.2606 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: MATLAB vs. Pytorch calculation comparison table. Figure 12: Training and validation set computation results. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Batchsize** & **Lr** & **Dropout_rate** & **Accuracy** \\ \hline
128 & 0.0026 & 0.119732 & 0.9783 \\
128 & 0.0028 & 0.093131 & 0.978 \\
64 & 0.0061 & 0.405455 & 0.978 \\
128 & 0.0025 & 0.10884 & 0.976 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Optimal search results table. The Pytorch and MATLAB calculations are in perfect agreement. The overall framework is constructed using vivado, which includes convolutional layer 1, pooling layer 1, convolutional layer 2, pooling layer 2, convolutional layer 3, and fully connected layers. The number of DSP modules required per layer is shown in Table 5.  
Based on the content of Formulas (5) and (8), in convolution layer 1, the convolution kernel operates serially with \(k1=1\), the sliding window computes 64 elements simultaneously with \(n1=64\), and two output channels are computed simultaneously with \(m1=2\). In convolution layer 2, the convolution kernel operates serially with \(k2=1\), the sliding window computes 32 elements simultaneously with \(n2=32\), and two output channels are computed simultaneously with \(m2=2\). In convolution layer 3, the convolution kernel operates serially with \(k3=1\), the sliding window computes 16 elements simultaneously with \(n3=16\), and two output channels are computed simultaneously with \(m3=2\). In the fully connected layer, eight multiplications are performed per clock cycle with DSPmuti = 8, and there are two output categories with DSPoutputmode = 2. Comparison shows that the number of calculated DSPs is the same as the actual number of occupied DSPs. The required extrapolation time is calculated as shown in Table 6.  
In Table 6, \(b1\) represents the clock cycles for the first convolution layer used for synchronizing data or bias calculations. \(c1\) represents the clock cycles for the first pooling layer used for synchronizing data. \(b2\) represents the clock cycles for the second convolution layer used for synchronizing data or bias calculations. \(c2\) represents the clock cycles for the second pooling layer used for synchronizing data. \(b3\) represents the clock cycles for the third convolution layer used for synchronizing data or bias calculations. k represents the clock cycles for the fully connected layer used for synchronizing data. The above data are all determined by the actual program. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Network Layer** & **Theoretical Calculation Formula** & \ \begin{tabular}{c} **Time Required for Simulation** \\ **(CLK\_100M)** \\ \end{tabular}  & \begin{tabular}{c} **Actual Time Required** \\ **(CLK\_100M)** \\ \end{tabular}  \\ \hline First convolution layer & \(\begin{array}{c}\text{\ \  
In convolution layer 1, the convolution kernel operates serially, requiring three clock cycles (\(x1=3\)), with one input channel (\(y1=1\)). The sliding window computation requires two passes (\(z1=2\)), and the output channel computation also requires two passes (\(a1=2\)). For pooling layer 1, the pooling operation requires one clock cycle (\(clkpool=1\)), with input channels operating serially over four cycles (\(clkchannel=4\)).