scm2cpp-learn 0.23.0__tar.gz → 0.23.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/PKG-INFO +1 -1
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/pyproject.toml +1 -1
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/__init__.py +4 -4
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_gramops_blas.py +4 -4
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_gramops_loops.py +4 -4
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gramops_blas/gramops.hpp +23 -23
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gramops_blas/gramops_capi.cpp +2 -2
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gramops_loops/gramops.hpp +283 -283
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gramops_loops/gramops_capi.cpp +2 -2
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn.egg-info/PKG-INFO +1 -1
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/README.md +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/setup.cfg +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/setup.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_compat.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/__init__.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_accel_cublas.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_classifiers.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_derived_blas.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_derived_cublas.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_derived_loops.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_gpu_cuda.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_nmf_blas.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_nmf_cublas.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_nmf_loops.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/accel_cublas/accel.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/accel_cublas/accel.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/accel_cublas/accel_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/classifiers.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/classifiers.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/classifiers_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_blas/lasso_design.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_blas/lasso_design.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_blas/lasso_design_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_cublas/lasso_design.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_cublas/lasso_design.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_cublas/lasso_design_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_loops/lasso_design.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_loops/lasso_design.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/derived_loops/lasso_design_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gpu_cuda/gpu.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gpu_cuda/gpu.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gpu_cuda/gpu_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gramops_blas/gramops.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gramops_loops/gramops.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/lasso_cov.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/lasso_cov.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/lasso_cov_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_blas/nmf_cd.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_blas/nmf_cd.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_blas/nmf_cd_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_cublas/nmf_cd.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_cublas/nmf_cd.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_cublas/nmf_cd_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_loops/nmf_cd.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_loops/nmf_cd.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/nmf_loops/nmf_cd_capi.cpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/scm2cpp-blas.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/scm2cpp-cublas.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/scm2cpp-cuda.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/scm2cpp.hpp +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_libfind.py +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/batch_capi.cu +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn.egg-info/SOURCES.txt +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn.egg-info/dependency_links.txt +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn.egg-info/requires.txt +0 -0
- {scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scm2cpp-learn
|
|
3
|
-
Version: 0.23.
|
|
3
|
+
Version: 0.23.1
|
|
4
4
|
Summary: scikit-learn estimators (lasso, elastic net, ridge, RidgeCV, ARD, SVM, SVR, logistic regression, GLMs, Huber, Theil-Sen, F-score selection, RFE, NMF, Gaussian mixture, FastICA, PCA, KernelPCA, LDA, TruncatedSVD, PLS, CCA, graphical lasso, RANSAC, SGD, OMP, LARS) translated from Scheme to C++ by scm2cpp; GPU batch solver and CUDA kernels included
|
|
5
5
|
Author: Hirotaka Niitsuma
|
|
6
6
|
License: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scm2cpp-learn"
|
|
7
|
-
version = "0.23.
|
|
7
|
+
version = "0.23.1"
|
|
8
8
|
description = "scikit-learn estimators (lasso, elastic net, ridge, RidgeCV, ARD, SVM, SVR, logistic regression, GLMs, Huber, Theil-Sen, F-score selection, RFE, NMF, Gaussian mixture, FastICA, PCA, KernelPCA, LDA, TruncatedSVD, PLS, CCA, graphical lasso, RANSAC, SGD, OMP, LARS) translated from Scheme to C++ by scm2cpp; GPU batch solver and CUDA kernels included"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -58,7 +58,7 @@ __all__ = ["GramLasso", "GramElasticNet", "GramRidge", "GramRidgeCV", "CovLasso"
|
|
|
58
58
|
"GramLogisticRegression", "GramGroupLasso", "GramMultiTaskLasso",
|
|
59
59
|
"GramMultiTaskElasticNet", "DesignLasso",
|
|
60
60
|
"cuda_available", "derived_backend", "kernel"]
|
|
61
|
-
__version__ = "0.23.
|
|
61
|
+
__version__ = "0.23.1"
|
|
62
62
|
|
|
63
63
|
_BATCH = load_batch_lib()
|
|
64
64
|
_DP = ctypes.POINTER(ctypes.c_double)
|
|
@@ -2042,7 +2042,7 @@ class GramOMP(Tagged, RegressorMixin, BaseEstimator):
|
|
|
2042
2042
|
k = max(int(0.1 * p), 1) if self.n_nonzero_coefs is None else int(self.n_nonzero_coefs)
|
|
2043
2043
|
lib = importlib.import_module(f"{__name__}._generated._loader_gramops_{gramops_backend()}")
|
|
2044
2044
|
self.coef_ = np.zeros(p)
|
|
2045
|
-
self.n_iter_ = lib.
|
|
2045
|
+
self.n_iter_ = lib.omp_scm(Xc, yc, self.coef_, np.zeros(1), 0, k, n, p)
|
|
2046
2046
|
self.intercept_ = ym - float(xm @ self.coef_)
|
|
2047
2047
|
return self
|
|
2048
2048
|
|
|
@@ -4158,7 +4158,7 @@ class GramOMPCV(Tagged, RegressorMixin, BaseEstimator):
|
|
|
4158
4158
|
xm, ym = Xtr.mean(axis=0), ytr.mean()
|
|
4159
4159
|
Xtr, Xte, ytr, yte = Xtr - xm, Xte - xm, ytr - ym, yte - ym
|
|
4160
4160
|
path = np.zeros((kmax, p))
|
|
4161
|
-
k = lib.
|
|
4161
|
+
k = lib.omp_scm(np.ascontiguousarray(Xtr), np.ascontiguousarray(ytr), np.zeros(p),
|
|
4162
4162
|
path, 1, kmax, len(train), p)
|
|
4163
4163
|
res = Xte @ path[:k].T - yte[:, None]
|
|
4164
4164
|
mses.append((res ** 2).mean(axis=0))
|
|
@@ -4167,7 +4167,7 @@ class GramOMPCV(Tagged, RegressorMixin, BaseEstimator):
|
|
|
4167
4167
|
self.n_nonzero_coefs_ = best
|
|
4168
4168
|
Xc, yc, xm, ym = _center(X, y, self.fit_intercept)
|
|
4169
4169
|
self.coef_ = np.zeros(p)
|
|
4170
|
-
self.n_iter_ = lib.
|
|
4170
|
+
self.n_iter_ = lib.omp_scm(Xc, yc, self.coef_, np.zeros(1), 0, best, n, p)
|
|
4171
4171
|
self.intercept_ = ym - float(xm @ self.coef_)
|
|
4172
4172
|
return self
|
|
4173
4173
|
|
{scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_gramops_blas.py
RENAMED
|
@@ -65,14 +65,14 @@ def graphical_lasso(emp, cov, prec, alpha, maxiter, tol, enettol, p):
|
|
|
65
65
|
prec = np.ascontiguousarray(prec, dtype=np.float64)
|
|
66
66
|
return _lib.scm2cpp_graphical_lasso(emp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cov.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, maxiter, tol, enettol, p)
|
|
67
67
|
|
|
68
|
-
_lib.
|
|
69
|
-
_lib.
|
|
70
|
-
def
|
|
68
|
+
_lib.scm2cpp_omp_scm.restype = ctypes.c_int64
|
|
69
|
+
_lib.scm2cpp_omp_scm.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
|
|
70
|
+
def omp_scm(x, y, coef, path, rec, kmax, n, p):
|
|
71
71
|
x = np.ascontiguousarray(x, dtype=np.float64)
|
|
72
72
|
y = np.ascontiguousarray(y, dtype=np.float64)
|
|
73
73
|
coef = np.ascontiguousarray(coef, dtype=np.float64)
|
|
74
74
|
path = np.ascontiguousarray(path, dtype=np.float64)
|
|
75
|
-
return _lib.
|
|
75
|
+
return _lib.scm2cpp_omp_scm(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), path.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rec, kmax, n, p)
|
|
76
76
|
|
|
77
77
|
_lib.scm2cpp_logistic_fg.restype = ctypes.c_double
|
|
78
78
|
_lib.scm2cpp_logistic_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
|
{scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/_loader_gramops_loops.py
RENAMED
|
@@ -65,14 +65,14 @@ def graphical_lasso(emp, cov, prec, alpha, maxiter, tol, enettol, p):
|
|
|
65
65
|
prec = np.ascontiguousarray(prec, dtype=np.float64)
|
|
66
66
|
return _lib.scm2cpp_graphical_lasso(emp.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), cov.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), prec.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), alpha, maxiter, tol, enettol, p)
|
|
67
67
|
|
|
68
|
-
_lib.
|
|
69
|
-
_lib.
|
|
70
|
-
def
|
|
68
|
+
_lib.scm2cpp_omp_scm.restype = ctypes.c_int64
|
|
69
|
+
_lib.scm2cpp_omp_scm.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
|
|
70
|
+
def omp_scm(x, y, coef, path, rec, kmax, n, p):
|
|
71
71
|
x = np.ascontiguousarray(x, dtype=np.float64)
|
|
72
72
|
y = np.ascontiguousarray(y, dtype=np.float64)
|
|
73
73
|
coef = np.ascontiguousarray(coef, dtype=np.float64)
|
|
74
74
|
path = np.ascontiguousarray(path, dtype=np.float64)
|
|
75
|
-
return _lib.
|
|
75
|
+
return _lib.scm2cpp_omp_scm(x.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), y.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), coef.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), path.ctypes.data_as(ctypes.POINTER(ctypes.c_double)), rec, kmax, n, p)
|
|
76
76
|
|
|
77
77
|
_lib.scm2cpp_logistic_fg.restype = ctypes.c_double
|
|
78
78
|
_lib.scm2cpp_logistic_fg.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.c_double, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64, ctypes.c_int64]
|
{scm2cpp_learn-0.23.0 → scm2cpp_learn-0.23.1}/src/scm2cpp_learn/_generated/gramops_blas/gramops.hpp
RENAMED
|
@@ -20,7 +20,7 @@ enet_gram( scm2cpp::span<double> w, scm2cpp::cspan<double> qm, scm2cpp::cspan<
|
|
|
20
20
|
std::int64_t
|
|
21
21
|
graphical_lasso( scm2cpp::cspan<double> emp, scm2cpp::span<double> cov, scm2cpp::span<double> prec, double alpha, std::int64_t maxiter, double tol, double enettol, std::int64_t p );
|
|
22
22
|
std::int64_t
|
|
23
|
-
|
|
23
|
+
omp_scm( scm2cpp::cspan<double> x, scm2cpp::cspan<double> y, scm2cpp::span<double> coef, scm2cpp::span<double> path, std::int64_t rec, std::int64_t kmax, std::int64_t n, std::int64_t p );
|
|
24
24
|
SCM2CPP_FN double
|
|
25
25
|
logistic_fg( scm2cpp::cspan<double> coef, scm2cpp::span<double> g, scm2cpp::cspan<double> x, scm2cpp::cspan<double> y, scm2cpp::span<double> z, double l2, std::int64_t multi, std::int64_t fitint, std::int64_t n, std::int64_t p, std::int64_t k );
|
|
26
26
|
std::int64_t
|
|
@@ -79,10 +79,10 @@ SCM2CPP_FN double
|
|
|
79
79
|
eig_abs( double a );
|
|
80
80
|
SCM2CPP_FN std::int64_t
|
|
81
81
|
eig_order( scm2cpp::cspan<double> ev, scm2cpp::span<int> ord, std::int64_t m );
|
|
82
|
-
template< typename
|
|
83
|
-
sym_eigen_top( scm2cpp::span<double> a, scm2cpp::span<double> v, scm2cpp::span<double> ev,
|
|
84
|
-
template< typename
|
|
85
|
-
sym_eigen_gen( scm2cpp::span<double> a, scm2cpp::span<double> b, scm2cpp::span<double> v, scm2cpp::span<double> ev,
|
|
82
|
+
template< typename Unknown_type3800Type > std::int64_t
|
|
83
|
+
sym_eigen_top( scm2cpp::span<double> a, scm2cpp::span<double> v, scm2cpp::span<double> ev, Unknown_type3800Type e, std::int64_t m, std::int64_t k );
|
|
84
|
+
template< typename Unknown_type3799Type > std::int64_t
|
|
85
|
+
sym_eigen_gen( scm2cpp::span<double> a, scm2cpp::span<double> b, scm2cpp::span<double> v, scm2cpp::span<double> ev, Unknown_type3799Type e, std::int64_t m );
|
|
86
86
|
SCM2CPP_FN double
|
|
87
87
|
ica_tanh( double x );
|
|
88
88
|
SCM2CPP_FN std::int64_t
|
|
@@ -288,8 +288,8 @@ enet_gap( scm2cpp::cspan<double> w, scm2cpp::cspan<double> q, scm2cpp::cspan<d
|
|
|
288
288
|
SCM2CPP_FN inline std::int64_t
|
|
289
289
|
enet_safe_rule( scm2cpp::span<double> w, scm2cpp::cspan<double> qm, scm2cpp::span<double> qw, scm2cpp::cspan<double> xta, scm2cpp::span<int> active, scm2cpp::span<int> excl, const std::array<double,2> & out, double alpha, std::int64_t m )
|
|
290
290
|
{
|
|
291
|
-
struct
|
|
292
|
-
|
|
291
|
+
struct let3808 {
|
|
292
|
+
let3808() {}
|
|
293
293
|
double operator()( double g )
|
|
294
294
|
{
|
|
295
295
|
if( g < 0.0 ) {
|
|
@@ -300,7 +300,7 @@ enet_safe_rule( scm2cpp::span<double> w, scm2cpp::cspan<double> qm, scm2cpp::s
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
} ;
|
|
303
|
-
double radius = (sqrt((2.0*
|
|
303
|
+
double radius = (sqrt((2.0*let3808()(out[0])))/alpha);
|
|
304
304
|
double dn = out[1];
|
|
305
305
|
std::int64_t nact = 0;
|
|
306
306
|
for( std::int64_t j = 0 ; !(j == m) ; j = (j+1) ) {
|
|
@@ -610,7 +610,7 @@ graphical_lasso( scm2cpp::cspan<double> emp, scm2cpp::span<double> cov, scm2cp
|
|
|
610
610
|
|
|
611
611
|
|
|
612
612
|
inline std::int64_t
|
|
613
|
-
|
|
613
|
+
omp_scm( scm2cpp::cspan<double> x, scm2cpp::cspan<double> y, scm2cpp::span<double> coef, scm2cpp::span<double> path, std::int64_t rec, std::int64_t kmax, std::int64_t n, std::int64_t p )
|
|
614
614
|
{ std::vector<double> g((p*p),0.0);
|
|
615
615
|
std::vector<double> xy(p,0.0);
|
|
616
616
|
std::vector<double> alpha(p,0.0);
|
|
@@ -2607,9 +2607,9 @@ eig_order( scm2cpp::cspan<double> ev, scm2cpp::span<int> ord, std::int64_t m
|
|
|
2607
2607
|
return 0 ;
|
|
2608
2608
|
}
|
|
2609
2609
|
|
|
2610
|
-
template< typename
|
|
2610
|
+
template< typename Unknown_type3800Type >
|
|
2611
2611
|
std::int64_t
|
|
2612
|
-
sym_eigen_top( scm2cpp::span<double> a, scm2cpp::span<double> v, scm2cpp::span<double> ev,
|
|
2612
|
+
sym_eigen_top( scm2cpp::span<double> a, scm2cpp::span<double> v, scm2cpp::span<double> ev, Unknown_type3800Type e, std::int64_t m, std::int64_t k )
|
|
2613
2613
|
{ std::vector<double> vf((m*m),0.0);
|
|
2614
2614
|
std::vector<double> evf(m,0.0);
|
|
2615
2615
|
std::vector<int> ord(m,0);
|
|
@@ -2638,9 +2638,9 @@ sym_eigen_top( scm2cpp::span<double> a, scm2cpp::span<double> v, scm2cpp::span
|
|
|
2638
2638
|
return 0 ;
|
|
2639
2639
|
}
|
|
2640
2640
|
|
|
2641
|
-
template< typename
|
|
2641
|
+
template< typename Unknown_type3799Type >
|
|
2642
2642
|
std::int64_t
|
|
2643
|
-
sym_eigen_gen( scm2cpp::span<double> a, scm2cpp::span<double> b, scm2cpp::span<double> v, scm2cpp::span<double> ev,
|
|
2643
|
+
sym_eigen_gen( scm2cpp::span<double> a, scm2cpp::span<double> b, scm2cpp::span<double> v, scm2cpp::span<double> ev, Unknown_type3799Type e, std::int64_t m )
|
|
2644
2644
|
{ for( std::int64_t j = 0 ; !(j == m) ; j = (j+1) ) {
|
|
2645
2645
|
double d = b[(((long long)j*m)+j)];
|
|
2646
2646
|
for( std::int64_t l = 0 ; !(l == j) ; l = (l+1) ) {
|
|
@@ -4907,18 +4907,18 @@ kpca_apply( scm2cpp::span<double> g, scm2cpp::cspan<double> sa, scm2cpp::cspan
|
|
|
4907
4907
|
for( std::int64_t i = 0 ; i < na ; i += 1 ) {
|
|
4908
4908
|
for( std::int64_t j = 0 ; !(j == nb) ; j = (j+1) ) {
|
|
4909
4909
|
double q = g[(((long long)i*nb)+j)];
|
|
4910
|
-
struct
|
|
4910
|
+
struct let4166 {
|
|
4911
4911
|
double & gamma;
|
|
4912
|
-
|
|
4912
|
+
let4166( double & gamma ):gamma(gamma) {}
|
|
4913
4913
|
double operator()( double d )
|
|
4914
4914
|
{
|
|
4915
4915
|
return exp(((0.0-gamma)*( ( d < 0.0 ) ? (0.0) : (d) ))) ;
|
|
4916
4916
|
}
|
|
4917
4917
|
} ;
|
|
4918
4918
|
|
|
4919
|
-
struct
|
|
4919
|
+
struct let4198 {
|
|
4920
4920
|
double & q;
|
|
4921
|
-
|
|
4921
|
+
let4198( double & q ):q(q) {}
|
|
4922
4922
|
double operator()( double r )
|
|
4923
4923
|
{
|
|
4924
4924
|
if( r > 0.0 ) {
|
|
@@ -4929,7 +4929,7 @@ kpca_apply( scm2cpp::span<double> g, scm2cpp::cspan<double> sa, scm2cpp::cspan
|
|
|
4929
4929
|
}
|
|
4930
4930
|
}
|
|
4931
4931
|
} ;
|
|
4932
|
-
g[ (((long long)i*nb)+j) ] = ( ( kind == 1 ) ? (
|
|
4932
|
+
g[ (((long long)i*nb)+j) ] = ( ( kind == 1 ) ? (let4166(gamma)(((sa[i]+sb[j])-(2.0*q)))) : (( ( kind == 2 ) ? (std::pow(((gamma*q)+coef0), (1.0*degree))) : (( ( kind == 3 ) ? ((1.0-(2.0/(exp((2.0*((gamma*q)+coef0)))+1.0)))) : (( ( kind == 4 ) ? (let4198(q)((sqrt(sa[i])*sqrt(sb[j])))) : (q) )) )) )) ) ;
|
|
4933
4933
|
;
|
|
4934
4934
|
} ;
|
|
4935
4935
|
}
|
|
@@ -4937,18 +4937,18 @@ kpca_apply( scm2cpp::span<double> g, scm2cpp::cspan<double> sa, scm2cpp::cspan
|
|
|
4937
4937
|
for( std::int64_t i = 0 ; i < na ; i += 1 ) {
|
|
4938
4938
|
for( std::int64_t j = 0 ; !(j == nb) ; j = (j+1) ) {
|
|
4939
4939
|
double q = g[(((long long)i*nb)+j)];
|
|
4940
|
-
struct
|
|
4940
|
+
struct let4166 {
|
|
4941
4941
|
double & gamma;
|
|
4942
|
-
|
|
4942
|
+
let4166( double & gamma ):gamma(gamma) {}
|
|
4943
4943
|
double operator()( double d )
|
|
4944
4944
|
{
|
|
4945
4945
|
return exp(((0.0-gamma)*( ( d < 0.0 ) ? (0.0) : (d) ))) ;
|
|
4946
4946
|
}
|
|
4947
4947
|
} ;
|
|
4948
4948
|
|
|
4949
|
-
struct
|
|
4949
|
+
struct let4198 {
|
|
4950
4950
|
double & q;
|
|
4951
|
-
|
|
4951
|
+
let4198( double & q ):q(q) {}
|
|
4952
4952
|
double operator()( double r )
|
|
4953
4953
|
{
|
|
4954
4954
|
if( r > 0.0 ) {
|
|
@@ -4959,7 +4959,7 @@ kpca_apply( scm2cpp::span<double> g, scm2cpp::cspan<double> sa, scm2cpp::cspan
|
|
|
4959
4959
|
}
|
|
4960
4960
|
}
|
|
4961
4961
|
} ;
|
|
4962
|
-
g[ (((long long)i*nb)+j) ] = ( ( kind == 1 ) ? (
|
|
4962
|
+
g[ (((long long)i*nb)+j) ] = ( ( kind == 1 ) ? (let4166(gamma)(((sa[i]+sb[j])-(2.0*q)))) : (( ( kind == 2 ) ? (std::pow(((gamma*q)+coef0), (1.0*degree))) : (( ( kind == 3 ) ? ((1.0-(2.0/(exp((2.0*((gamma*q)+coef0)))+1.0)))) : (( ( kind == 4 ) ? (let4198(q)((sqrt(sa[i])*sqrt(sb[j])))) : (q) )) )) )) ) ;
|
|
4963
4963
|
;
|
|
4964
4964
|
} ;
|
|
4965
4965
|
}
|
|
@@ -26,8 +26,8 @@ extern "C" std::int64_t scm2cpp_enet_gram(double* w, double* qm, double* q, doub
|
|
|
26
26
|
extern "C" std::int64_t scm2cpp_graphical_lasso(double* emp, double* cov, double* prec, double alpha, std::int64_t maxiter, double tol, double enettol, std::int64_t p) {
|
|
27
27
|
return graphical_lasso(emp, cov, prec, alpha, maxiter, tol, enettol, p);
|
|
28
28
|
}
|
|
29
|
-
extern "C" std::int64_t
|
|
30
|
-
return
|
|
29
|
+
extern "C" std::int64_t scm2cpp_omp_scm(double* x, double* y, double* coef, double* path, std::int64_t rec, std::int64_t kmax, std::int64_t n, std::int64_t p) {
|
|
30
|
+
return omp_scm(x, y, coef, path, rec, kmax, n, p);
|
|
31
31
|
}
|
|
32
32
|
extern "C" double scm2cpp_logistic_fg(double* coef, double* g, double* x, double* y, double* z, double l2, std::int64_t multi, std::int64_t fitint, std::int64_t n, std::int64_t p, std::int64_t k) {
|
|
33
33
|
return logistic_fg(coef, g, x, y, z, l2, multi, fitint, n, p, k);
|