Structural Learning with Amortized Inference