Package org.apache.sysds.hops.estim
Class EstimatorSample
java.lang.Object
org.apache.sysds.hops.estim.SparsityEstimator
org.apache.sysds.hops.estim.EstimatorSample
This estimator implements an approach based on row/column sampling
Yongyang Yu, MingJie Tang, Walid G. Aref, Qutaibah M. Malluhi, Mostafa M. Abbas, Mourad Ouzzani:
In-Memory Distributed Matrix Computation Processing and Optimization. ICDE 2017: 1047-1058
The basic idea is to draw random samples of aligned columns SA and rows SB,
and compute the output nnz as max(nnz(SA_i)*nnz(SB_i)). However, this estimator is
biased toward underestimation as the maximum is unlikely sampled and collisions are
not accounted for. Accordingly, we also support an extended estimator that relies
on similar ideas for element-wise addition as the other estimators.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sysds.hops.estim.SparsityEstimator
SparsityEstimator.OpCode -
Field Summary
Fields inherited from class org.apache.sysds.hops.estim.SparsityEstimator
MIN_PAR_THRESHOLD, MULTI_THREADED_BUILD, MULTI_THREADED_ESTIM -
Constructor Summary
ConstructorsConstructorDescriptionEstimatorSample(double sampleFrac) EstimatorSample(double sampleFrac, boolean extended) -
Method Summary
Modifier and TypeMethodDescriptionEstimates the output sparsity of a DAG of matrix multiplications for the given operator graph of a single root node.doubleEstimates the output sparsity for a given unary operation.doubleestim(MatrixBlock m1, MatrixBlock m2) Estimates the output sparsity for a single matrix multiplication.doubleestim(MatrixBlock m1, MatrixBlock m2, SparsityEstimator.OpCode op) Estimates the output sparsity for a given binary operation.
-
Constructor Details
-
EstimatorSample
public EstimatorSample() -
EstimatorSample
public EstimatorSample(double sampleFrac) -
EstimatorSample
public EstimatorSample(double sampleFrac, boolean extended)
-
-
Method Details
-
estim
Description copied from class:SparsityEstimatorEstimates the output sparsity of a DAG of matrix multiplications for the given operator graph of a single root node.- Specified by:
estimin classSparsityEstimator- Parameters:
root- DAG root node- Returns:
- output data characteristics
-
estim
Description copied from class:SparsityEstimatorEstimates the output sparsity for a single matrix multiplication.- Specified by:
estimin classSparsityEstimator- Parameters:
m1- left-hand-side operandm2- right-hand-side operand- Returns:
- sparsity
-
estim
Description copied from class:SparsityEstimatorEstimates the output sparsity for a given binary operation.- Specified by:
estimin classSparsityEstimator- Parameters:
m1- left-hand-side operandm2- right-hand-side operandop- operator code- Returns:
- sparsity
-
estim
Description copied from class:SparsityEstimatorEstimates the output sparsity for a given unary operation.- Specified by:
estimin classSparsityEstimator- Parameters:
m- left-hand-side operandop- operator code- Returns:
- sparsity
-