Vertical cavity surface-emitting laser (VCSEL)-based optical interconnects (OI) are crucial for high-speed data transmission in data centers, supercomputers, and vehicles, yet their performance is challenged by harsh and fluctuating thermal conditions. This paper addresses these challenges by integrating an ordinary differential equation (ODE) solver within the VCSEL communication chain, leveraging the adjoint method to enable effective gradient-based optimization of pre-equalizer weights. We propose a machine learning (ML) approach to optimize feed-forward equalizer (FFE) weights for VCSEL transceivers, which significantly enhances signal integrity by managing inter-symbol interference (ISI) and reducing the symbol error rate (SER).