refactor deep_learning_analyzer.py to cut some code duplication