Simulating Life on my Computer like a Scientist

  Рет қаралды 30,549

Tsoding Daily

Tsoding Daily

Жыл бұрын

Chapters:
- Coming Soon
References:
- SmoothLife Paper: arxiv.org/pdf/1111.1567.pdf
- Lenia Paper: arxiv.org/pdf/1812.05433.pdf
- RealLife: arxiv.org/pdf/math/0503504.pdf
- Coq Assistant: coq.inria.fr/
- Prefetching in Functional Languages: dl.acm.org/doi/pdf/10.1145/33...
- sourceforge.net/projects/smoo...
- Source Code: github.com/tsoding/SmoothLife
Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9

Пікірлер: 68
@noctavel
@noctavel 11 ай бұрын
RealLife paper is actually pretty consistent with real life. nobody understands shit
@miran248
@miran248 11 ай бұрын
So you're saying those who understand it, now understand life?
@npas76
@npas76 9 ай бұрын
@@miran248he did not say that at any point in that comment
@lloydbush
@lloydbush Ай бұрын
Give me the area of a circle: - Mathmatician: π*r^2 - Engineer: 3*r^2 - Tsoding: just sum all the points of an arbitrary interval
@maksasj
@maksasj 11 ай бұрын
1:07:55 In 2 years I will have opportunity to write proper scientific paper for my bachelor degree, and I swear I will use one of yours projects as a reference.
@korigamik
@korigamik 11 ай бұрын
Challenge accepted
@garethma7734
@garethma7734 11 ай бұрын
52:30 I mean, the definition of M here is actually the correct one (instead of the usual "pi R^2" or whatever) since you want to clamp the result to [0, 1]. Random mathematician knowledge dump, computing the exact value of M given just R is actually quite hard, especially mathematically. It's called the Gauss circle problem and is one of those hard number theory problems
@futurisold
@futurisold 11 ай бұрын
yes, please do more paper series!
@valovanonym
@valovanonym 11 ай бұрын
Paper reviews would be a cool series 👀
@BirdbrainEngineer
@BirdbrainEngineer 2 ай бұрын
When I was working through the SmoothLife paper, I found it a little bit wonky myself as well, especially as I had actually worked through the Lenia paper first which in my opinion explained things much better. Ontop of that, the mathematical way of explaining these systems has always been really difficult for me to reason about, and instead, for me it's easier to think of them in the programmer way, which is to say operation by operation. Your simulations are running correctly, but the parameters need fine-tuning; both in SmoothLife and in Lenia the "interesting" parameter sets are fairly chaotic and require fine tuning of the parameters to at least 2 decimal places, usually more like to 3 decimal places.
@MrYefh
@MrYefh 11 ай бұрын
I love you, please keep doing streams about simulating life-like systems
@FacePalmProduxtnsFPP
@FacePalmProduxtnsFPP 10 ай бұрын
The tip on staying in boundaries of arrays using Euclidean mod was super helpful. Thank you!
@michalbotor
@michalbotor 11 ай бұрын
when you calculate sigma1(x=n, a) and sigma1(x=n, b) i would use alphan, but when you calculate sigma1(x=m, 0.5) i would use alpham.
@JonnyDeRico
@JonnyDeRico 11 ай бұрын
who doesn't move in the direction of their thickest part?
@lovely-shrubbery8578
@lovely-shrubbery8578 11 ай бұрын
You calling me fat 😭
@nomadvagabond1263
@nomadvagabond1263 11 ай бұрын
Thats why i always find myself sitting😏
@davidaloysparrow219
@davidaloysparrow219 11 ай бұрын
Love these streams!
@drdca8263
@drdca8263 11 ай бұрын
Something I’ve wondered for a while about systems like SmoothLife and Lenia, is that, these systems are translation invariant, they have a continuous translation symmetry, but, it seems like, because they aren’t described by Hamiltonian mechanics, that doesn’t result in them having conservation of momentum (or of angular momentum). It would be interesting, I think, if they could be modified in a way to make them fit into the framework of Hamiltonian or Lagrangian mechanics, in order to get a version that does have conservation of momentum (and if angular momentum). That would be cool, I think! But, I’m not sure how that would be best done... I guess for one thing, would need to have a continuous time version of the system in order to be able to put it into those frameworks. I think there are some theories of how to take a system that doesn’t quite obey Hamiltonian mechanics due to losing energy (e.g. because of friction with an external environment not considered part of the system), and come up with like, a Hamiltonian system that has a pair of interacting systems, one of which is the one one wants to model? Or something like that? Idk. Hm, ok, but, suppose we first are just looking at the state space for smoothlife, and we like, want to describe what sort of thing momentum should be, and well, it should be the generator of translation symmetry.. I guess we have a field which describes the “aliveness” at each point, and you could talk about, for each point, an operator that takes a state and returns the aliveness at that point in that state. and, the translation symmetry would be like, an family of automorphisms of the algebra of those kinds of operators, and I guess, the derivation of the function at a point in a given direction, would be the momentum at that point in that direction? ... maybe the problem is just that the total momentum is always zero, and is therefore trivially conserved? Well, assuming that the aliveness far away is zero in all directions. If that’s why, then maybe having complex values like in quantum mechanics would help? Or... Maybe it is due to like, stuff not being linear enough? Idk
@bartpelle3460
@bartpelle3460 11 ай бұрын
I'm pretty sure I understood nothing
@koktszfung
@koktszfung 11 ай бұрын
Is it similar to Hamiltonian in fluid mechanics?
@drdca8263
@drdca8263 11 ай бұрын
@@koktszfung Is what? Hamiltonians in general? Yes. Hamiltonians are Hamiltonians. They do the same kind of thing. SmoothLife is, I think, not described by a Hamiltonian, but I was hoping that maybe a small modification to it could be made to make it so it could be described by a Hamiltonian (or a Lagrangian) . But I’m not really sure how one would go about making such a change. If one could make such a change, the result would, I think, have conservation of momentum, conservation of angular momentum, and conservation of energy, which would be cool I think.
@koktszfung
@koktszfung 11 ай бұрын
@@drdca8263 sorry I realised what I said makes no sense, I mean maybe you could treat the aliveness as a scalar field and write the Hamiltonian of the field
@drdca8263
@drdca8263 11 ай бұрын
@@koktszfung Oh, ok! Makes sense then. That sounds like it could work, but I’m unsure about how specifically that would be done. Thanks for the pointer though. I had been mostly thinking about Lagrangians (even though I might have said Hamiltonian), and maybe thinking about it that way could be clearer? I will look some stuff up
@GTS00000
@GTS00000 11 ай бұрын
paper implementation, yes, more please
@Jack-sy6di
@Jack-sy6di 9 ай бұрын
You're not dumb, the SmoothLife paper is just not very well written and clearly not written by a pure mathematician (in the author's defense though it looks like they probably just kinda threw it together, it's probably not the best representation of their writing abilities). It would actually be clearer if it were written MORE in the style of a pure math paper. I'm also not sure what they're talking about with alpha_n and alpha_m, but the whole set of formulas they use for the transition formula is basically just fuzzy boolean logic. sigma_1(x, a) is basically 1 when x > a and 0 when x < a, except it doesn't actually swap from 0 to 1 instantly, it fades continuously between them. It's like a fuzzy x > a. If you read the other formulas and pretend that sigma_1(x, a) is just boolean x > a, it makes sense. sigma_2(x, a, b) is 1 if a < x < b and 0 otherwise. sigma_m(x, y, m) selects either x or y depending on if m > 1/2. And finally in s(n, m) we're basically saying that if m > 1/2 let I = [b1, b2] (the birth interval) and if m < 1/2 let I = [d1, d2]; and then just return 1 if n is in I and 0 otherwise. So alpha controls the "fuzziness" of the fuzzy boolean logic operators, higher alpha meaning more fuzzy. In total though, the function s(n, m) involves four different calls to sigma_1 and you could in principle use a different fuzziness for all of them, so if we want we could even have alpha1, alpha2, alpha3 and alpha4. My best guess is that they want you to use alpha_n when you're making a call that "involves" n and alpha_m when it "involves" m, so in practice that would mean sigma_m uses alpha_m and sigma_2 uses alpha_n. (maybe you say all this in the stream, I'm kinda skipping around)
@adrian66696
@adrian66696 11 ай бұрын
1:04:08 alpha_m and alpha_n are just the respective alpha for when you compute eq. 3 for either m or n. By looking at eq.3, you just need to set alpha to alpha_m when x is m, and set it to alpha_n when x is n. s(n, m) calls sigma_2 with x = n, which then calls sigma with x=n. s(n, m) also calls sigma_m which calls sigma_1 with x=m. I think the idea is that you want to smooth the edges of the circles since you have aliasing, for the smaller circle you want more smoothing, and for the bigger one you don't need as much. EDIT: he points it out in the next live
@ghostroll
@ghostroll 11 ай бұрын
brilliant video as always. side note: for emod you don't have to do the first modulo, you can just do { return (a+b)%b}. works for both negative and positive cases.
@SlimyDash
@SlimyDash 11 ай бұрын
this doesnt work for a < (-b) unfortunately
@johnpavel1913
@johnpavel1913 11 ай бұрын
The different alphas are used to smooth in the inner and outer rings
@afmikasenpai
@afmikasenpai 26 күн бұрын
54:37 damn this is so relatable, that was me a few months ago. I hate how 'easy' yet so damn confusing this paper looks xD
@omaramo190683
@omaramo190683 11 ай бұрын
another fucking great tsoding session
@davideferrara6274
@davideferrara6274 11 ай бұрын
Awesome stream!
@spacewad8745
@spacewad8745 11 ай бұрын
yoyoyoyoyo. fking brilliant as always
@tdoc666___
@tdoc666___ 4 ай бұрын
tson actualy showed us how complicated life is, and how much of engineering you actually need to create life, something weird actually bumped into my head, could actually life have been engineered by an intelligent engineer or all this complexity came by itself, bu if it came by itself, then how can it know all this formulas by itself, you know this kind of things is really interesting.. what do u think?
@taileebao
@taileebao 11 ай бұрын
I think your coding tool is VIM and you use it very well through keymaps, so can you make a video about it? Thank you
@OpenKeith
@OpenKeith 11 ай бұрын
Actually, they use Emacs. If you want to try it out, I'd personally recommend checking out the Doom Emacs configuration framework (it comes with a lot of useful modules and defaults, and even has a Vim-style keymap mode)
@Golimko
@Golimko 2 ай бұрын
1:24:49 in the paper when updating the current cell state they multiply S[s(n, m)] by current value f(x, t), and you don't. maybe this is the problem
@angelomarano8458
@angelomarano8458 11 ай бұрын
thank you!
@mertunsal1389
@mertunsal1389 11 ай бұрын
Anybody understands what kind of terminal he's using?
@mellowyellow7523
@mellowyellow7523 11 ай бұрын
drinking game, take a sip every time he says right
@keremardicli4013
@keremardicli4013 11 ай бұрын
Holy moly
@xanhx
@xanhx 11 ай бұрын
so cool
@andreypopov6166
@andreypopov6166 11 ай бұрын
а я только кнопочки по экрану двигать могу...Спасибо за инспирейшен!
@gabef9538
@gabef9538 11 ай бұрын
Next, train a neural net for generating the next frame of a microscope.
@DaRza17
@DaRza17 2 ай бұрын
I would love to see that being done in Pygame.
@ConnorMcCormick
@ConnorMcCormick 11 ай бұрын
damn this guy is good at vim
@BlueDippy
@BlueDippy 10 ай бұрын
Bro you are cracked
@Paxsali
@Paxsali 11 ай бұрын
I like stimulating life on your computer.
@_orangutan
@_orangutan 11 ай бұрын
I understand some but not all. Maybe if I dedicate a week to it, I'll understand it.
@piotao
@piotao 11 ай бұрын
The problems with the paper explain WHY it is posted on arxiv - it will never pass the rigid review required for good scientific papers. So many unexplained things left.
@ammarahmad4872
@ammarahmad4872 11 ай бұрын
wow
@doxnit4343
@doxnit4343 11 ай бұрын
24:00 Not impressed. Almost all editors have substitution with regex. BUT Vim has Vim Disel. Does Emacs have its own Luke Smith???? Checkmate
@Neuer_Alias_erstellen
@Neuer_Alias_erstellen 6 ай бұрын
wow a real Tsientist
@bizarrapmusic
@bizarrapmusic 11 ай бұрын
30:04 lmaoooo i can't hahahha
@douglasgabriel99
@douglasgabriel99 11 ай бұрын
I'm scared
@user-un1fq7uz7z
@user-un1fq7uz7z 11 ай бұрын
Очень классное видео) хороший английский прям, не понял ваще, что ты русский
@TurtleKwitty
@TurtleKwitty 11 ай бұрын
vim can do it /better/ actually ;3
@fxs2008
@fxs2008 11 ай бұрын
Instead of ((x%100) + 100)%100 you could do simpler: (x + 100)%100, it does not break negative numbers.
@sirynka
@sirynka 11 ай бұрын
Unless you'd go below -100 His impl would work for -250 your wouldn't
@Rookie_AI
@Rookie_AI 11 ай бұрын
hey, are you drunk when you're live,
@dysb
@dysb 11 ай бұрын
God, I wish you wrote Rust. Watching a skilled someone tackle a relatively complex problem is a great way to learn a language. I have zero desire to deepen my knowledge of C when there's more modern alternatives that, crucially, compile to WASM. Why not Rust?
@albusdandelion719
@albusdandelion719 11 ай бұрын
C is more fun
@dandreani
@dandreani 11 ай бұрын
just translate that to rust... you will learn rust and c at the same time
@niculaelaurentiu1201
@niculaelaurentiu1201 11 ай бұрын
He has Rust streams that you can watch
@andrewgr144
@andrewgr144 11 ай бұрын
Really? No one's going to comment on the 6.7GiB Porn Folder self-disclosure? Are you all actually paying attention to the content, rather than looking for opportunities to be snarky? Are you even trying?
@evasiveutopian
@evasiveutopian 11 ай бұрын
Why r_a? Answer: because the shape of the "2d donut" (r_a - r_i) is called an "annulus". See en.wikipedia.org/wiki/Annulus_(mathematics) (I am guessing)
My GPU Almost Died Doing This Life Simulation
2:24:01
Tsoding Daily
Рет қаралды 17 М.
Parsing Java Bytecode with Python (JelloVM Ep.01)
2:25:53
Tsoding Daily
Рет қаралды 56 М.
🍟Best French Fries Homemade #cooking #shorts
00:42
BANKII
Рет қаралды 12 МЛН
О, сосисочки! (Или корейская уличная еда?)
00:32
Кушать Хочу
Рет қаралды 7 МЛН
Cute Barbie gadgets 🩷💛
01:00
TheSoul Music Family
Рет қаралды 71 МЛН
I Made a Zero Player Game
12:30
Sam Hogan
Рет қаралды 10 МЛН
Why is Raylib becoming so popular?
9:24
Chris_PHP
Рет қаралды 13 М.
My First Hello, World in C. Very proud!
33:59
Tsoding Daily
Рет қаралды 69 М.
coding in haskell until i rage quit
1:03
Low Level Learning
Рет қаралды 281 М.
Why do C Programmers Always Obfuscate Their Code?
2:01:57
Tsoding Daily
Рет қаралды 40 М.
Artificial Life uses Machine Learning to learn how to survive
4:53
I regret doing this...
1:20:07
Tsoding Daily
Рет қаралды 61 М.
Куда пропал 3D Touch? #apple #iphone
0:51
Не шарю!
Рет қаралды 547 М.
XL-Power Best For Audio Call 📞 Mobile 📱
0:42
Tech Official
Рет қаралды 772 М.
ПРОБЛЕМА МЕХАНИЧЕСКИХ КЛАВИАТУР!🤬
0:59
Корнеич
Рет қаралды 3,3 МЛН
Apple iPhone 15 Pro Max With Smallrig Professional Photography kit #shorts
0:14
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 9 МЛН
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 257 М.