Added predict function for deep net.