Code for collective stability max-margin Markov network learning