Artificial Bee (base class)#
(hivenas.core.abc.artificial_bee)
Abstract definitions of the
EmployeeBee and
OnlookerBee methods.
- class ArtificialBee(food_source, id)[source]#
Bases:
ABCAbstract class for Employee & Onlooker Bees
- food_source#
the bee’s main food source
- Type
FoodSource
- id#
the bee’s ID, used for logging/tracking purposes
- Type
int
- abstract evaluate(obj_interface: ObjectiveInterface)[source]#
Evaluates the current
FoodSource- Parameters
obj_interface (
ObjectiveInterface) – the objective interface used to sample/evaluate candidates- Returns
a Pandas Series containing the evaluation’s results (represents a row in the main results CSV file)
- Return type
pandas.Series- Raises
NotImplementedError – must be implemented by the child class
- abstract get_center_fs()[source]#
Returns the center food source
- Returns
the employee’s center food source
- Return type
- Raises
NotImplementedError – must be implemented by the child class
- get_random_neighbor(obj_interface: ObjectiveInterface)[source]#
Finds a random neighbor in the vicinity of the parent Parent(Onlooker) = Employee, Parent(Employee) = Scout
Given by [1]:
\[\begin{split}\begin{array}{ccl}{X_{mi} = L_i + rand(0, 1) * (U_i - L_i)} &{\Rightarrow}& {\text{Initial FoodSource}}\\{}&{}&\text{ (Scout)}\\\\{\upsilon_{mi} = X_{mi} + \phi_{mi}(X_{mi} - X_{ki})} & {\Rightarrow} & \text{Neighboring FoodSource}\\{} &{}&\text{(Employee/Onlooker)}\end{array}\end{split}\]Where \(\upsilon_{mi}\) is a neighboringFoodSource. Definition of “neighboring” given in [2];TLDR - in numerical and continuous optimization problems, a dimensional component is incremented/decremented. In NAS context, it is a 1-operation difference per network[1] Karaboga, D., & Basturk, B. (2007). A powerful and efficient algorithm for numerical function optimization: artificial bee colony (ABC) algorithm. Journal of global optimization, 39(3), 459-471.
[2] White, C., Nolen, S., & Savani, Y. (2021, December). Exploring the loss landscape in neural architecture search. In Uncertainty in Artificial Intelligence (pp. 654-664). PMLR.
- Parameters
obj_interface (
ObjectiveInterface) – the objective interface used to sample candidates- Returns
a randomly sampled neighboring food source
- Return type
- is_evaluated()[source]#
Checks if food source is evaluated for solution tracking purposes
- Returns
whether or not the current
FoodSourceis evaluated- Return type
bool
- abstract search(obj_interface: ObjectiveInterface)[source]#
Explore new random position (near previously-sampled position) and assigns it to the current food source
- Parameters
obj_interface (
ObjectiveInterface) – the objective interface used to sample/evaluate candidates- Raises
NotImplementedError – must be implemented by the child class