Analog nonvolatile memory for neural network implementations