Skip to content

Commit 1ae04bf

Browse files
authored
Merge pull request #10 from JuliaAI/dev
Add plotting for AdaptiveParticleSwarm
2 parents 6349e73 + d7ff730 commit 1ae04bf

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/strategies/abstract.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ end
88

99
function pbest!(state::ParticleSwarmState, measurements, tuning::AbstractParticleSwarm)
1010
return pbest!(state, measurements, tuning.prob_shift)
11-
end
11+
end

src/strategies/adaptive.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,14 @@ function _adapt_parameters(rng, c1, c2, f, phase)
224224
end
225225
c1, c2 = _clamp_coefficients(c1, c2)
226226
return w, c1, c2
227+
end
228+
229+
function MLJTuning.tuning_report(
230+
tuning::AdaptiveParticleSwarm,
231+
history,
232+
(state, phase, c1, c2)
233+
)
234+
fields = getproperty.(state.ranges, :field)
235+
scales = MLJBase.scale.(state.ranges)
236+
return (; plotting = MLJTuning.plotting_report(fields, scales, history))
227237
end

0 commit comments

Comments
 (0)