-
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
Merged
Merged
updated deps #29
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
029c81b
updated deps
PasoStudio73 7054ab5
updated deps
PasoStudio73 3b7be69
restored initial deps
PasoStudio73 4d22e12
updated version
PasoStudio73 1180d9c
all tests passed
PasoStudio73 90791d5
fix tests and ci.yml
PasoStudio73 4b913c8
added Distributed
PasoStudio73 b510dea
Update Project.toml
PasoStudio73 b522d42
fix MLJBase dep
PasoStudio73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
MLJBase = "1.7 - 1.8" | ||
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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.