SlideShare a Scribd company logo
1 of 1
Download to read offline
Implementing Randomized Matrix Algorithms in Spark
XLDB 2015
Jiyan Yang1
, Jey Kottalam2
, Mohitdeep Singh3
, Oliver R¨ubel4
, Curt Fischer4
, Benjamin P. Bowen4
, Michael W. Mahoney2
, Prabhat4
1 Stanford University 2 University of California at Berkeley 3 Georgia Institute of Technology 4 Lawrence Berkeley National Laboratory
RandNLA for Least-Squares Problems
Randomized Numerical Linear Algebra (RandNLA) algorithms can be used to
solve large-scale least-squares problems. They consist of two steps. First, com-
pute a randomized sketch for the design matrix. A sketch can be viewed as a
compressed representation of the linear system. In this work, we evaluate the
following six different kinds of sketch matrices:
• Via random projection with 4 different underlying projection methods (Sparse,
Gaussian, Rademacher, SRDHT).
• Via random sampling according to approximate leverage scores or uniform
distribution.
Second, one can then use the sketch in one of the following two ways to obtain
low-precision approximate solutions or high-precision approximation solutions to
the original problem, respectively.
• Low-precision solvers: solve the subproblem induced by the sketch.
• High-precision solvers: use the sketch to construct a preconditioner and then
invoke iterative algorithms such as LSQR.
In this work, we implement these algorithms in Spark on dataset with size up
to terabytes. All the experiments are performed on a cluster with 16 nodes,
each of which has 8 CPU cores at clock rate 2.5GHz with 25GB RAM. The
following two reasons make Spark favorable in this task. First, algorithms for
computing the sketch are essentially parallel. It is straightforward to implement
in distributed and parallel environments. Second, being able to cache the data
in memory makes it fast to execute iterative algorithms.
Overall Performance of Low-precision Solvers
Here, we evaluate the low-precision solvers on the following two types of datasets:
• UB (matrices with uniform leverage scores and bad condition number);
• NB (matrices with nonuniform leverage scores and bad condition number).
Recall that, low-precision solvers obtain the solution by solving the subproblem
after computing the sketch.
103
104
sketch size
10-2
10-1
100
101
102
103
(a) x − x∗
2/ x∗
2
103
104
sketch size
10-3
10-2
10-1
100
101
PROJ CW
PROJ GAUSSIAN
PROJ RADEMACHER
PROJ SRDHT
SAMP APPR
SAMP UNIF
(b) |f − f∗
|/|f∗
|
103
104
sketch size
102
103
104
(c) Running time(sec)
1e7 × 1000 UB matrix
103
104
105
sketch size
10-2
10-1
100
101
102
103
(d) x − x∗
2/ x∗
2
103
104
105
sketch size
10-3
10-2
10-1
100
101
PROJ CW
PROJ GAUSSIAN
PROJ RADEMACHER
PROJ SRDHT
SAMP APPR
SAMP UNIF
(e) |f − f∗
|/|f∗
|
103
104
105
sketch size
102
103
104
(f) Running time(sec)
1e7 × 1000 NB matrix
Figure 1: Evaluation of low-precision solvers on 2 different types of matrices of
size 1e7 by 1000.
Performance of Low-precision Solvers When n or d Changes
We evaluate the performance of the low-precision solvers on NB matrices with
changing n or d. For a matrix with size n by d, it is generated by stacking
an NB matrix with size 2.5e5 by d vertically REPNUM = n/2.5e5 times. By
this way, the condition number remains the same. The coherence the matrix is
1/REPNUM.
106
107
108
sketch size
10-3
10-2
10-1
100
101
102
103
(a) x − x∗
2/ x∗
2
106
107
108
n
10-3
10-2
10-1
100
101
PROJ CW
PROJ GAUSSIAN
PROJ RADEMACHER
PROJ SRDHT
SAMP APPR
(b) |f − f∗
|/|f∗
|
106
107
108
n
102
103
104
(c) Running time(sec)
n ∈ [2.5e5, 1e8], d = 1000, s = 5e4
101
102
103
d
10-2
10-1
100
101
102
(d) x − x∗
2/ x∗
2
101
102
103
d
10-4
10-3
10-2
10-1
100
101
102
103
PROJ CW
PROJ GAUSSIAN
PROJ RADEMACHER
PROJ SRDHT
SAMP APPR
(e) |f − f∗
|/|f∗
|
101
102
103
d
102
103
104
(f) Running time(sec)
d ∈ [10, 2000], n = 1e7, s = 5e4
Figure 2: Performance of low-precision solvers on NB matrices with varying n
and d. For each method, the sketch size is fixed to be 5e4.
Performance of High-precision Solvers
Recall that, alternatively, one can use the sketch to construct preconditioners
and invoke iterative algorithms such as LSQR to obtain high-precision solvers.
Here, we evaluate the performance of high-precision solvers with several under-
lying randomized sketches.
2 4 6 8 10 12
number of iteration
101
10-1
10-3
(a) x − x∗
2/ x∗
2
2 4 6 8 10 12
number of iteration
10-1
10-4
10-7
10-10
10-13
(b) |f − f∗
|/|f∗
|
2 4 6 8 10 12
number of iteration
0
2500
5000
7500
NOCO
PROJ CW
PROJ GAUSSIAN
SAMP APPR
(c) Running time(sec)
small sketch size
2 4 6 8 10 12
number of iteration
101
10-1
10-3
(d) x − x∗
2/ x∗
2
2 4 6 8 10 12
number of iteration
10-1
10-4
10-7
10-10
10-13
(e) |f − f∗
|/|f∗
|
2 4 6 8 10 12
number of iteration
0
2500
5000
7500
NOCO
PROJ CW
PROJ GAUSSIAN
SAMP APPR
(f) Running time(sec)
large sketch size
Figure 3: Evaluation of LSQR with randomized preconditioner on an NB matrix
with size 1e8 by 1000 and condition number 1e6. In above, by small sketch
size, we mean 5e3 for all the methods. By large sketch size, we mean 3e5 for
PROJ CW, 1e4 for PROJ GAUSSIAN and 5e4 for SAMP APPR.
Quality of Randomized Preconditioners
After computing a sketch ΠA, R−1 acts as preconditioner for A where R is the
factor from QR decomposition of ΠA. Here we evaluate κ(AR−1).
c PROJ CW PROJ GAUSSIAN PROJ RADEMACHER PROJ SRDHT SAMP APPR
5e2 1.08e8 2.17e3 1.42e3 1.19e2 1.21e2
1e3 1.1e6 5.7366 5.6006 7.1958 75.0290
5e3 5.5e5 1.9059 1.9017 1.9857 25.8725
1e4 5.1e5 1.5733 1.5656 1.6167 17.0679
5e4 1.8e5 1.2214 1.2197 1.2293 6.9109
1e5 1.1376 1.1505 1.1502 1.1502 4.7573
Table 1: Quality of preconditioning on an NB matrix with size 1e6 by 500 using
several kinds of embeddings.
RandNLA for CX Decomposition
Given an n × d matrix A, CX decomposition decomposes A into two matrices
C and X, where C is an n × c matrix that consists of c actual columns of A,
and X is a c × d matrix such that the residual error A − CX F is as small
as possible.
The algorithm is as follows. Given A and a rank parameter k, use RandNLA
Algorithms to approximate the leverage scores associated with rank k; The
matrix C can be constructed by sampling c columns from A based on the
leverage scores associated with k; Construct X based on C.
Applications to Mass Spectrometry Imaging Analysis
Next, we show results on a real dataset. The data for this analysis is provided
by Norman Lewis’s group at Washington State Univeristy and is derived from
a MALDI-IMS-MSI analysis of a rhizome of the drug-producing green shrub
Podophyllum hexandrum.
The size of the dataset is approximately 2.5e5 by 1.6e7 (511-by-507 spatial pixels
by 460342 m/z channels by 200 ion mobility channels) which presents challenges
for analysis and interpretation. We invoked CX decomposition with RandNLA
to identify informative ions and pixels and investigate the reconstruction error
based on the selected elements in Spark using the same cluster.
453.1028(74) 615.1427(87) 342.175(62) 381.083(58)
(a) Ion-intensity visualization at 4 important m/z and τ peaks. The intensities are integrated over a small range
of m/z and τ values. The value shown in each image is m/z(τ).
303.0215(52) 303.0215(59)
(b) Ion-intensities visualization at m/z = 303.0215 and two
different τ peaks.
0 20 40 60 80 100
number of ions selected
0.15
0.25
0.35
0.45
reconstructionerror
greedy rank-c
randomized rank-c
greedy rank-15
best rank-15
(c) Reconstruction error A−CX F / A F of
CX decomposition.
Figure 4: Results of CX decomposition with RandNLA on real MSI dataset.

More Related Content

What's hot

Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...
Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...
Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...Universitat Politècnica de Catalunya
 
Computer Vision: Feature matching with RANSAC Algorithm
Computer Vision: Feature matching with RANSAC AlgorithmComputer Vision: Feature matching with RANSAC Algorithm
Computer Vision: Feature matching with RANSAC Algorithmallyn joy calcaben
 
Optimal real-time landing using DNN
Optimal real-time landing using DNNOptimal real-time landing using DNN
Optimal real-time landing using DNN홍배 김
 
Application of interpolation in CSE
Application of interpolation in CSEApplication of interpolation in CSE
Application of interpolation in CSEMd. Tanvir Hossain
 
A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...
A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...
A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...Rafael Nogueras
 
A hybrid sine cosine optimization algorithm for solving global optimization p...
A hybrid sine cosine optimization algorithm for solving global optimization p...A hybrid sine cosine optimization algorithm for solving global optimization p...
A hybrid sine cosine optimization algorithm for solving global optimization p...Aboul Ella Hassanien
 
A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...Akshit Arora
 
A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...
A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...
A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...Rafael Nogueras
 
Preemptive RANSAC by David Nister.
Preemptive RANSAC by David Nister.Preemptive RANSAC by David Nister.
Preemptive RANSAC by David Nister.Ian Sa
 
Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...
Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...
Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...Rafael Nogueras
 
REDES NEURONALES Performance Optimization
REDES NEURONALES Performance OptimizationREDES NEURONALES Performance Optimization
REDES NEURONALES Performance OptimizationESCOM
 
Optimization problems and algorithms
Optimization problems and  algorithmsOptimization problems and  algorithms
Optimization problems and algorithmsAboul Ella Hassanien
 
Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...
Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...
Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...AIST
 
A Scalable Dataflow Implementation of Curran's Approximation Algorithm
A Scalable Dataflow Implementation of Curran's Approximation AlgorithmA Scalable Dataflow Implementation of Curran's Approximation Algorithm
A Scalable Dataflow Implementation of Curran's Approximation AlgorithmNECST Lab @ Politecnico di Milano
 
Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...
Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...
Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...Rafael Nogueras
 
Sesquickselect: One and a half pivot for cache efficient selection
Sesquickselect: One and a half pivot for cache efficient selectionSesquickselect: One and a half pivot for cache efficient selection
Sesquickselect: One and a half pivot for cache efficient selectionSebastian Wild
 

What's hot (20)

Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...
Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...
Generative Models and Adversarial Training (D2L3 Insight@DCU Machine Learning...
 
Computer Vision: Feature matching with RANSAC Algorithm
Computer Vision: Feature matching with RANSAC AlgorithmComputer Vision: Feature matching with RANSAC Algorithm
Computer Vision: Feature matching with RANSAC Algorithm
 
Optimal real-time landing using DNN
Optimal real-time landing using DNNOptimal real-time landing using DNN
Optimal real-time landing using DNN
 
Application of interpolation in CSE
Application of interpolation in CSEApplication of interpolation in CSE
Application of interpolation in CSE
 
A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...
A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...
A Performance Analysis of Self-* Evolutionary Algorithms on Networks with Cor...
 
A hybrid sine cosine optimization algorithm for solving global optimization p...
A hybrid sine cosine optimization algorithm for solving global optimization p...A hybrid sine cosine optimization algorithm for solving global optimization p...
A hybrid sine cosine optimization algorithm for solving global optimization p...
 
A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...A multilevel automatic thresholding method based on a genetic algorithm for a...
A multilevel automatic thresholding method based on a genetic algorithm for a...
 
Nonnegative Matrix Factorization with Side Information for Time Series Recove...
Nonnegative Matrix Factorization with Side Information for Time Series Recove...Nonnegative Matrix Factorization with Side Information for Time Series Recove...
Nonnegative Matrix Factorization with Side Information for Time Series Recove...
 
A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...
A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...
A Study of the Performance of Self-* Memetic Algorithms on Heterogeneous Ephe...
 
Preemptive RANSAC by David Nister.
Preemptive RANSAC by David Nister.Preemptive RANSAC by David Nister.
Preemptive RANSAC by David Nister.
 
Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...
Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...
Sensitivity Analysis of Checkpointing Strategies for Multimemetic Algorithms ...
 
AbdoSummerANS_mod3
AbdoSummerANS_mod3AbdoSummerANS_mod3
AbdoSummerANS_mod3
 
REDES NEURONALES Performance Optimization
REDES NEURONALES Performance OptimizationREDES NEURONALES Performance Optimization
REDES NEURONALES Performance Optimization
 
Fourier Transform Assignment Help
Fourier Transform Assignment HelpFourier Transform Assignment Help
Fourier Transform Assignment Help
 
Optimization problems and algorithms
Optimization problems and  algorithmsOptimization problems and  algorithms
Optimization problems and algorithms
 
Signal Processing Assignment Help
Signal Processing Assignment HelpSignal Processing Assignment Help
Signal Processing Assignment Help
 
Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...
Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...
Елена Малютина - Оценка параметров хаотического процесса с помощью Ukf-фильтр...
 
A Scalable Dataflow Implementation of Curran's Approximation Algorithm
A Scalable Dataflow Implementation of Curran's Approximation AlgorithmA Scalable Dataflow Implementation of Curran's Approximation Algorithm
A Scalable Dataflow Implementation of Curran's Approximation Algorithm
 
Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...
Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...
Self-sampling Strategies for Multimemetic Algorithms in Unstable Computationa...
 
Sesquickselect: One and a half pivot for cache efficient selection
Sesquickselect: One and a half pivot for cache efficient selectionSesquickselect: One and a half pivot for cache efficient selection
Sesquickselect: One and a half pivot for cache efficient selection
 

Similar to RandNLA Matrix Implementing Randomized Matrix Algorithms in Spark

Learning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for GraphsLearning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for Graphspione30
 
Efficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketchingEfficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketchingHsing-chuan Hsieh
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentIJERD Editor
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Usatyuk Vasiliy
 
Wiener Filter Hardware Realization
Wiener Filter Hardware RealizationWiener Filter Hardware Realization
Wiener Filter Hardware RealizationSayan Chaudhuri
 
Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...
Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...
Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...Polytechnique Montreal
 
Data Driven Choice of Threshold in Cepstrum Based Spectrum Estimate
Data Driven Choice of Threshold in Cepstrum Based Spectrum EstimateData Driven Choice of Threshold in Cepstrum Based Spectrum Estimate
Data Driven Choice of Threshold in Cepstrum Based Spectrum Estimatesipij
 
Prpagation of Error Bounds Across reduction interfaces
Prpagation of Error Bounds Across reduction interfacesPrpagation of Error Bounds Across reduction interfaces
Prpagation of Error Bounds Across reduction interfacesMohammad
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Usatyuk Vasiliy
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)theijes
 
MVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priorsMVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priorsElvis DOHMATOB
 
Fixed Point Realization of Iterative LR-Aided Soft MIMO Decoding Algorithm
Fixed Point Realization of Iterative LR-Aided Soft MIMO Decoding AlgorithmFixed Point Realization of Iterative LR-Aided Soft MIMO Decoding Algorithm
Fixed Point Realization of Iterative LR-Aided Soft MIMO Decoding AlgorithmCSCJournals
 
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMWireilla
 
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMijfls
 

Similar to RandNLA Matrix Implementing Randomized Matrix Algorithms in Spark (20)

Learning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for GraphsLearning Convolutional Neural Networks for Graphs
Learning Convolutional Neural Networks for Graphs
 
Efficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketchingEfficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketching
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...
 
Wiener Filter Hardware Realization
Wiener Filter Hardware RealizationWiener Filter Hardware Realization
Wiener Filter Hardware Realization
 
Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...
Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...
Using Subspace Pursuit Algorithm to Improve Performance of the Distributed Co...
 
Subquad multi ff
Subquad multi ffSubquad multi ff
Subquad multi ff
 
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
 
Data Driven Choice of Threshold in Cepstrum Based Spectrum Estimate
Data Driven Choice of Threshold in Cepstrum Based Spectrum EstimateData Driven Choice of Threshold in Cepstrum Based Spectrum Estimate
Data Driven Choice of Threshold in Cepstrum Based Spectrum Estimate
 
Prpagation of Error Bounds Across reduction interfaces
Prpagation of Error Bounds Across reduction interfacesPrpagation of Error Bounds Across reduction interfaces
Prpagation of Error Bounds Across reduction interfaces
 
Ijetr042170
Ijetr042170Ijetr042170
Ijetr042170
 
Plan economico
Plan economicoPlan economico
Plan economico
 
Plan economico
Plan economicoPlan economico
Plan economico
 
Plan economico del 2017
Plan economico del 2017Plan economico del 2017
Plan economico del 2017
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
MVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priorsMVPA with SpaceNet: sparse structured priors
MVPA with SpaceNet: sparse structured priors
 
Fixed Point Realization of Iterative LR-Aided Soft MIMO Decoding Algorithm
Fixed Point Realization of Iterative LR-Aided Soft MIMO Decoding AlgorithmFixed Point Realization of Iterative LR-Aided Soft MIMO Decoding Algorithm
Fixed Point Realization of Iterative LR-Aided Soft MIMO Decoding Algorithm
 
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
 
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
 

RandNLA Matrix Implementing Randomized Matrix Algorithms in Spark

  • 1. Implementing Randomized Matrix Algorithms in Spark XLDB 2015 Jiyan Yang1 , Jey Kottalam2 , Mohitdeep Singh3 , Oliver R¨ubel4 , Curt Fischer4 , Benjamin P. Bowen4 , Michael W. Mahoney2 , Prabhat4 1 Stanford University 2 University of California at Berkeley 3 Georgia Institute of Technology 4 Lawrence Berkeley National Laboratory RandNLA for Least-Squares Problems Randomized Numerical Linear Algebra (RandNLA) algorithms can be used to solve large-scale least-squares problems. They consist of two steps. First, com- pute a randomized sketch for the design matrix. A sketch can be viewed as a compressed representation of the linear system. In this work, we evaluate the following six different kinds of sketch matrices: • Via random projection with 4 different underlying projection methods (Sparse, Gaussian, Rademacher, SRDHT). • Via random sampling according to approximate leverage scores or uniform distribution. Second, one can then use the sketch in one of the following two ways to obtain low-precision approximate solutions or high-precision approximation solutions to the original problem, respectively. • Low-precision solvers: solve the subproblem induced by the sketch. • High-precision solvers: use the sketch to construct a preconditioner and then invoke iterative algorithms such as LSQR. In this work, we implement these algorithms in Spark on dataset with size up to terabytes. All the experiments are performed on a cluster with 16 nodes, each of which has 8 CPU cores at clock rate 2.5GHz with 25GB RAM. The following two reasons make Spark favorable in this task. First, algorithms for computing the sketch are essentially parallel. It is straightforward to implement in distributed and parallel environments. Second, being able to cache the data in memory makes it fast to execute iterative algorithms. Overall Performance of Low-precision Solvers Here, we evaluate the low-precision solvers on the following two types of datasets: • UB (matrices with uniform leverage scores and bad condition number); • NB (matrices with nonuniform leverage scores and bad condition number). Recall that, low-precision solvers obtain the solution by solving the subproblem after computing the sketch. 103 104 sketch size 10-2 10-1 100 101 102 103 (a) x − x∗ 2/ x∗ 2 103 104 sketch size 10-3 10-2 10-1 100 101 PROJ CW PROJ GAUSSIAN PROJ RADEMACHER PROJ SRDHT SAMP APPR SAMP UNIF (b) |f − f∗ |/|f∗ | 103 104 sketch size 102 103 104 (c) Running time(sec) 1e7 × 1000 UB matrix 103 104 105 sketch size 10-2 10-1 100 101 102 103 (d) x − x∗ 2/ x∗ 2 103 104 105 sketch size 10-3 10-2 10-1 100 101 PROJ CW PROJ GAUSSIAN PROJ RADEMACHER PROJ SRDHT SAMP APPR SAMP UNIF (e) |f − f∗ |/|f∗ | 103 104 105 sketch size 102 103 104 (f) Running time(sec) 1e7 × 1000 NB matrix Figure 1: Evaluation of low-precision solvers on 2 different types of matrices of size 1e7 by 1000. Performance of Low-precision Solvers When n or d Changes We evaluate the performance of the low-precision solvers on NB matrices with changing n or d. For a matrix with size n by d, it is generated by stacking an NB matrix with size 2.5e5 by d vertically REPNUM = n/2.5e5 times. By this way, the condition number remains the same. The coherence the matrix is 1/REPNUM. 106 107 108 sketch size 10-3 10-2 10-1 100 101 102 103 (a) x − x∗ 2/ x∗ 2 106 107 108 n 10-3 10-2 10-1 100 101 PROJ CW PROJ GAUSSIAN PROJ RADEMACHER PROJ SRDHT SAMP APPR (b) |f − f∗ |/|f∗ | 106 107 108 n 102 103 104 (c) Running time(sec) n ∈ [2.5e5, 1e8], d = 1000, s = 5e4 101 102 103 d 10-2 10-1 100 101 102 (d) x − x∗ 2/ x∗ 2 101 102 103 d 10-4 10-3 10-2 10-1 100 101 102 103 PROJ CW PROJ GAUSSIAN PROJ RADEMACHER PROJ SRDHT SAMP APPR (e) |f − f∗ |/|f∗ | 101 102 103 d 102 103 104 (f) Running time(sec) d ∈ [10, 2000], n = 1e7, s = 5e4 Figure 2: Performance of low-precision solvers on NB matrices with varying n and d. For each method, the sketch size is fixed to be 5e4. Performance of High-precision Solvers Recall that, alternatively, one can use the sketch to construct preconditioners and invoke iterative algorithms such as LSQR to obtain high-precision solvers. Here, we evaluate the performance of high-precision solvers with several under- lying randomized sketches. 2 4 6 8 10 12 number of iteration 101 10-1 10-3 (a) x − x∗ 2/ x∗ 2 2 4 6 8 10 12 number of iteration 10-1 10-4 10-7 10-10 10-13 (b) |f − f∗ |/|f∗ | 2 4 6 8 10 12 number of iteration 0 2500 5000 7500 NOCO PROJ CW PROJ GAUSSIAN SAMP APPR (c) Running time(sec) small sketch size 2 4 6 8 10 12 number of iteration 101 10-1 10-3 (d) x − x∗ 2/ x∗ 2 2 4 6 8 10 12 number of iteration 10-1 10-4 10-7 10-10 10-13 (e) |f − f∗ |/|f∗ | 2 4 6 8 10 12 number of iteration 0 2500 5000 7500 NOCO PROJ CW PROJ GAUSSIAN SAMP APPR (f) Running time(sec) large sketch size Figure 3: Evaluation of LSQR with randomized preconditioner on an NB matrix with size 1e8 by 1000 and condition number 1e6. In above, by small sketch size, we mean 5e3 for all the methods. By large sketch size, we mean 3e5 for PROJ CW, 1e4 for PROJ GAUSSIAN and 5e4 for SAMP APPR. Quality of Randomized Preconditioners After computing a sketch ΠA, R−1 acts as preconditioner for A where R is the factor from QR decomposition of ΠA. Here we evaluate κ(AR−1). c PROJ CW PROJ GAUSSIAN PROJ RADEMACHER PROJ SRDHT SAMP APPR 5e2 1.08e8 2.17e3 1.42e3 1.19e2 1.21e2 1e3 1.1e6 5.7366 5.6006 7.1958 75.0290 5e3 5.5e5 1.9059 1.9017 1.9857 25.8725 1e4 5.1e5 1.5733 1.5656 1.6167 17.0679 5e4 1.8e5 1.2214 1.2197 1.2293 6.9109 1e5 1.1376 1.1505 1.1502 1.1502 4.7573 Table 1: Quality of preconditioning on an NB matrix with size 1e6 by 500 using several kinds of embeddings. RandNLA for CX Decomposition Given an n × d matrix A, CX decomposition decomposes A into two matrices C and X, where C is an n × c matrix that consists of c actual columns of A, and X is a c × d matrix such that the residual error A − CX F is as small as possible. The algorithm is as follows. Given A and a rank parameter k, use RandNLA Algorithms to approximate the leverage scores associated with rank k; The matrix C can be constructed by sampling c columns from A based on the leverage scores associated with k; Construct X based on C. Applications to Mass Spectrometry Imaging Analysis Next, we show results on a real dataset. The data for this analysis is provided by Norman Lewis’s group at Washington State Univeristy and is derived from a MALDI-IMS-MSI analysis of a rhizome of the drug-producing green shrub Podophyllum hexandrum. The size of the dataset is approximately 2.5e5 by 1.6e7 (511-by-507 spatial pixels by 460342 m/z channels by 200 ion mobility channels) which presents challenges for analysis and interpretation. We invoked CX decomposition with RandNLA to identify informative ions and pixels and investigate the reconstruction error based on the selected elements in Spark using the same cluster. 453.1028(74) 615.1427(87) 342.175(62) 381.083(58) (a) Ion-intensity visualization at 4 important m/z and τ peaks. The intensities are integrated over a small range of m/z and τ values. The value shown in each image is m/z(τ). 303.0215(52) 303.0215(59) (b) Ion-intensities visualization at m/z = 303.0215 and two different τ peaks. 0 20 40 60 80 100 number of ions selected 0.15 0.25 0.35 0.45 reconstructionerror greedy rank-c randomized rank-c greedy rank-15 best rank-15 (c) Reconstruction error A−CX F / A F of CX decomposition. Figure 4: Results of CX decomposition with RandNLA on real MSI dataset.