SciML / PSOGPU.jl

GPU accelerated Particle Swarm Optimization
MIT License
13 stars 1 forks source link

Initialize unify and use LHS #26

Closed Vaibhavdixit02 closed 8 months ago

Vaibhavdixit02 commented 9 months ago

On 100 Dimensional rosenbrock With LHS initialization

julia> sol = solve(prob,
           ParallelPSOKernel(n_particles; gpu = false, threaded = true),
           maxiters = 500)
u: 100-element Vector{Float32}:
 -1.0
  0.31475496
 -1.0
  ⋮
 -1.0
  0.31496483
 -1.0

julia> sol.objective
18022.828f0

julia> sol = solve(prob,
           ParallelPSOKernel(n_particles; gpu = false, threaded = true),
           maxiters = 1000)
u: 100-element Vector{Float32}:
 -1.0
 -1.0
  0.3144405
  ⋮
 -1.0
 -1.0
 -1.0

julia> sol.objective
20094.93f0

With random initialization

julia> sol = solve(prob,
           ParallelPSOKernel(n_particles; gpu = false, threaded = true),
           maxiters = 1000)
u: 100-element Vector{Float32}:
 -1.0
  0.6448835
  0.14048311
  ⋮
 -1.0
 -1.0
 10.0

julia> sol.objective
26523.37f0

julia> sol = solve(prob,
           ParallelPSOKernel(n_particles; gpu = false, threaded = true),
           maxiters = 1000)
u: 100-element Vector{Float32}:
 -1.0
 -1.0
 -1.0
  ⋮
 -1.0
 -1.0
 10.0

julia> sol.objective
26584.914f0
utkarsh530 commented 9 months ago

It would be good to test it for GPU applications as well. Maybe a GPU parallelized samplers?

Test failures look real.

Vaibhavdixit02 commented 9 months ago

Can you run it on cyclops? We could think about it but I would put it on a very low priority since it isn't too computationally expensive now