@@ -17,7 +17,7 @@ function nystrom_sample(k::Kernel, X::AbstractMatrix, S::Vector{<:Integer}; obsd
17
17
return (C, Cs)
18
18
end
19
19
20
- function nystrom_pinv! (Cs:: Matrix{T} , tol:: T = eps (T)* size (Cs,1 )) where {T<: AbstractFloat }
20
+ function nystrom_pinv! (Cs:: Matrix{T} , tol:: T = eps (T)* size (Cs,1 )) where {T<: Real }
21
21
# Compute eigendecomposition of sampled component of K
22
22
QΛQᵀ = LinearAlgebra. eigen! (LinearAlgebra. Symmetric (Cs))
23
23
@@ -76,7 +76,7 @@ function nystrom(k::Kernel, X::AbstractMatrix, S::Vector{<:Integer}; obsdim::Int
76
76
end
77
77
78
78
@doc raw """
79
- nystrom(k::Kernel, X::Matrix, r::AbstractFloat ; obsdim::Int=defaultobs)
79
+ nystrom(k::Kernel, X::Matrix, r::Real ; obsdim::Int=defaultobs)
80
80
81
81
Computes a factorization of Nystrom approximation of the square kernel matrix of data
82
82
matrix `X` with respect to kernel `k` using a sample ratio of `r`.
@@ -85,7 +85,7 @@ Returns a `NystromFact` struct which stores a Nystrom factorization satisfying:
85
85
\m athbf{K} \a pprox \m athbf{C}^{\i ntercal}\m athbf{W}\m athbf{C}
86
86
```
87
87
"""
88
- function nystrom (k:: Kernel , X:: AbstractMatrix , r:: AbstractFloat ; obsdim:: Int = defaultobs)
88
+ function nystrom (k:: Kernel , X:: AbstractMatrix , r:: Real ; obsdim:: Int = defaultobs)
89
89
S = sampleindex (X, r; obsdim= obsdim)
90
90
return nystrom (k, X, S; obsdim= obsdim)
91
91
end
95
95
96
96
Compute the approximate kernel matrix based on the Nystrom factorization.
97
97
"""
98
- function kernelmatrix (CᵀWC:: NystromFact{<:AbstractFloat } )
98
+ function kernelmatrix (CᵀWC:: NystromFact{<:Real } )
99
99
W = CᵀWC. W
100
100
C = CᵀWC. C
101
101
return C' * W* C
0 commit comments