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 May 4, 2020
1 parent 5ea8d3c commit 25fb292
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/learning_curves.jl
Expand Up @@ -107,6 +107,26 @@ function learning_curve(model::Supervised, args...;
"`AbstractVector{<:AbstractRNG}`. ")
end
end
if (acceleration isa CPUProcesses &&
acceleration_grid isa CPUProcesses)
message =
"The combination acceleration=$(tuned_model.acceleration) and"*
" acceleration_resampling=$(tuned_model.acceleration) is"*
" not generally optimal. You may want to consider setting"*
" `acceleration = CPUProcesses()` and"*
" `acceleration_resampling = CPUThreads()`."
@warn message
end
if (acceleration isa CPUThreads &&
acceleration_grid isa CPUProcesses)
message =
"The combination acceleration=$(tuned_model.acceleration) and"*
" acceleration_resampling=$(tuned_model.acceleration) is"*
" not generally optimal. You may want to consider setting"*
" `acceleration = CPUProcesses()` and"*
" `acceleration_resampling = CPUThreads()`."
@warn message
end

tuned_model = TunedModel(model=model,
range=range,
Expand Down Expand Up @@ -202,7 +222,7 @@ function _tuning_results(rngs::AbstractVector, acceleration::CPUThreads,
n_rngs = length(rngs)
old_rng = recursive_getproperty(tuned_machs[1].model.model, rng_name)

results = Array{Any, 1}(undef, n_rngs)
results = Vector{NamedTuple}(undef, n_rngs) ##since we use Grid for now

@sync begin

Expand Down

0 comments on commit 25fb292

Please sign in to comment.