leniax.lenia package

class leniax.lenia.LeniaIndividual(config, rng_key, params=[])[source]

A Lenia individual used by QD algorithms

Note

The philosophy of the lib is to have parameters sampled from the same domain And then scaled by custom functions before being used in the evaluation function To sum up:

  • All parameters are generated in the sampling_domain

  • the dimension parameter is the number of parameter

  • in the eval function:
    1. You scale those parameters

    2. You create the configuration from those parameters

    3. You evaluate the configuration

    4. you set fitness and features

Parameters
  • config (Dict) –

  • rng_key (jax._src.prng.PRNGKeyArray) –

  • params (List) –

fitness

QD fitness value

Type

float

features

List of QD behaviour values

Type

List[float]

qd_config

QD configuration

Type

Dict

rng_key

JAX PRNG key

Type

jax._src.prng.PRNGKeyArray

params

A list of parameters to be updated by QD

Type

List

leniax.lenia.get_update_config(genotype, raw_values)[source]

Update the QD configuration using raw_values

Parameters
  • genotype (Dict) – A dictionnary of genotype value to be updated

  • raw_values (List) – Raw values for the update

Returns

A dictionnary mapping keys with updated values

Return type

Dict

leniax.lenia.linear_scale(raw_value, domain)[source]

Scale linearly raw_value in domain

Parameters
  • raw_value (float) – a value in [0, 1]

  • domain (Tuple[float, float]) – Domain bounding the final value

Returns

The scaled value

Return type

float

leniax.lenia.log_scale(raw_value, domain)[source]

Scale logarithmically raw_value in domain

Parameters
  • raw_value (float) – a value in [0, 1]

  • domain (Tuple[float, float]) – Domain bounding the final value

Returns

The scaled value

Return type

float