Pipe p2 = new TestCRF2String();
// first do normal training for getting weights
InstanceList instances = new InstanceList(p);
instances.addThruPipe(new ArrayIterator(data));
InstanceList[] lists = instances.split(new double[] { .5, .5 });
CRF crf = new CRF(p, p2);
crf.addFullyConnectedStatesForLabels();
crf.setWeightsDimensionAsIn(lists[0], false);
CRFTrainerByStochasticGradient crft = new CRFTrainerByStochasticGradient(
crf, 0.0001);