Programmable non-linearity for neural networks applications