Generative Models for Structured Discrete Data with Application to Drug Discovery