Neural network aided reference voltage adaptation for NAND flash memory