Build a simple CRF with Chainer,aiming at denoising binary images. The CRF model is trained with gradient based approach.
The loss function is pseudo-likelihood (partition function is approximated). Read section 5.9 of 'Structured Learning and Prediction in Computer Vision' for reference.