Semi-supervised deep learning model to optimally charge and discharge the batteries of electric cars and balance distribution of electrical energy in the power grid.