Skip to content

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

@kmos-s

Description

@kmos-s
  • 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions