Skip to content

Commit

Permalink
Stuffing 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Dec 28, 2021
1 parent 1b39dc5 commit 21fe037
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "WordCloud"
uuid = "6385f0a0-cb03-45b6-9089-4e0acc74b26b"
authors = ["guoyongzhi <[email protected]>"]
version = "0.9.3"
version = "0.9.4"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand All @@ -20,5 +20,5 @@ Colors = "0.9, 0.10, 0.11, 0.12"
FileIO = "1"
ImageTransformations = "0.5, 0.6, 0.7, 0.8, 0.9"
Luxor = "2.8"
Stuffing = "0.7"
Stuffing = "0.8"
julia = "1.2"
2 changes: 1 addition & 1 deletion examples/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ wc3 = wordcloud(words, weights, mask=shape(box, 2000, 2000, cornerradius=100, co

wcs = [wc1, wc1, wc2, wc3] # repeat wc1 to trigger compiling
ts = [WordCloud.Stuffing.trainepoch_E!,WordCloud.Stuffing.trainepoch_EM!,
WordCloud.Stuffing.trainepoch_EM2!,WordCloud.Stuffing.trainepoch_EM3!,
WordCloud.Stuffing.trainepoch_EM2!,WordCloud.Stuffing.trainepoch_EM3!,WordCloud.Stuffing.trainepoch_D!,
WordCloud.Stuffing.trainepoch_P!,WordCloud.Stuffing.trainepoch_P2!,WordCloud.Stuffing.trainepoch_Px!]
es = [[] for i in 1:length(wcs)]
for (i, wc) in enumerate(wcs)
Expand Down
8 changes: 4 additions & 4 deletions src/wc-method.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,17 @@ function fit!(wc, args...; reposition=true, optimiser=SGD(), krags...)
wc.params[:epoch] += ep
if nc == 0
setstate!(wc, nameof(fit!))
# @assert isempty(outofkernelbounds(wc.maskqtree, wc.qtrees))
# colllist = first.(totalcollisions(qtrees))
# @assert length(colllist) == 0
else
setstate!(wc, nameof(placewords!))
end
wc
end
function printcollisions(wc)
qtrees = [wc.maskqtree, wc.qtrees...]
colllist = first.(batchcollisions(qtrees))
colllist = first.(totalcollisions(qtrees))
get_text(i) = i > 1 ? wc.words[i - 1] : "#MASK#"
collwords = [(get_text(i), get_text(j)) for (i, j) in colllist]
if length(colllist) > 0
Expand Down Expand Up @@ -288,9 +291,6 @@ function generate!(wc::WC, args...; retry=3, krags...)
if STATEIDS[getstate(wc)] >= STATEIDS[:fit!]
println("$(wc.params[:epoch]) epochs")
setstate!(wc, nameof(generate!))
# @assert isempty(outofkernelbounds(wc.maskqtree, wc.qtrees))
# colllist = first.(batchcollisions(qtrees))
# @assert length(colllist) == 0
else # check
printcollisions(wc)
end
Expand Down

0 comments on commit 21fe037

Please sign in to comment.