Skip to content

Instantly share code, notes, and snippets.

@mindcrime
Created February 26, 2017 20:28
Show Gist options
  • Save mindcrime/1f16788a8330b746fbf187d332f932bf to your computer and use it in GitHub Desktop.
Save mindcrime/1f16788a8330b746fbf187d332f932bf to your computer and use it in GitHub Desktop.
manual invocation of the preprocessor
JavaRDD<DataSet> unscaledData = rdd.map(new DataVecDataSetFunction(1,10, false, null, null ));
JavaRDD<DataSet> trainingData = unscaledData.map( new Function<DataSet,DataSet>() {
DataNormalization scaler = new ImagePreProcessingScaler(0,1);
@Override
public DataSet call(DataSet v1) throws Exception {
DataSet newDS = new DataSet( v1.getFeatures(), v1.getLabels());
scaler.preProcess(newDS);
return newDS;
}} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment