Problem Definition
- class fevovaq.problem.Problem(n_params: int, obj_function: Callable[[ndarray | cp.ndarray], float | ndarray | cp.ndarray], param_bounds: Tuple | Sequence[Tuple] | None = None, init_range: Tuple | Sequence[Tuple] | None = None, backend: str | None = 'cpu', vectorized: bool = False)[source]
Bases:
objectDefine a minimization problem for evolutionary optimization.
Supports CPU (NumPy) and GPU (CuPy) backends transparently.
- Parameters:
n_params – Number of real parameters to be optimized.
obj_function – Objective function f(x, **args) -> float or vector. Must accept x of shape (n_params,) or (pop_size, n_params).
param_bounds – Tuple or list of (min, max) bounds.
init_range – Initialization range (same format as param_bounds). If None, the range (-1, 1) is used.
backend – “cpu” or “gpu”.
vectorized – If True, obj_function already supports batch input of shape (pop_size, n_params).