## 2 Materials and Methods  
### System Architecture  
Figure 1 shows the schematic diagram of a cascaded laser system composed of two semiconductor lasers. One laser is subjected to optical feedback and it is named the drive laser (LD-1 in Figure 1). The output of the drive laser is injected into the other laser, which is called the response laser (LD-2 in Figure 1). The Lang-Kobayashi (LK) model is always used to describe semiconductor lasers with optical feedback, and the rate equations are as follows:  
\[\frac{dE_{\rm D}(t)}{dt}=\frac{1}{2}(1+i\alpha_{\rm D})\Bigg{\{}\frac{G[N_{\rm D }(t)-N_{0}]}{1+\varepsilon|E_{\rm D}(t)|^{2}}-\frac{1}{\tau_{\rm P}}\Bigg{\}}E _{\rm D}(t)+\kappa_{\rm D}E_{D}(t-\tau)e^{-i\omega\tau}+\sqrt{2\beta_{sp}}\xi, \tag{1}\]  
\[\frac{dN_{\rm D}(t)}{dt}=\frac{I_{\rm D}}{{\rm q}V}-\frac{1}{\tau_{\rm n}}N_{ \rm D}(t)-\frac{G[N_{\rm D}(t)-N_{0}]}{1+\varepsilon|E_{\rm D}(t)|^{2}}|E_{ \rm D}(t)|^{2}, \tag{2}\]  
\[\frac{dE_{\rm R}(t)}{dt}=\frac{1}{2}(1+i\alpha_{\rm R})\Bigg{\{}\frac{G[N_{ \rm R}(t)-N_{0}]}{1+\varepsilon|E_{\rm R}(t)|^{2}}-\frac{1}{\tau_{\rm P}} \Bigg{\}}E_{\rm R}(t)+\kappa_{\rm R}E_{\rm D}(t)e^{-i\omega t}+\sqrt{2\beta_{ sp}}\xi, \tag{3}\]  
\[\frac{dN_{\rm R}(t)}{dt}=\frac{I_{\rm R}}{{\rm q}V}-\frac{1}{\tau_{\rm n}}N_{ \rm R}(t)-\frac{G[N_{\rm R}(t)-N_{0}]}{1+\varepsilon|E_{\rm R}(t)|^{2}}|E_{ \rm R}(t)|^{2}, \tag{4}\]  
where \(E_{\rm D}(t)\) and \(E_{\rm R}(t)\) in Equations (1) and (3) represent the slowly varying electric field amplitude of the drive laser and response laser, respectively, and \(N_{\rm D}(t)\) and \(N_{\rm R}(t)\) in Equations (2) and (4) denote the carrier density of two lasers, respectively. \(\kappa_{\rm D}\) is the feedback strength of the drive laser, and \(\kappa_{\rm R}\) is the injection strength of the response laser. \(I_{\rm D}\) and \(I_{\rm R}\) denote the pump current of two lasers, respectively, and \(\alpha_{\rm D}\) and \(\alpha_{\rm R}\) represent the linewidth enhancement factor of the drive laser and response laser, respectively. \(\beta_{sp}=10^{-4}\) ns\({}^{-1}\) is  
Figure 1: Schematic illustration of two cascaded photonic neurals. the noise strength, and \(\xi\) is a Gaussian distribution with zero mean and unit variance. The physical meaning and values of the remaining parameters are shown in Table 1.  
As is well-known, with different system parameters, such as the pump current \(I_{\rm D}\) and the feedback strength \(\kappa_{\rm D}\), the semiconductor laser with optical feedback can generate rich dynamic behaviors. When \(I_{\rm D}\) is 15 mA, which is near the threshold (14.6 mA in our model) and \(\kappa_{\rm D}\) is small (10 ns\({}^{-1}\) for instance), the output of the laser exhibits random oscillations and belongs to the coherent collapse, as shown in Figure 2a. Moreover, when \(I_{\rm D}\) is near the threshold and \(\kappa_{\rm D}\) is relatively large (50 ns\({}^{-1}\) for instance), the output of the laser contains abrupt power dropouts, which have certain probabilistic characteristics, as shown in Figure 2b. At this time, the output of the laser belongs to the LFF waveform. In addition, when \(I_{\rm D}\) is higher than the threshold current (22 mA for instance), the output of the laser belongs to the coherent collapse, no matter whether the feedback strength \(\kappa_{\rm D}\) is big or small, as shown in Figure 2c,d. Therefore, to generate the LFF dynamic, the pump current should be near the threshold, and the feedback strength should be relatively large. In the rest of this paper, \(I_{\rm D}\) is set to be 15 mA and \(\kappa_{\rm D}\) is set to be 50 ns\({}^{-1}\).