https://github.com/sciml/parallelparticleswarms.jl
GPU accelerated Particle Swarm Optimization
https://github.com/sciml/parallelparticleswarms.jl
Last synced: 5 months ago
JSON representation
GPU accelerated Particle Swarm Optimization
- Host: GitHub
- URL: https://github.com/sciml/parallelparticleswarms.jl
- Owner: SciML
- License: mit
- Created: 2023-09-25T18:10:56.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-31T21:57:04.000Z (about 1 year ago)
- Last Synced: 2025-08-29T10:23:27.590Z (11 months ago)
- Language: Julia
- Size: 343 KB
- Stars: 24
- Watchers: 5
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ParallelParticleSwarms.jl
[](https://github.com/SciML/ParallelParticleSwarms.jl/actions/workflows/CI.yml)
[](https://buildkite.com/julialang/parallelparticleswarms-dot-jl)
[](https://codecov.io/gh/SciML/ParallelParticleSwarms.jl)
[](https://github.com/SciML/ColPrac)
[](https://github.com/SciML/SciMLStyle)
Accelerating convex/non-convex optimization with GPUs using Particle-Swarm based methods.
Supports Julia's generic SciML interface.
```julia
using ParallelParticleSwarms, StaticArrays, CUDA
lb = @SArray [-1.0f0, -1.0f0, -1.0f0]
ub = @SArray [10.0f0, 10.0f0, 10.0f0]
function rosenbrock(x, p)
sum(p[2] * (x[i + 1] - x[i]^2)^2 + (p[1] - x[i])^2 for i in 1:(length(x) - 1))
end
x0 = @SArray zeros(Float32, 3)
p = @SArray Float32[1.0, 100.0]
prob = OptimizationProblem(rosenbrock, x0, p; lb = lb, ub = ub)
sol = solve(prob,
ParallelSyncPSOKernel(1000, backend = CUDA.CUDABackend()),
maxiters = 500)
```