Skip to content

Commit

Permalink
Update learning_curves.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
OkonSamuel committed Jun 10, 2020
1 parent e518a07 commit 28a37ba
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/learning_curves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,22 @@ function _tuning_results(rngs::AbstractVector, acceleration::CPUProcesses,
verbosity < 1 || @async begin
update!(p,0)
while take!(channel)
p.counter +=1
ProgressMeter.updateProgress!(p)
p.counter +=1
ProgressMeter.updateProgress!(p)
end
close(channel)
end
@sync begin
ret = @distributed (_collate) for rng in rngs
recursive_setproperty!(tuned.model.model, rng_name, rng)
fit!(tuned, verbosity=verbosity-1, force=true)
r=tuned.report.plotting
verbosity < 1 || put!(channel, true)
r
end
end
recursive_setproperty!(tuned.model.model, rng_name, old_rng)
verbosity < 1 || put!(channel, false)
recursive_setproperty!(tuned.model.model, rng_name, rng)
fit!(tuned, verbosity=verbosity-1, force=true)
r=tuned.report.plotting
verbosity < 1 || put!(channel, true)
r
end
recursive_setproperty!(tuned.model.model, rng_name, old_rng)
verbosity < 1 || put!(channel, false)
end
end
return ret
end
Expand Down Expand Up @@ -297,15 +297,14 @@ function _tuning_results(rngs::AbstractVector, acceleration::CPUThreads,
acceleration=tuned.model.acceleration),
tuned.args...) for _ in 2:length(partitions)]...]
@sync for (i,rng_part) in enumerate(partitions)
tasks[i] = Threads.@spawn begin

tasks[i] = Threads.@spawn begin
mapreduce(_collate, rng_part) do k
recursive_setproperty!(tmachs[i].model.model, rng_name, rngs[k])
fit!(tmachs[i], verbosity=verbosity-1, force=true)
verbosity < 1 || put!(ch, true)
tmachs[i].report.plotting
end
end
end
end
verbosity < 1 || put!(ch, false)
end
Expand Down

0 comments on commit 28a37ba

Please sign in to comment.