Optimal staggered-grid finite-difference method for wave modeling based on artificial neural networks