FPGA implementation of an adaptable-size neural network