Skip to content

Commit

Permalink
Merge pull request dillondaudert#21 from baggepinnen/patch-1
Browse files Browse the repository at this point in the history
Fix broadcast bug in initialize_embedding
  • Loading branch information
dillondaudert authored Dec 17, 2019
2 parents 2549d15 + 43cf101 commit 5a28a69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/umap_.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function initialize_embedding(graph::AbstractMatrix{T}, n_components, ::Val{:spe
embed = spectral_layout(graph, n_components)
# expand
expansion = 10 / maximum(embed)
@. embed = (embed*expansion) + (1//10000)*randn(T, size(embed))
embed .= (embed .* expansion) .+ (1//10000) .* randn.(T)
catch e
print("Error encountered in spectral_layout; defaulting to random layout\n")
embed = initialize_embedding(graph, n_components, Val(:random))
Expand Down

0 comments on commit 5a28a69

Please sign in to comment.