On Resource-Efficient Bayesian Network Classifiers and Deep Neural Networks