Allows Criterion to be used in nngraph as part of graph.