public void testEncode() {
// train (and test) a network
MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
FreeformNetwork trainedNetwork = NetworkUtil.createXORFreeformNetworkUntrained();
MLTrain bprop = new FreeformResilientPropagation(trainedNetwork, trainingData);
NetworkUtil.testTraining(trainingData,bprop,0.01);
trainedNetwork = (FreeformNetwork) bprop.getMethod();
// allocate space to encode to
double[] encoded = new double[trainedNetwork.encodedArrayLength()];
// encode the network