We have developed a rotational invariant convolutional neural network to discriminate between true transients and bogus events in astronomical images. We use a visualization approach to interpret the results of the convolutional neural network. In addition we developed a recurrent convolutional neural network to classify different classes of astronomical objects based on sequences of images. To train the classifier we simulated sequences of images using realistic observational conditions. To test the results we used real data from the HiTS survey. The fact that our classifier works well on real images having been trained on simulated ones, encourages us to use the proposed method to train classifiers for the telescopes under construction such as the Large Synoptic Survey Telescope.