Optimizing Deep Neural Networks Performance: Efficient Techniques For Training And Inference