Accelerating convolutional neural networks on an FPGA