neural network confidence computation routines