Solar energetic particles (SEPs) can cause severe damage to astronauts and sensitive equipment in space, and can disrupt communications on Earth. A lack of thorough understanding the eruption processes of solar activities and the subsequent acceleration and transport processes of energetic particles makes it difficult for physics-based models to forecast the occurrence of an SEP event and its intensity. Therefore, in order to provide an advance warning for astronauts to seek shelter in a timely manner, we apply neural networks to forecast the intensity of SEP events. The neural network uses a time series of past and current electron and proton flux in 5-minute intervals to predict future proton flux 30 minutes or 1 hour ahead. In addition to regular neural networks, we also use recurrent neural networks (RNNs), which are designed to handle time series data. For each model, we consider two approaches: a single model trained on all data, and the ensemble of models where the particular model is selected dynamically for each input using the predicted behavior of the input data. Overall, our results indicate that a single RNN model forecasts proton flux of each event with less error. Furthermore, the RNN model incurs less error in predicting proton flux, but a larger lag, than the forecasting matrix method proposed by Posner (2007). When advance and extended warnings are incorporated, the RNN model can improve SEP event prediction scores.