Skip to content

Commit

Permalink
fixes handling of weights parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sadit committed Dec 6, 2019
1 parent f2d46ae commit d2d7e78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/microtc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,17 @@ function microtc_random_configurations(H, ssize;
split_entropy_ = 0.0
initial_clusters_ = :rand # nothing in fact
k_ = 1
weights_ = rand(weights)
else
maxiters_ = rand(maxiters)
split_entropy_ = rand(split_entropy)
initial_clusters_ = rand(initial_clusters)
k_ = rand(k)
weights_ = nothing
end

kind_ = rand(kind)
vkind_ = vkind isa Dict ? rand(vkind[kind_]) : rand(vkind)
smooth_ = kind_ == EntModel ? Float64(rand(smooth)) : 0.0
weights_ = kind_ == EntModel ? rand(weights) : :balance

config = μTC_Configuration(
p = rand(p),
Expand Down Expand Up @@ -262,6 +261,7 @@ function microtc_combine_configurations(config_list, ssize, H)
#vkind_ = a.vkind
a2 = _sel()
vkind_ = kind_ == a2.kind ? a2.vkind : a.vkind
weights_ = kind_ == a2.kind ? a2.weights : a.weights

b = _sel()
qlist_, nlist_, slist_ = _sel().qlist, _sel().nlist, _sel().slist
Expand All @@ -288,7 +288,7 @@ function microtc_combine_configurations(config_list, ssize, H)
ncenters = b.ncenters,
maxiters = b.maxiters,
recall = _sel().recall,
weights = b.weights,
weights = weights_,
initial_clusters = b.initial_clusters,
split_entropy = b.split_entropy
)
Expand Down

2 comments on commit d2d7e78

@sadit
Copy link
Owner Author

@sadit sadit commented on d2d7e78 Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/6446

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.1 -m "<description of version>" d2d7e78f3b025d0632fb83de9406c84112e49b9f
git push origin v0.1.1

Please sign in to comment.