Skip to content

Commit

Permalink
Update numpy.trapz to numpy.trapezoid.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 706619057
  • Loading branch information
znah authored and Selforg Gardener committed Dec 16, 2024
1 parent 488003f commit cbfcb88
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions notebooks/particle_lenia.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
"\n",
"* Combining multiple different update rules is possible by attaching them to individual particles (note that we mostly focus on single particle-type models in this article, as we find their behavior sufficiently interesting).\n",
"\n",
"* Particle based simulation is easy to implement and scales well when switching from 2D to 3D space. \n",
"* Particle based simulation is easy to implement and scales well when switching from 2D to 3D space.\n",
"\n",
"There are quite a few known particle-based artificial life simulations, including the classic [Boids](https://en.wikipedia.org/wiki/Boids), [Primordial Particle Systems](https://www.nature.com/articles/srep37969) and many others. We think that the main contribution of this work is to provide a link between the popular Lenia model and particle systems. The proposed artificial life model demonstrates a large diversity of interesting and even beautiful behaviors, even in the case when all particles share the same parameters. We also examine the model dynamics through the lens of a greedy local energy minimization process, and compare the behavior of the model to that of running with an equivalent global energy minimization routine. We find that the difference in behavior between these paradigms is non-intuitive and may have significance for the design of future systems of optimized interacting agents.\n"
]
Expand Down Expand Up @@ -881,7 +881,7 @@
"def calc_K_weight(mu, sigma, dim_n):\n",
" r = jp.linspace(max(mu-sigma*4, 0.0), mu+sigma*4, 51)\n",
" y = peak_f(r, mu, sigma) * r**(dim_n-1)\n",
" s = jp.trapz(y, r) * {2:2,3:4}[dim_n] * jp.pi\n",
" s = jp.trapezoid(y, r) * {2:2,3:4}[dim_n] * jp.pi\n",
" return 1.0/s\n",
"\n",
"def create_params(m_k, s_k, m_g, s_g, rep, dim_n):\n",
Expand Down Expand Up @@ -983,9 +983,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"background_save": true
},
"id": "k2_VvE8ZQiuS"
},
"outputs": [],
Expand Down Expand Up @@ -1030,9 +1027,6 @@
"execution_count": null,
"metadata": {
"cellView": "form",
"colab": {
"background_save": true
},
"id": "L9SckwekgO3U"
},
"outputs": [],
Expand Down Expand Up @@ -1090,17 +1084,17 @@
},
"source": [
"## Conclusion\n",
" \n",
"\n",
"In this article we described Particle Lenia, a new particle system ODE-based artificial life model that is inspired by the Lenia PDE system.\n",
" \n",
"\n",
"**Interactive demo and collecting creatures.** The introduction video shows a few creatures and behaviors we found by varying Particle Lenia parameters. These creatures were discovered using the interactive [browser-based demo](https://znah.net/lenia). We invite readers to participate in finding new creatures and sharing them on social media. Preview images created by the demo contain all information needed to bring them into life again, simply drag and drop the image file into the demo window!\n",
" \n",
"\n",
"**Future work** The obvious bit that is missing from this article are multi-creature/multi-particle types experiments. Although the model simulation code can be trivially extended to support per-particle parameters, we decided to leave this exploration for the future. Another promising future work direction is goal driven search for patterns and rules capable of forming specific patterns or performing specific tasks, in the spirit of [Sensorimotor Lenia](https://developmentalsystems.org/sensorimotor-lenia/). We believe that these principles of particle swarm design can later be applied to real world self-organizing systems.\n",
" \n",
"\n",
"**Reproducibility** All experiments and diagrams in this article were produced using this [colab notebook](https://colab.research.google.com/github/google-research/self-organising-systems/blob/master/notebooks/particle_lenia.ipynb). The [introduction video](https://youtu.be/AP3zeHyWakw) demonstrates a number of creatures that were discovered, and can be explored in the supplementary [interactive demo](https://znah.net/lenia)\n",
" \n",
"\n",
"**Acknowledgements** We would like to thank [Bert Chan](https://chakazul.github.io/) and [INRIA Flowers](https://flowers.inria.fr/) team for inspiring this work and providing early feedback.\n",
" \n",
"\n",
"**Citing Particle Lenia** For attribution in academic contexts, please cite the arxiv version of this article (to be released Q1 2023)"
]
}
Expand Down

0 comments on commit cbfcb88

Please sign in to comment.