nevo.core.optimiser¶
NEVO Optimiser¶
Main optimiser class integrating all neuromorphic components.
- trs2o(v, lb, ub)[source]¶
Transform from v-space [-1, 1] to original space [lb, ub].
- Parameters:
v (np.ndarray) – Solution in v-space
lb (np.ndarray) – Lower bounds in original space
ub (np.ndarray) – Upper bounds in original space
- Returns:
x – Solution in original space
- Return type:
np.ndarray
- class NEVOptimiser(objective_function, bounds, dimension, population_size=50, memory_size=25, operators=None, operator_mode='trad', neurons_per_ensemble=100, dt=0.001, epsilon=0.1, learning_rate=0.4, td_gamma=0.99, td_lambda=0.0, td_enabled=True, td_learning_rule=None, td_value_model=None, seed=None)[source]¶
Bases:
objectNeuromorphic Evolutionary Optimiser.
Uses basal ganglia circuits to adaptively select between multiple optimisation operators based on the current search state.
- __init__(objective_function, bounds, dimension, population_size=50, memory_size=25, operators=None, operator_mode='trad', neurons_per_ensemble=100, dt=0.001, epsilon=0.1, learning_rate=0.4, td_gamma=0.99, td_lambda=0.0, td_enabled=True, td_learning_rule=None, td_value_model=None, seed=None)[source]¶
Initialize NEVO optimiser.
- Parameters:
objective_function (Callable) – Function to minimize: f(x) -> float Input x is in original space [lb, ub]
bounds (tuple) – (lower_bounds, upper_bounds) as numpy arrays or scalars
dimension (int) – Problem dimension
population_size (int) – Number of candidates per operator per timestep
memory_size (int) – Size of solution memory (archive)
operators (List[Operator], optional) – Custom operators (uses default if None)
operator_mode (str) – Operator selection mode: “trad” | “traditional”, “nm_dual”, or “nm_softmix”
neurons_per_ensemble (int) – Neurons per ensemble in neural networks
dt (float) – Simulation timestep (seconds)
epsilon (float) – Epsilon-greedy exploration rate
learning_rate (float) – Learning rate for utility weight adaptation
td_gamma (float) – Discount factor for TD learning
td_lambda (float) – Lambda parameter for TD(lambda)
td_enabled (bool) – Enable TD-based value learning in selector
td_learning_rule (LearningRule, optional) – Custom TD learning rule instance
td_value_model (ValueModel, optional) – Custom TD value model instance
seed (int, optional) – Random seed for reproducibility
- evaluate(v)[source]¶
Evaluate objective function from v-space.
- Parameters:
v (np.ndarray) – Solution in v-space [-1, 1]
- Returns:
fitness – Objective function value
- Return type:
- update_memory(candidates, fitness)[source]¶
Update memory with new candidates (competitive update).
- Parameters:
candidates (np.ndarray) – Candidate solutions (population_size, dimension)
fitness (np.ndarray) – Fitness values (population_size,)
- get_best_solution()[source]¶
Get the best solution found.
- Return type:
- Returns:
x_best (np.ndarray) – Best solution in original space
f_best (float) – Best fitness value