fragile.callbacks.data_tracking#

Module Contents#

Classes#

StoreInitAction

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

TrackWalkersId

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

KeepBestN

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

class fragile.callbacks.data_tracking.StoreInitAction(swarm=None, param_dict=None, inputs=None, outputs=None)[source]#

Bases: fragile.core.api_classes.Callback

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

Parameters
  • swarm (Optional[SwarmAPI]) –

  • param_dict (Optional[fragile.core.typing.StateDict]) –

  • inputs (Optional[fragile.core.typing.InputDict]) –

  • outputs (Optional[Tuple[str]]) –

name = store_init_action#
default_inputs#
default_outputs = ['init_actions']#
property param_dict#

Return the dictionary defining all the data attributes that the component requires.

Return type

fragile.core.typing.StateDict

before_env()[source]#
class fragile.callbacks.data_tracking.TrackWalkersId(swarm=None, param_dict=None, inputs=None, outputs=None)[source]#

Bases: fragile.core.api_classes.Callback

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

Parameters
  • swarm (Optional[SwarmAPI]) –

  • param_dict (Optional[fragile.core.typing.StateDict]) –

  • inputs (Optional[fragile.core.typing.InputDict]) –

  • outputs (Optional[Tuple[str]]) –

default_inputs#
default_param_dict#
update_ids(inactives=True)[source]#
Parameters

inactives (bool) –

after_env()[source]#
class fragile.callbacks.data_tracking.KeepBestN(n_keep, always_update=False, fix_walkers=True, **kwargs)[source]#

Bases: fragile.core.api_classes.Callback

The Walkers is a data structure that takes care of all the data involved in making a Swarm evolve.

Parameters
  • n_keep (int) –

  • always_update (bool) –

  • fix_walkers (bool) –

name = keep_best_n#
setup(swarm)[source]#

Prepare the component during the setup phase of the Swarm.

reset(*args, **kwargs)[source]#

Reset the internal state of the SwarmComponent.

Parameters
  • inplace (bool, optional) – Unused. Defaults to True.

  • root_walker (Optional[StateData], optional) – Set the internal state of the SwarmComponent to this value. Defaults to None.

  • states (Optional[StateData], optional) – Set the internal state of the SwarmComponent to this value. Defaults to None.

  • kwargs – Other parameters required to reset the component.

before_walkers()[source]#
get_topk_walkers()[source]#
update_top_walkers()[source]#
fix_topk_walkers()[source]#
after_walkers()[source]#