Classification problems are a crucial aspect of modern astronomy, as large-scale surveys generate huge datasets that require accurate and efficient categorization. This motivates the application of machine learning algorithms to these problems, which can identify important patterns in datasets that can be used for fast and accurate predictions. This thesis aims to investigate how well simple neural networks can be trained in PyTorch to predict galaxy subclasses from optical spectra. The data used in this project was collected from the eighteenth data release of the Sloan Digital Sky Survey (SDSS). The main algorithm created was a convolutional neural network that was trained on a dataset of 40,800 SDSS galaxy spectra. The highest-performing model reached an accuracy of 84%. While this is a satisfactory result, given the constraints of this study, there was considerable confusion between the subclasses that was not able to be resolved by increasing the complexity of the models. That leads to the conclusion that the biggest limitations to performance most likely originate from the dataset or its spectral subclass definitions.