File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ _mod(x::RowVecs) = vec(sum(abs2, x.X; dims=2))
50
50
51
51
function kernelmatrix (κ:: FBMKernel , x:: AbstractVector )
52
52
modx = _mod (x)
53
- modx_wide = modx * ones (1 , length (modx)) # ad perf hack -- is unit tested
53
+ modx_wide = modx * ones (eltype (modx), 1 , length (modx)) # ad perf hack -- is unit tested
54
54
modxx = pairwise (SqEuclidean (), x)
55
55
return _fbm .(modx_wide, modx_wide' , modxx, only (κ. h))
56
56
end
64
64
65
65
function kernelmatrix (κ:: FBMKernel , x:: AbstractVector , y:: AbstractVector )
66
66
modxy = pairwise (SqEuclidean (), x, y)
67
- modx_wide = _mod (x) * ones (1 , length (y)) # ad perf hack -- is unit tested
68
- mody_wide = _mod (y) * ones (1 , length (x)) # ad perf hack -- is unit tested
67
+ modx_wide = _mod (x) * ones (eltype (modxy), 1 , length (y)) # ad perf hack -- is unit tested
68
+ mody_wide = _mod (y) * ones (eltype (modxy), 1 , length (x)) # ad perf hack -- is unit tested
69
69
return _fbm .(modx_wide, mody_wide' , modxy, only (κ. h))
70
70
end
71
71
Original file line number Diff line number Diff line change 21
21
22
22
function kernelmatrix (κ:: NormalizedKernel , x:: AbstractVector , y:: AbstractVector )
23
23
x_diag = kernelmatrix_diag (κ. kernel, x)
24
- x_diag_wide = x_diag * ones (1 , length (y)) # ad perf hack. Is unit tested.
24
+ x_diag_wide = x_diag * ones (eltype (x_diag), 1 , length (y)) # ad perf hack. Is unit tested
25
25
y_diag = kernelmatrix_diag (κ. kernel, y)
26
- y_diag_wide = y_diag * ones (1 , length (x)) # ad perf hack. Is unit tested.
26
+ y_diag_wide = y_diag * ones (eltype (y_diag), 1 , length (x)) # ad perf hack. Is unit tested
27
27
return kernelmatrix (κ. kernel, x, y) ./ sqrt .(x_diag_wide .* y_diag_wide' )
28
28
end
29
29
30
30
function kernelmatrix (κ:: NormalizedKernel , x:: AbstractVector )
31
31
x_diag = kernelmatrix_diag (κ. kernel, x)
32
- x_diag_wide = x_diag * ones (1 , length (x_diag )) # ad perf hack. Is unit tested.
32
+ x_diag_wide = x_diag * ones (eltype (x_diag), 1 , length (x )) # ad perf hack. Is unit tested
33
33
return kernelmatrix (κ. kernel, x) ./ sqrt .(x_diag_wide .* x_diag_wide' )
34
34
end
35
35
You can’t perform that action at this time.
0 commit comments