cnnnet implementation