- Experiments
- Reorder to put the most important result first
-
Verify: I don’t think BLAS GEMM version kmean will be slower than MLpack and Scikit-learn.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Numa allocate | |
void numa_alloc(double* data) { | |
data = static_cast<double*>(numa_alloc_onnode(data_size, node_id)); | |
} | |
// Numa deallocate | |
void numa_dealloc(double* data, size_t data_size) { | |
numa_free(data, data_size); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(FlashR) | |
fgmat <- fm.as.matrix(replicate(100, rnorm(100))) | |
mul = function(mat, extra) fgmat %*% mat | |
res <- fm.eigen(mul, 5, nrow(fgmat)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Graph(object): | |
adjacency_matrix = None | |
_num_vertices = None | |
_num_edges = None | |
_directed = None | |
_weighted = None | |
_dangling_nodes = None | |
def __init__(self): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Graph(object): | |
self.adjacency_matrix = None | |
self._num_vertices = None | |
self._num_edges = None | |
self._directed = None | |
self._weighted = None | |
self._dangling_nodes = None | |
def __init__(self,): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" A class for K-Means clustering """ | |
""" | |
Adapted from Zhang Zhang zhang.zhang@intel.com | |
https://github.com/daaltces/pydaal-tutorials/blob/master/kmeans.py | |
https://github.com/daaltces/pydaal-tutorials/blob/master/kmeans_example.ipynb | |
""" | |
import daal.algorithms.kmeans as kmeans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import environ | |
from os.path import join as jp | |
import numpy as np | |
from time import time | |
from sys import argv | |
from daal.data_management import HomogenNumericTable, BlockDescriptor_Float64, readOnly | |
from daal.data_management import ( | |
FileDataSource, DataSourceIface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(Matrix) | |
require(igraph) | |
require(argparse) | |
parser <- ArgumentParser(description="Process some integers") | |
parser$add_argument("gfn", help="The graph file name") | |
parser$add_argument("nev", type="integer", help="Number of eigenvectors to compute") | |
parser$add_argument("ncv", type="integer",help="Number of Lanczos vectors to compute") | |
parser$add_argument("maxiter", type="integer",help="Max number of iterations to compute eigenvectors") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
import numpy as np | |
p = 0.3 # Alter as necessary | |
n = 1000 # Alter as necessary | |
fn = "graph%d"%n # Alter as necessary | |
g = nx.erdos_renyi_graph(n, p,False) | |
gsp = nx.to_scipy_sparse_matrix(g) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(Matrix) | |
require(igraph) | |
createc3 <- function() | |
{ | |
set.seed(12345) | |
n <- 10^6 | |
m <- 10^2 | |
(KA <- n/m) | |
rho <- c(0.02,0.5,0.15,0.08,0.25) |
NewerOlder