What game are we playing? End-to-end learning in normal and extensive form games