In this paper, we first apply cosine radial basis function neural networks to solve the fractional differential equations with initial value problems or boundary value problems. In the examples, we successfully obtained the numerical solutions for the fractional Riccati equations and fractional Langevin equations. The computer graphics and numerical solutions show that this method is very effective.