A Deep Learning Approach to State Estimation and Bad Data Detection