Modeling and Optimization of Emerging Technology-Based Artificial Intelligence Accelerators under Imperfections