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

Function RBF_kernel

src/thundersvm/kernel/kernelmatrix_kernel.cpp:61–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 }
60
61 void
62 RBF_kernel(const SyncArray<kernel_type> &self_dot0, const SyncArray<kernel_type> &self_dot1,
63 SyncArray<kernel_type> &dot_product, int m,
64 int n, kernel_type gamma) {
65 kernel_type *dot_product_data = dot_product.host_data();
66 const kernel_type *self_dot0_data = self_dot0.host_data();
67 const kernel_type *self_dot1_data = self_dot1.host_data();
68#pragma omp parallel for schedule(guided)
69 for (int i = 0; i < m; i++) {
70 for (int j = 0; j < n; ++j) {
71 dot_product_data[i * n + j] = expf(
72 -(self_dot0_data[i] + self_dot1_data[j] - dot_product_data[i * n + j] * 2) * gamma);
73 }
74 }
75 }
76
77 void
78 RBF_kernel(const SyncArray<int> &self_dot0_idx, const SyncArray<kernel_type> &self_dot1,

Callers 1

get_rowsMethod · 0.85

Calls 1

host_dataMethod · 0.45

Tested by

no test coverage detected