Heuristic-based automatic pruning of deep neural networks