Lenia Explained

Lenia is a family of cellular automata created by Bert Wang-Chak Chan.[1] [2] [3] It is intended to be a continuous generalization of Conway's Game of Life, with continuous states, space and time. As a consequence of its continuous, high-resolution domain, the complex autonomous patterns ("lifeforms" or "spaceships") generated in Lenia are described as differing from those appearing in other cellular automata, being "geometric, metameric, fuzzy, resilient, adaptive, and rule-generic".

Lenia won the 2018 Virtual Creatures Contest at the Genetic and Evolutionary Computation Conference in Kyoto,[4] an honorable mention for the ALIFE Art Award at ALIFE 2018 in Tokyo,[5] and Outstanding Publication of 2019 by the International Society for Artificial Life (ISAL).[6]

Rules

Iterative updates

Let

l{L}

be the lattice or grid containing a set of states

Sl{L}

. Like many cellular automata, Lenia is updated iteratively; each output state is a pure function of the previous state, such that

\Phi(A^0) = A^, \Phi(A^) = A^, \ldots, \Phi(A^t) = A^,\ldots

where

A0

is the initial state and

\Phi:Sl{L}Sl{L}

is the global rule, representing the application of the local rule over every site

x\in\cal{L}

. Thus

\PhiN(At)=At

.

If the simulation is advanced by

\Deltat

at each timestep, then the time resolution

T=

1
\Deltat
.

State sets

Let

S=\{0,1,\ldots,P-1,P\}

with maximum

P\in\Z

. This is the state set of the automaton and characterizes the possible states that may be found at each site. Larger

P

correspond to higher state resolutions in the simulation. Many cellular automata use the lowest possible state resolution, i.e.

P=1

. Lenia allows for much higher resolutions. Note that the actual value at each site is not in

[0,P]

but rather an integer multiple of

\Deltap=

1
P
; therefore we have

At(x)\in[0,1]

for all

x\inl{L}

. For example, given

P=4

,

At(x)\in\{0,0.25,0.5,0.75,1\}

.

Neighborhoods

Mathematically, neighborhoods like those in Game of Life may be represented using a set of position vectors in

\R2

. For the classic Moore neighborhood used by Game of Life, for instance,

l{N}=\{-1,0,1\}2

; i.e. a square of size 3 centered on every site.

In Lenia's case, the neighborhood is instead a ball of radius

R

centered on a site,

l{N}=\{x\inl{L}:\lVertx\rVert2\leqR\}

, which may include the original site itself.

Note that the neighborhood vectors are not the absolute position of the elements, but rather a set of relative positions (deltas) with respect to any given site.

Local rule

There are discrete and continuous variants of Lenia. Let

x

be a vector in

\R2

within

l{L}

representing the position of a given site, and

l{N}

be the set of sites neighboring

x

. Both variations comprise two stages:
  1. Using a convolution kernel

K:l{N}S

to compute the potential distribution

Ut(x)=K*At(x)

.
  1. Using a growth mapping

G:[0,1][-1,1]

to compute the final growth distribution

Gt(x)=G(Ut(x))

.Once

Gt

is computed, it is scaled by the chosen time resolution

\Deltat

and added to the original state value:\mathbf^(\mathbf) = \text(\mathbf^ + \Delta t \;\mathbf^t(\mathbf),\; 0,\; 1)Here, the clip function is defined by

\operatorname{clip}(u,a,b):=min(max(u,a),b)

.

The local rules are defined as follows for discrete and continuous Lenia:

\begin\mathbf^t(\mathbf) &= \begin \sum_ \mathbf\mathbf^t(\mathbf+\mathbf)\Delta x^2, & \text \\ \int_ \mathbf\mathbf^t(\mathbf+\mathbf)dx^2, & \text\end \\\mathbf^t(\mathbf) &= G(\mathbf^t(\mathbf)) \\\mathbf^(\mathbf) &= \text(\mathbf^t(\mathbf) + \Delta t\;\mathbf^t(\mathbf),\; 0,\; 1)\end

Kernel generation

There are many ways to generate the convolution kernel

K

. The final kernel is the composition of a kernel shell

KC

and a kernel skeleton

KS

.

For the kernel shell

KC

, Chan gives several functions that are defined radially. Kernel shell functions are unimodal and subject to the constraint

KC(0)=KC(1)=0

(and typically
K
C\left(1
2

\right)=1

as well). Example kernel functions include:

K_C(r) = \begin \exp\left(\alpha - \frac\right), & \text, \alpha=4 \\ (4r(1-r))^\alpha, & \text, \alpha=4 \\ \mathbf_(r), & \text \\ \ldots, & \text\end

Here,

1A(r)

is the indicator function.

Once the kernel shell has been defined, the kernel skeleton

KS

is used to expand it and compute the actual values of the kernel by transforming the shell into a series of concentric rings. The height of each ring is controlled by a kernel peak vector

\beta=(\beta1,\beta2,\ldots,\betaB)\in[0,1]B

, where

B

is the rank of the parameter vector. Then the kernel skeleton

KS

is defined as

K_S(r;\beta)=\beta_ K_C(Br \text 1)

The final kernel

K(n)

is therefore

\mathbf(\mathbf) = \frac

such that

K

is normalized to have an element sum of

1

and

K*A\in[0,1]

(for conservation of mass).

|KS|=style\suml{N

} \displaystyle K_S \, \Delta x^2 in the discrete case, and

\intNKSdx2

in the continuous case.

Growth mappings

The growth mapping

G:[0,1][-1,1]

, which is analogous to an activation function, may be any function that is unimodal, nonmonotonic, and accepts parameters

\mu,\sigma\in\R

. Examples include

G(u;\mu,\sigma) = \begin 2\exp\left(-\frac\right)-1, & \text \\ 2\cdot\mathbf_(u)\left(1-\frac\right)^\alpha-1, & \text, \alpha=4 \\ 2\cdot\mathbf_(u)-1, & \text \\ \ldots, & \text\end

where

u

is a potential value drawn from

Ut

.

Game of Life

The Game of Life may be regarded as a special case of discrete Lenia with

R=T=P=1

. In this case, the kernel would be rectangular, with the functionK_C(r) = \mathbf_(r) + \frac\mathbf_

Notes and References

  1. Chan. Bert Wang-Chak. 2019-10-15. Lenia: Biology of Artificial Life. Complex Systems. 28. 3. 251–286. 10.25088/ComplexSystems.28.3.251. 1812.05433.
  2. Web site: Lenia. 2021-10-12. chakazul.github.io.
  3. News: Roberts. Siobhan. 2020-12-28. The Lasting Lessons of John Conway’s Game of Life. en-US. The New York Times. 2021-10-13. 0362-4331.
  4. Web site: The virtual creatures competition. 2021-10-12. virtualcreatures.github.io.
  5. Web site: ALife Art Award 2018. 2021-10-12. ALIFE Art Award 2018. en-US.
  6. Web site: 2020 ISAL Awards: Winners .