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]
Let [math]\displaystyle{ \mathcal{L} }[/math] be the lattice or grid containing a set of states [math]\displaystyle{ S^\mathcal{L} }[/math]. Like many cellular automata, Lenia is updated iteratively; each output state is a pure function of the previous state, such that
[math]\displaystyle{ \Phi(A^0) = A^{\Delta t}, \Phi(A^{\Delta t}) = A^{2\Delta t}, \ldots, \Phi(A^t) = A^{t + \Delta t},\ldots }[/math]
where [math]\displaystyle{ A^0 }[/math] is the initial state and [math]\displaystyle{ \Phi : S^\mathcal{L} \rightarrow S^\mathcal{L} }[/math] is the global rule, representing the application of the local rule over every site [math]\displaystyle{ \mathbf{x}\in\cal{L} }[/math]. Thus [math]\displaystyle{ \Phi^N(A^t) = A^{t + N\Delta t} }[/math].
If the simulation is advanced by [math]\displaystyle{ \Delta t }[/math] at each timestep, then the time resolution [math]\displaystyle{ T = \frac{1}{\Delta t} }[/math].
Let [math]\displaystyle{ S = \{0, 1, \ldots, P-1, P\} }[/math] with maximum [math]\displaystyle{ P \in \Z }[/math]. This is the state set of the automaton and characterizes the possible states that may be found at each site. Larger [math]\displaystyle{ P }[/math] correspond to higher state resolutions in the simulation. Many cellular automata use the lowest possible state resolution, i.e. [math]\displaystyle{ P = 1 }[/math]. Lenia allows for much higher resolutions. Note that the actual value at each site is not in [math]\displaystyle{ [0,P] }[/math] but rather an integer multiple of [math]\displaystyle{ \Delta p = \frac{1}{P} }[/math]; therefore we have [math]\displaystyle{ A^t(\mathbf{x}) \in [0, 1] }[/math] for all [math]\displaystyle{ \mathbf{x} \in \mathcal{L} }[/math]. For example, given [math]\displaystyle{ P = 4 }[/math], [math]\displaystyle{ \mathbf{A}^t(\mathbf{x}) \in \{0, 0.25, 0.5, 0.75, 1\} }[/math].
Mathematically, neighborhoods like those in Game of Life may be represented using a set of position vectors in [math]\displaystyle{ \R^2 }[/math]. For the classic Moore neighborhood used by Game of Life, for instance, [math]\displaystyle{ \mathcal{N} = \{-1, 0, 1\}^2 }[/math]; i.e. a square of size 3 centered on every site.
In Lenia's case, the neighborhood is instead a ball of radius [math]\displaystyle{ R }[/math] centered on a site, [math]\displaystyle{ \mathcal{N} = \{\mathbf{x} \in \mathcal{L} : \lVert \mathbf{x} \rVert_2 \leq R\} }[/math], 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.
There are discrete and continuous variants of Lenia. Let [math]\displaystyle{ \mathbf{x} }[/math] be a vector in [math]\displaystyle{ \R^2 }[/math] within [math]\displaystyle{ \mathcal{L} }[/math] representing the position of a given site, and [math]\displaystyle{ \mathcal{N} }[/math] be the set of sites neighboring [math]\displaystyle{ \mathbf{x} }[/math]. Both variations comprise two stages:
Once [math]\displaystyle{ \mathbf{G}^t }[/math] is computed, it is scaled by the chosen time resolution [math]\displaystyle{ \Delta t }[/math] and added to the original state value:[math]\displaystyle{ \mathbf{A}^{t+\Delta t}(\mathbf{x}) = \text{clip}(\mathbf{A}^{t} + \Delta t \;\mathbf{G}^t(\mathbf{x}),\; 0,\; 1) }[/math]Here, the clip function is defined by [math]\displaystyle{ \operatorname{clip}(u,a,b):=\min(\max(u,a),b) }[/math] .
The local rules are defined as follows for discrete and continuous Lenia:
[math]\displaystyle{ \begin{align} \mathbf{U}^t(\mathbf{x}) &= \begin{cases} \sum_{\mathbf{n} \in \mathcal{N}} \mathbf{K(n)}\mathbf{A}^t(\mathbf{x}+\mathbf{n})\Delta x^2, & \text{discrete Lenia} \\ \int_{\mathbf{n} \in \mathcal{N}} \mathbf{K(n)}\mathbf{A}^t(\mathbf{x}+\mathbf{n})dx^2, & \text{continuous Lenia} \end{cases} \\ \mathbf{G}^t(\mathbf{x}) &= G(\mathbf{U}^t(\mathbf{x})) \\ \mathbf{A}^{t+\Delta t}(\mathbf{x}) &= \text{clip}(\mathbf{A}^t(\mathbf{x}) + \Delta t\;\mathbf{G}^t(\mathbf{x}),\; 0,\; 1) \end{align} }[/math]
There are many ways to generate the convolution kernel [math]\displaystyle{ \mathbf{K} }[/math]. The final kernel is the composition of a kernel shell [math]\displaystyle{ K_C }[/math] and a kernel skeleton [math]\displaystyle{ K_S }[/math].
For the kernel shell [math]\displaystyle{ K_C }[/math], Chan gives several functions that are defined radially. Kernel shell functions are unimodal and subject to the constraint [math]\displaystyle{ K_C(0) = K_C(1) = 0 }[/math] (and typically [math]\displaystyle{ K_C\left(\frac{1}{2}\right) = 1 }[/math] as well). Example kernel functions include:
[math]\displaystyle{ K_C(r) = \begin{cases} \exp\left(\alpha - \frac{\alpha}{4r(1-r)}\right), & \text{exponential}, \alpha=4 \\ (4r(1-r))^\alpha, & \text{polynomial}, \alpha=4 \\ \mathbf{1}_{\left[\frac{1}{4},\frac{3}{4}\right]}(r), & \text{rectangular} \\ \ldots, & \text{etc.} \end{cases} }[/math]
Here, [math]\displaystyle{ \mathbf{1}_A(r) }[/math] is the indicator function.
Once the kernel shell has been defined, the kernel skeleton [math]\displaystyle{ K_S }[/math] 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 [math]\displaystyle{ \beta = (\beta_1, \beta_2, \ldots, \beta_B) \in [0,1]^B }[/math], where [math]\displaystyle{ B }[/math] is the rank of the parameter vector. Then the kernel skeleton [math]\displaystyle{ K_S }[/math] is defined as
[math]\displaystyle{ K_S(r;\beta)=\beta_{\lfloor Br \rfloor} K_C(Br \text{ mod } 1) }[/math]
The final kernel [math]\displaystyle{ \mathbf{K}(\mathbf{n}) }[/math] is therefore
[math]\displaystyle{ \mathbf{K}(\mathbf{n}) = \frac{K_S(\lVert \mathbf{n} \rVert_2)}{|K_S|} }[/math]
such that [math]\displaystyle{ \mathbf{K} }[/math] is normalized to have an element sum of [math]\displaystyle{ 1 }[/math] and [math]\displaystyle{ \mathbf{K} * \mathbf{A} \in [0, 1] }[/math] (for conservation of mass). [math]\displaystyle{ |K_S| = \textstyle \sum_{\mathcal{N}} \displaystyle K_S \, \Delta x^2 }[/math] in the discrete case, and [math]\displaystyle{ \int_{N} K_S \,dx^2 }[/math] in the continuous case.
The growth mapping [math]\displaystyle{ G : [0, 1] \rightarrow [-1,1] }[/math], which is analogous to an activation function, may be any function that is unimodal, nonmonotonic, and accepts parameters [math]\displaystyle{ \mu,\sigma \in \R }[/math]. Examples include
[math]\displaystyle{ G(u;\mu,\sigma) = \begin{cases} 2\exp\left(-\frac{(u-\mu)^2}{2\sigma^2}\right)-1, & \text{exponential} \\ 2\cdot\mathbf{1}_{[\mu\pm3\sigma]}(u)\left(1-\frac{(u-\mu)^2}{9\sigma^2}\right)^\alpha-1, & \text{polynomial}, \alpha=4 \\ 2\cdot\mathbf{1}_{[\mu\pm\sigma]}(u)-1, & \text{rectangular} \\ \ldots, & \text{etc.} \end{cases} }[/math]
where [math]\displaystyle{ u }[/math] is a potential value drawn from [math]\displaystyle{ \mathbf{U}^t }[/math].
The Game of Life may be regarded as a special case of discrete Lenia with [math]\displaystyle{ R = T = P = 1 }[/math]. In this case, the kernel would be rectangular, with the function[math]\displaystyle{ K_C(r) = \mathbf{1}_{\left[\frac{1}{4},\frac{3}{4}\right]}(r) + \frac{1}{2}\mathbf{1}_{\left[0,\frac{1}{4}\right)}(r) }[/math]and the growth rule also rectangular, with [math]\displaystyle{ \mu = 0.35, \sigma = 0.07 }[/math].
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]
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" [math]\displaystyle{ \mathbf{K} }[/math]) with an activation function (the "growth mapping" [math]\displaystyle{ G }[/math]). However, Lenia uses far larger, fixed, kernels and is not trained via gradient descent.
Original source: https://en.wikipedia.org/wiki/Lenia.
Read more |