-
Notifications
You must be signed in to change notification settings - Fork 1
updated deps #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated deps #29
Changes from 7 commits
029c81b
7054ab5
3b7be69
4d22e12
1180d9c
90791d5
4b913c8
b510dea
b522d42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,44 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
tags: '*' | ||
tags: ['*'] | ||
pull_request: | ||
workflow_dispatch: | ||
concurrency: | ||
# Skip intermediate builds: always. | ||
# Cancel intermediate builds: only if it is a pull request build. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created | ||
actions: write | ||
contents: read | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.6' | ||
- '1' | ||
- 'lts' | ||
os: | ||
- ubuntu-latest | ||
arch: | ||
- x64 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: actions/cache@v1 | ||
env: | ||
cache-name: cache-artifacts | ||
with: | ||
path: ~/.julia/artifacts | ||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-${{ env.cache-name }}- | ||
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- uses: julia-actions/cache@v2 | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
env: | ||
JULIA_NUM_THREADS: '2' | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
file: lcov.info | ||
files: lcov.info |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
name = "MLJParticleSwarmOptimization" | ||||||
uuid = "17a086e9-ed03-4f30-ab88-8b63f0f6126c" | ||||||
authors = ["Long Nguyen <[email protected]> and contributors"] | ||||||
version = "0.1.3" | ||||||
version = "0.1.4" | ||||||
|
||||||
[deps] | ||||||
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | ||||||
|
@@ -12,6 +12,19 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | |||||
|
||||||
[compat] | ||||||
Distributions = "0.25" | ||||||
MLJBase = "0.18, 0.19, 0.20, 0.21" | ||||||
MLJTuning = "0.6, 0.7" | ||||||
julia = "1.6" | ||||||
LinearAlgebra = "1.11" | ||||||
MLJBase = "1.7 - 1.8" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I missed this one earlier. If we change this as below then 1.0 and everything < 2.0 will be accepted. Nothing < 2.0 should be breaking, and we won't have added any features to MLJBase that this repo will know about. So this should be good.
Suggested change
|
||||||
MLJTuning = "0.8" | ||||||
Random = "1" | ||||||
julia = "1" | ||||||
|
||||||
[extras] | ||||||
ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3" | ||||||
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" | ||||||
EvoTrees = "f6006082-12f8-11e9-0c9c-0d5d367ab1e5" | ||||||
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7" | ||||||
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" | ||||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||||||
|
||||||
[targets] | ||||||
test = ["ComputationalResources", "Distributed", "EvoTrees", "MLJ", "StableRNGs", "Test"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
abstract type AbstractParticleSwarm <: MLJTuning.TuningStrategy end | ||
|
||
struct ParticleSwarmState{T, R, P, I} | ||
ranges::R | ||
parameters::P | ||
indices::I | ||
X::Matrix{T} | ||
V::Matrix{T} | ||
pbest_X::Matrix{T} | ||
gbest_X::Matrix{T} | ||
pbest::Vector{T} | ||
gbest::Vector{T} | ||
end | ||
|
||
mutable struct ParticleSwarm <: AbstractParticleSwarm | ||
n_particles::Integer | ||
w::Float64 | ||
c1::Float64 | ||
c2::Float64 | ||
prob_shift::Float64 | ||
rng::AbstractRNG | ||
# TODO: topology | ||
end | ||
|
||
mutable struct AdaptiveParticleSwarm <: AbstractParticleSwarm | ||
n_particles::Integer | ||
c1::Float64 | ||
c2::Float64 | ||
prob_shift::Float64 | ||
rng::AbstractRNG | ||
end | ||
|
||
get_n_particles(tuning::AbstractParticleSwarm) = tuning.n_particles | ||
get_prob_shift(tuning::AbstractParticleSwarm) = tuning.prob_shift | ||
get_rng(tuning::AbstractParticleSwarm) = tuning.rng | ||
|
||
function initialize(r, tuning::AbstractParticleSwarm) | ||
return initialize(get_rng(tuning), r, get_n_particles(tuning)) | ||
end | ||
|
||
function retrieve!(state::ParticleSwarmState, tuning::AbstractParticleSwarm) | ||
return retrieve!(get_rng(tuning), state) | ||
end | ||
|
||
function pbest!(state::ParticleSwarmState, measurements, tuning::AbstractParticleSwarm) | ||
return pbest!(state, measurements, get_prob_shift(tuning)) | ||
end |
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.