I'm currently facing an issue while attempting to run the quick start code. This is leading to an error message: "AttributeError: 'tuple' object has no attribute 'evaluate'".
from evox import algorithms, problems, pipelines
import jax
import jax.numpy as jnp
algorithm = algorithms.PSO(
lb=jnp.full(shape=(2,), fill_value=-32),
ub=jnp.full(shape=(2,), fill_value=32),
pop_size=100,
)
problem = problems.classic.Ackley(),
pipeline = pipelines.StdPipeline(
algorithm,
problem,
)
key = jax.random.PRNGKey(42)
state = pipeline.init(key)
for i in range(100):
state = pipeline.step(state)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/home/sh/test_evox.py in line 27
25 # run the pipeline for 100 steps
26 for i in range(100):
---> 27 state = pipeline.step(state)
File ~/anaconda3/envs/EVOX_test/lib/python3.10/site-packages/evox/core/module.py:31, in use_state..wrapper(self, state, *args, **kwargs)
28 # find the state that match the current module
29 path, matched_state = state.find_path_to(self._node_id, self._module_name)
---> 31 return_value = func(self, matched_state, *args, **kwargs)
33 # single return value, the value must be a State
34 if not isinstance(return_value, tuple):
File ~/anaconda3/envs/EVOX_test/lib/python3.10/site-packages/evox/pipelines/standard.py:24, in StdPipeline.step(self, state)
21 if self.pop_transform is not None:
22 pop = self.pop_transform(pop)
---> 24 fitness, state = self.problem.evaluate(state, pop)
26 if self.fitness_transform is not None:
27 fitness = self.fitness_transform(fitness)
AttributeError: 'tuple' object has no attribute 'evaluate'
I'm running this code in a clean anaconda env with cuda 12.2.