use of edu.iu.dsc.tws.examples.ml.svm.streamer.IterativeDataStream in project twister2 by DSC-SPIDAL.
the class SvmSgdIterativeRunner method buildSvmSgdIterativeTrainingTG.
private ComputeGraph buildSvmSgdIterativeTrainingTG() {
iterativeDataStream = new IterativeDataStream(this.svmJobParameters.getFeatures(), this.operationMode, this.svmJobParameters.isDummy(), this.binaryBatchModel);
iterativeSVMRiterativeSVMWeightVectorReduce = new IterativeSVMWeightVectorReduce(this.operationMode);
trainingBuilder.addSource(Constants.SimpleGraphConfig.ITERATIVE_DATASTREAMER_SOURCE, iterativeDataStream, dataStreamerParallelism);
ComputeConnection svmComputeConnection = trainingBuilder.addCompute(Constants.SimpleGraphConfig.ITERATIVE_SVM_REDUCE, iterativeSVMRiterativeSVMWeightVectorReduce, dataStreamerParallelism);
svmComputeConnection.allreduce(Constants.SimpleGraphConfig.ITERATIVE_DATASTREAMER_SOURCE).viaEdge(Constants.SimpleGraphConfig.REDUCE_EDGE).withReductionFunction(new IterativeWeightVectorReduceFunction()).withDataType(MessageTypes.DOUBLE_ARRAY);
trainingBuilder.setMode(operationMode);
trainingBuilder.setTaskGraphName(IterativeSVMConstants.ITERATIVE_TRAINING_TASK_GRAPH);
return trainingBuilder.build();
}
Aggregations