Programmable photonic integrated circuits (PPICs), as optical analog matrix multipliers, emerge as a leading candidate of a revolutionary technology. However, the efficient voltage configuration of programmable devices in the circuit presents a significant challenge to its development. Here, we propose a black-box method based on tandem neural network to rapidly predict the voltage configuration of arbitrary matrices. We experimentally demonstrate the feasibility of our method on a 4 × 4 PPIC, achieving the average fidelity of 0.989 for 10,000 matrices. Furthermore, we experimentally implement an optical-electric hybrid model based on our method, obtaining a training accuracy of 97.59% on the MNIST dataset.