Transformer model with locally aware for calculus equation solving
Aiming at the problem that local information is very important in the symbolic computation of mathematical expressions,while Transformer model usually has the problem of local missing and thus ignoring the semantic information between characters,a symbolic computation model Conv1d_Transformer combining one-dimensional convolution(Conv1d)and Transformer is proposed.The model can effectively enhance local aware by introducing convolutional networks into the embedding layer to extract local feature information.In addition,an algorithm for generating a class of partial differential equation datasets is proposed,which combines the method of characteristics line and the ordinary differential equation transformation.It can realize the solution of first-order linear with constant coefficients(pde1_cc),first-order linear with variable coefficients(pde1_vc),as well as second-order parabolic partial differential equations that satisfy certain conditions(parapde2_cc).The experimental results show that the Conv1d_Transformer model is more accurate compared with Transformer model in function integration task,and achieves an accuracy of 96.00%,77.18%and 86.18%in solving the pde1_cc,pde1_vc and parapde2_cc problems,respectively.It outperforms the Mathematica and SymPy mathematical solvers.
symbolic computationone-dimensional convolutionfunction integraldifferential equationmethod of characteristic line