fragile.core.fractalai
Contents
fragile.core.fractalai
#
Module Contents#
Functions#
|
Euclidean distance between two batches of points stacked across the first dimension. |
|
Normalize the data using a custom smoothing technique. |
|
Get indexes representing random alive walkers given a vector of death conditions. |
|
Calculate a distance metric for each walker with respect to a random companion. |
|
Calculate the virtual rewards given the required data. |
|
Calculate the clone indexes and masks from the virtual rewards. |
|
Perform a FAI iteration. |
|
|
|
Calculate the virtual rewards between two cloud of points. |
|
Perform a clone operation between two different groups of points. |
|
Perform a FractalAI cloning process between two clouds of points. |
Attributes#
- fragile.core.fractalai.AVAILABLE_FUNCTIONS#
- fragile.core.fractalai.l2_norm(x, y)[source]#
Euclidean distance between two batches of points stacked across the first dimension.
- Parameters
x (judo.typing.Tensor) –
y (judo.typing.Tensor) –
- Return type
judo.typing.Tensor
- fragile.core.fractalai.relativize(x)[source]#
Normalize the data using a custom smoothing technique.
- Parameters
x (judo.typing.Tensor) –
- Return type
judo.typing.Tensor
- fragile.core.fractalai.get_alive_indexes(oobs)[source]#
Get indexes representing random alive walkers given a vector of death conditions.
- Parameters
oobs (judo.typing.Tensor) –
- fragile.core.fractalai.calculate_distance(observs, distance_function=l2_norm, return_compas=False, oobs=None, compas=None)[source]#
Calculate a distance metric for each walker with respect to a random companion.
- Parameters
observs (judo.typing.Tensor) –
distance_function (Callable) –
return_compas (bool) –
oobs (judo.typing.Tensor) –
compas (judo.typing.Tensor) –
- fragile.core.fractalai.calculate_virtual_reward(observs, rewards, oobs=None, dist_coef=1.0, reward_coef=1.0, other_reward=1.0, return_compas=False, return_distance=False, distance_function=l2_norm)[source]#
Calculate the virtual rewards given the required data.
- fragile.core.fractalai.calculate_clone(virtual_rewards, oobs=None, eps=1e-08)[source]#
Calculate the clone indexes and masks from the virtual rewards.
- Parameters
virtual_rewards (judo.typing.Tensor) –
oobs (judo.typing.Tensor) –
- fragile.core.fractalai.fai_iteration(observs, rewards, oobs=None, dist_coef=1.0, reward_coef=1.0, eps=1e-08, other_reward=1.0, return_compas_dist=False, return_distance=False)[source]#
Perform a FAI iteration.
- fragile.core.fractalai.cross_virtual_reward(host_observs, host_rewards, ext_observs, ext_rewards, dist_coef=1.0, reward_coef=1.0, return_compas=False, distance_function=l2_norm)[source]#
Calculate the virtual rewards between two cloud of points.
- fragile.core.fractalai.cross_clone(host_virtual_rewards, ext_virtual_rewards, host_oobs=None, eps=0.001)[source]#
Perform a clone operation between two different groups of points.
- Parameters
host_virtual_rewards (judo.typing.Tensor) –
ext_virtual_rewards (judo.typing.Tensor) –
host_oobs (judo.typing.Tensor) –