Add error calculation in ann