@@ -0,0 +1,1919 @@
+package edu.neu.ccs.pyramid.data_formatter.mnist;%0A%0Aimport edu.neu.ccs.pyramid.configuration.Config;%0Aimport edu.neu.ccs.pyramid.dataset.*;%0A%0Aimport java.io.File;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Created by chengli on 10/21/14.%0A */%0Apublic class Formatter %7B%0A    private static final Config config = new Config(%22configs/local.config%22);%0A    private static final String DATASETS = config.getString(%22input.datasets%22);%0A    private static final String TMP = config.getString(%22output.tmp%22);%0A    public static void main(String%5B%5D args) throws Exception%7B%0A        dumpTrain();%0A        dumpTest();%0A%0A    %7D%0A%0A    private static void dumpTrain() throws Exception%7B%0A        File featureFile = new File(DATASETS,%22mnist/training_image.txt%22);%0A        File labelFile = new File(DATASETS,%22mnist/training_label.txt%22);%0A        ClfDataSet dataSet = StandardFormat.loadClfDataSet(10, featureFile, labelFile, %22,%22, DataSetType.CLF_DENSE);%0A        List%3CString%3E extLabels = new ArrayList%3C%3E();%0A        for (int i=0;i%3C10;i++)%7B%0A            extLabels.add(%22%22+i);%0A        %7D%0A%0A        LabelTranslator labelTranslator = new LabelTranslator(extLabels);%0A        DataSetUtil.setLabelTranslator(dataSet,labelTranslator);%0A        TRECFormat.save(dataSet, new File(TMP, %22train.trec%22));%0A    %7D%0A%0A    private static void dumpTest() throws Exception%7B%0A        File featureFile = new File(DATASETS,%22mnist/testing_image.txt%22);%0A        File labelFile = new File(DATASETS,%22mnist/testing_label.txt%22);%0A        ClfDataSet dataSet = StandardFormat.loadClfDataSet(10, featureFile, labelFile, %22,%22, DataSetType.CLF_DENSE);%0A        List%3CString%3E extLabels = new ArrayList%3C%3E();%0A        for (int i=0;i%3C10;i++)%7B%0A            extLabels.add(%22%22+i);%0A        %7D%0A%0A        LabelTranslator labelTranslator = new LabelTranslator(extLabels);%0A        DataSetUtil.setLabelTranslator(dataSet,labelTranslator);%0A        TRECFormat.save(dataSet, new File(TMP, %22test.trec%22));%0A    %7D%0A%7D%0A

add Formatter for mnist