After converting all the centroid clusters into encoded matrices, the next step was to train the neural network using PyTorch. First, data was loaded and grouped into batches. Although slower, we found that a batch size of 32 for training data was best. Training was performed on the University of Arizona Ocelote High Performance Computer (HPC) system using a single Nvidia P100 graphics processing unit (GPU). Training took under an hour on the HPC, but it could be done overnight on a laptop with a GPU. The neural network was set up as a simple two-layer model. First, the 50×N encoding matrix (Figure and) was flattened into the input vector (Figure ). This was then passed through a linear neural network (Figure , Operation 1) to a hidden layer vector of the same length, 50×N. A rectified linear unit (ReLU) operation was then performed on the hidden layer, which simply sets the values below 0 to 0 (Figure ). Finally, a second linear network (Figure , Operation 2) was used with an output dimension of 50. The location of the highest value in the output vector (Figure ) was returned as the charge state.