Search in sources :

Example 1 with IterativeWeightVectorReduceFunction

use of edu.iu.dsc.tws.examples.ml.svm.aggregate.IterativeWeightVectorReduceFunction 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();
}
Also used : IterativeDataStream(edu.iu.dsc.tws.examples.ml.svm.streamer.IterativeDataStream) IterativeWeightVectorReduceFunction(edu.iu.dsc.tws.examples.ml.svm.aggregate.IterativeWeightVectorReduceFunction) IterativeSVMWeightVectorReduce(edu.iu.dsc.tws.examples.ml.svm.aggregate.IterativeSVMWeightVectorReduce) ComputeConnection(edu.iu.dsc.tws.task.impl.ComputeConnection)

Aggregations

IterativeSVMWeightVectorReduce (edu.iu.dsc.tws.examples.ml.svm.aggregate.IterativeSVMWeightVectorReduce)1 IterativeWeightVectorReduceFunction (edu.iu.dsc.tws.examples.ml.svm.aggregate.IterativeWeightVectorReduceFunction)1 IterativeDataStream (edu.iu.dsc.tws.examples.ml.svm.streamer.IterativeDataStream)1 ComputeConnection (edu.iu.dsc.tws.task.impl.ComputeConnection)1