Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float32 #10

Closed
gdkrmr opened this issue Jun 12, 2019 · 6 comments
Closed

Float32 #10

gdkrmr opened this issue Jun 12, 2019 · 6 comments

Comments

@gdkrmr
Copy link

gdkrmr commented Jun 12, 2019

I just got the following error when using an Array{Float32}:

MethodError: no method matching combine_fuzzy_sets(::SparseArrays.SparseMatrixCSC{Float32,Int64}, ::Float64)
Closest candidates are:
  combine_fuzzy_sets(::AbstractArray{T<:AbstractFloat,2}, !Matched::T<:AbstractFloat) where T<:AbstractFloat at /home/me/.julia/packages/UMAP/7orf6/src/utils.jl:61
@dillondaudert
Copy link
Owner

I have an idea of what's going on here. Could you provide more information on how you're calling umap? What if any other parameters are you passing?

@dillondaudert
Copy link
Owner

Give it a shot on the argtypes branch

@gdkrmr
Copy link
Author

gdkrmr commented Jun 13, 2019

This is a reproducible one-liner:

julia> umap(randn(Float32, 20, 1000), 2)
ERROR: MethodError: no method matching combine_fuzzy_sets(::SparseArrays.SparseMatrixCSC{Float32,Int64}, ::Float64)
Closest candidates are:
  combine_fuzzy_sets(::AbstractArray{T<:AbstractFloat,2}, ::T<:AbstractFloat) where T<:AbstractFloat at /home/me/julia/packages/UMAP/7orf6/src/utils.jl:61

on the argtypes branch it works, but I get a weird error message:

julia> umap(randn(Float32, 20, 1000), 2)
Error encountered in spectral_layout; defaulting to random layout
2×1000 Array{Float32,2}:
 -1.32639   -0.746478  -0.933311  -1.16249   1.74564      1.5002   2.29761  3.04286   1.61978  -1.84504   3.19287 
  0.595433   1.85769    2.61646    0.310585  0.616751     -1.14881  2.33555  0.248531  2.17292  -0.320106  0.624897

@dillondaudert
Copy link
Owner

Yeah, that's due to Arpack and the eigs method not working on Float32. I still need to look if there's a way around that.

@dillondaudert
Copy link
Owner

The spectral layout isn't necessary for umap to work, it's just a reasonable a priori initialization for the projection (which then gets optimized). The results with the randomly initialized embedding should be fine though.

@gdkrmr
Copy link
Author

gdkrmr commented Jun 13, 2019

thanks, very cool package!

@gdkrmr gdkrmr closed this as completed Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants