MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / get_rows

Method get_rows

src/thundersvm/kernelmatrix.cpp:73–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void KernelMatrix::get_rows(const SyncArray<int> &idx,
74 SyncArray<kernel_type> &kernel_rows) const {//compute multiple rows of kernel matrix according to idx
75 CHECK_GE(kernel_rows.size(), idx.size() * n_instances_) << "kernel_rows memory is too small";
76#ifdef USE_CUDA
77 get_dot_product_dns_csr(idx, kernel_rows);
78#else
79 if(n_features_ < 1000000)
80 get_dot_product_dns_csr(idx, kernel_rows);
81 else
82 get_dot_product_csr_csr(idx, kernel_rows);
83// get_dot_product_dns_dns(idx, kernel_rows);
84#endif
85 switch (param.kernel_type) {
86 case SvmParam::RBF:
87 case SvmParam::PRECOMPUTED://precomputed uses rbf as default
88 RBF_kernel(idx, self_dot_, kernel_rows, idx.size(), n_instances_, param.gamma);
89 break;
90 case SvmParam::LINEAR:
91 //do nothing
92 break;
93 case SvmParam::POLY:
94 poly_kernel(kernel_rows, param.gamma, param.coef0, param.degree, kernel_rows.size());
95 break;
96 case SvmParam::SIGMOID:
97 sigmoid_kernel(kernel_rows, param.gamma, param.coef0, kernel_rows.size());
98 break;
99 }
100}
101
102void KernelMatrix::get_rows(const DataSet::node2d &instances,
103 SyncArray<kernel_type> &kernel_rows) const {//compute the whole (sub-) kernel matrix of the given instances.

Callers 4

TearDownMethod · 0.80
predict_dec_valuesMethod · 0.80
solveMethod · 0.80
init_fMethod · 0.80

Calls 5

RBF_kernelFunction · 0.85
poly_kernelFunction · 0.85
sigmoid_kernelFunction · 0.85
sizeMethod · 0.45
host_dataMethod · 0.45

Tested by 1

TearDownMethod · 0.64