Lenia

From testwiki
Revision as of 21:08, 1 December 2024 by imported>SIGSTACKFAULT (add {{Conway's Game of Life}} navbox; i think i put it in the right place)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description

A sample autonomous pattern from Lenia.
An animation showing the movement of a glider in Lenia.

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".[1]

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 be the lattice or grid containing a set of states S. Like many cellular automata, Lenia is updated iteratively; each output state is a pure function of the previous state, such that

Φ(A0)=AΔt,Φ(AΔt)=A2Δt,,Φ(At)=At+Δt,

where A0 is the initial state and Φ:SS is the global rule, representing the application of the local rule over every site 𝐱. Thus ΦN(At)=At+NΔt.

If the simulation is advanced by Δt at each timestep, then the time resolution T=1Δt.

State sets

Let S={0,1,,P1,P} with maximum P. 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 Δp=1P; therefore we have At(𝐱)[0,1] for all 𝐱. For example, given P=4, 𝐀t(𝐱){0,0.25,0.5,0.75,1}.

Neighborhoods

A 9-square Moore neighborhood like those used in Game of Life.
The "ball" neighborhoods used by Lenia.

Mathematically, neighborhoods like those in Game of Life may be represented using a set of position vectors in 2. For the classic Moore neighborhood used by Game of Life, for instance, 𝒩={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, 𝒩={𝐱:𝐱2R}, 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 𝐱 be a vector in 2 within representing the position of a given site, and 𝒩 be the set of sites neighboring 𝐱. Both variations comprise two stages:

  1. Using a convolution kernel 𝐊:𝒩S to compute the potential distribution 𝐔t(𝐱)=𝐊*𝐀t(𝐱).
  2. Using a growth mapping G:[0,1][1,1] to compute the final growth distribution 𝐆t(𝐱)=G(𝐔t(𝐱)).

Once 𝐆t is computed, it is scaled by the chosen time resolution Δt and added to the original state value:𝐀t+Δt(𝐱)=clip(𝐀t+Δt𝐆t(𝐱),0,1)Here, the clip function is defined by clip(u,a,b):=min(max(u,a),b) .

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

𝐔t(𝐱)={𝐧𝒩𝐊(𝐧)𝐀t(𝐱+𝐧)Δx2,discrete Lenia𝐧𝒩𝐊(𝐧)𝐀t(𝐱+𝐧)dx2,continuous Lenia𝐆t(𝐱)=G(𝐔t(𝐱))𝐀t+Δt(𝐱)=clip(𝐀t(𝐱)+Δt𝐆t(𝐱),0,1)

Kernel generation

The kernel shell, kernel skeleton, and growth mappings for Lenia.

There are many ways to generate the convolution kernel 𝐊. 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 KC(12)=1 as well). Example kernel functions include:

KC(r)={exp(αα4r(1r)),exponential,α=4(4r(1r))α,polynomial,α=4𝟏[14,34](r),rectangular,etc.

Here, 𝟏A(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 β=(β1,β2,,βB)[0,1]B, where B is the rank of the parameter vector. Then the kernel skeleton KS is defined as

KS(r;β)=βBrKC(Br mod 1)

The final kernel 𝐊(𝐧) is therefore

𝐊(𝐧)=KS(𝐧2)|KS|

such that 𝐊 is normalized to have an element sum of 1 and 𝐊*𝐀[0,1] (for conservation of mass). |KS|=𝒩KSΔx2 in the discrete case, and NKSdx2 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 μ,σ. Examples include

G(u;μ,σ)={2exp((uμ)22σ2)1,exponential2𝟏[μ±3σ](u)(1(uμ)29σ2)α1,polynomial,α=42𝟏[μ±σ](u)1,rectangular,etc.

where u is a potential value drawn from 𝐔t.

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 functionKC(r)=𝟏[14,34](r)+12𝟏[0,14)(r)and the growth rule also rectangular, with μ=0.35,σ=0.07.

Patterns

Some of the wide variety of "species" in Lenia.

By varying the convolutional kernel, the growth mapping and the initial condition, over 400 "species" of "life" have been discovered in Lenia, displaying "self-organization, self-repair, bilateral and radial symmetries, locomotive dynamics, and sometimes chaotic nature".[7] Chan has created a taxonomy for these patterns.[1]

Cellular automata as a convolutional neural network.[8]

Other works have noted the strong similarity between cellular automata update rules and convolutions. Indeed, these works have focused on reproducing cellular automata using simplified convolutional neural networks. Mordvintsev et al. investigated the emergence of self-repairing pattern generation.[9] Gilpin found that any cellular automaton could be represented as a convolutional neural network, and trained neural networks to reproduce existing cellular automata[8]

In this light, cellular automata may be seen as a special case of recurrent convolutional neural networks. Lenia's update rule may also be seen as a single-layer convolution (the "potential field" 𝐊) with an activation function (the "growth mapping" G). However, Lenia uses far larger, fixed, kernels and is not trained via gradient descent.

See also

References

Template:Reflist

Template:Conway's Game of Life