Accelerated Ternarized Deep Neural Network by sparse matrix calculation