Search in sources :

Example 16 with CM_COV_Object

use of org.apache.sysml.runtime.instructions.cp.CM_COV_Object in project incubator-systemml by apache.

the class CMCOVMRReducer method configure.

@Override
public void configure(JobConf job) {
    super.configure(job);
    try {
        cmNcovInstructions = MRJobConfiguration.getCM_N_COVInstructions(job);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    rlens = new HashMap<>();
    clens = new HashMap<>();
    for (CM_N_COVInstruction ins : cmNcovInstructions) {
        if (ins.getOperator() instanceof COVOperator)
            covTags.add(ins.input);
        else
            // CMOperator
            cmFn.put(ins.input, CM.getCMFnObject(((CMOperator) ins.getOperator()).getAggOpType()));
        outputIndexesMapping.put(ins.output, getOutputIndexes(ins.output));
        rlens.put(ins.input, MRJobConfiguration.getNumRows(job, ins.input));
        clens.put(ins.input, MRJobConfiguration.getNumColumns(job, ins.input));
    }
    zeroObj = new CM_COV_Object();
    zeroObj.w = 1;
}
Also used : CM_N_COVInstruction(org.apache.sysml.runtime.instructions.mr.CM_N_COVInstruction) CM_COV_Object(org.apache.sysml.runtime.instructions.cp.CM_COV_Object) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) COVOperator(org.apache.sysml.runtime.matrix.operators.COVOperator) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException) IOException(java.io.IOException)

Example 17 with CM_COV_Object

use of org.apache.sysml.runtime.instructions.cp.CM_COV_Object in project incubator-systemml by apache.

the class MVImputeAgent method decodeCMObj.

private CM_COV_Object decodeCMObj(String s) {
    CM_COV_Object obj = new CM_COV_Object();
    String[] parts = s.split(",");
    obj.w = UtilFunctions.parseToDouble(parts[0]);
    obj.mean._sum = UtilFunctions.parseToDouble(parts[1]);
    obj.mean._correction = UtilFunctions.parseToDouble(parts[2]);
    obj.m2._sum = UtilFunctions.parseToDouble(parts[3]);
    obj.m2._correction = UtilFunctions.parseToDouble(parts[4]);
    return obj;
}
Also used : CM_COV_Object(org.apache.sysml.runtime.instructions.cp.CM_COV_Object)

Aggregations

CM_COV_Object (org.apache.sysml.runtime.instructions.cp.CM_COV_Object)17 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)10 KahanObject (org.apache.sysml.runtime.instructions.cp.KahanObject)8 CM (org.apache.sysml.runtime.functionobjects.CM)6 KahanPlus (org.apache.sysml.runtime.functionobjects.KahanPlus)4 CMOperator (org.apache.sysml.runtime.matrix.operators.CMOperator)4 Builtin (org.apache.sysml.runtime.functionobjects.Builtin)3 IOException (java.io.IOException)2 SparkExecutionContext (org.apache.sysml.runtime.controlprogram.context.SparkExecutionContext)2 KahanPlusSq (org.apache.sysml.runtime.functionobjects.KahanPlusSq)2 Mean (org.apache.sysml.runtime.functionobjects.Mean)2 ReduceAll (org.apache.sysml.runtime.functionobjects.ReduceAll)2 ReduceCol (org.apache.sysml.runtime.functionobjects.ReduceCol)2 ReduceDiag (org.apache.sysml.runtime.functionobjects.ReduceDiag)2 ReduceRow (org.apache.sysml.runtime.functionobjects.ReduceRow)2 DoubleObject (org.apache.sysml.runtime.instructions.cp.DoubleObject)2 MatrixBlock (org.apache.sysml.runtime.matrix.data.MatrixBlock)2 MatrixIndexes (org.apache.sysml.runtime.matrix.data.MatrixIndexes)2 WeightedCell (org.apache.sysml.runtime.matrix.data.WeightedCell)2 AggregateOperator (org.apache.sysml.runtime.matrix.operators.AggregateOperator)2