Skip to content
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

Pyswarms changes dtype from pyten.mp.MPS() to np.ndarray() #528

Open
kmos-s opened this issue May 15, 2024 · 0 comments
Open

Pyswarms changes dtype from pyten.mp.MPS() to np.ndarray() #528

kmos-s opened this issue May 15, 2024 · 0 comments

Comments

@kmos-s
Copy link

kmos-s commented May 15, 2024

  • PySwarms version: 1.3.0
  • Python version: 3.9.7
  • Operating System: Ubuntu 20.04.6 LTS

Description

I am trying to minimize the entropy of a pyten.mp.MPS(). When I use the pyswarms optimizer with the entropy function, as soon, as I multiply the pyten.mp.MPS() with a number (float) the data type of the MPS is changed to a np.dnarray().
Is there a way to avoid this datatype change?

What I Did

optimizer = ps.single.GlobalBestPSO(n_particles=10, dimensions=1, options={'c1': 0.5, 'c2': 0.3, 'w':0.9}, bounds=(np.array([-1.]), np.array([1.])))
res, b = optimizer.optimize(Entropy, 10, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant