Allows to use Criterion seamlessly in nngraph.