Build a Simulation in 5 Min

  Рет қаралды 61,583

Siraj Raval

Siraj Raval

Күн бұрын

We're going to build our own version of Conway's famous Game of Life in 60 lines of Python! The Game of Life simulates biological evolution and is an example of how mind-boggling complexity can emerge from just a few simple rules. This video isn't straight up machine learning, but instead an intro into this way of thinking. If the universe works this way, our brains must as well. I truly believe that the master algorithm behind human intelligence will be much simpler than we expect.
Code for this video:
github.com/llSourcell/simulat...
I created a Slack channel for us, sign up here:
wizards.herokuapp.com/
I recently created a Patreon page. If you like my videos, feel free to help support my effort here!:
www.patreon.com/user?ty=h&u=3...
Online Implementation of the Game of Life here:
www.bitstorm.org/gameoflife/
Community dedicated to the Game of Life:
conwaylife.com/
Awesome article on the Game of Life:
www.math.cornell.edu/~lipa/mec...
Variations of the Game of Life:
cs.stanford.edu/people/erober...
Really, really good read-up on Cellular Automata:
natureofcode.com/book/chapter-...
Much more to come so please subscribe, like, and comment.
Follow me:
Twitter: / sirajraval
Facebook: / sirajology Instagram: / sirajraval Instagram: / sirajraval
Signup for my newsletter for exciting updates in the field of AI:
goo.gl/FZzJ5w
Hit the Join button above to sign up to become a member of my channel for access to exclusive content! Join my AI community: chatgptschool.io/ Sign up for my AI Sports betting Bot, WagerGPT! (500 spots available):
www.wagergpt.co

Пікірлер: 123
@davey_edwards
@davey_edwards 7 жыл бұрын
Just found your channel, nice videos and ways of making them. They are very entertaining to watch with alot of knowledge in them. Keep it up, this channel will get big!
@SirajRaval
@SirajRaval 7 жыл бұрын
thanks Davey!! Please re-share if you found it useful!
@panagiotispetridis7961
@panagiotispetridis7961 7 жыл бұрын
Those video are getting better and better!
@SirajRaval
@SirajRaval 7 жыл бұрын
thanks!!
@robinkohrs8097
@robinkohrs8097 3 жыл бұрын
thanks so much!! Just one question: What do the testx and testy in the healthy_neighbors-function do? I thnk its for the border condition, but I'm not completely sure...
@benhayz1
@benhayz1 7 жыл бұрын
Watching all your vids in a playlist today. Keep up the great work!
@SirajRaval
@SirajRaval 7 жыл бұрын
Thanks Ben, glad to have you on board
@MichaelBuergerArt
@MichaelBuergerArt 7 жыл бұрын
Is it wrong I'm sad this channel is growing? These videos are so great, I just want them for myself :D
@SirajRaval
@SirajRaval 7 жыл бұрын
haha! Thanks so much. I feel you, i'm like that when it comes to fashion styles.
@MichaelBuergerArt
@MichaelBuergerArt 7 жыл бұрын
Sirajology oh cool! you responded, hope you don't stop when this channel gets larger, kinda thing happens a lot sadly.
@FuzzyOne2007
@FuzzyOne2007 7 жыл бұрын
Hi Siraj, love your videos man, I have a question, I'm looking to get into machine learning and my first task I want to accomplish is finding an equation to a two column problem, for instance say I have data like below, I have about a 60% complete dataset. 0000000 = 1234 0000001 = 6789 and so on to... 9999999 = 3434 How do I go about finding the missing rows, as far as I understand I need to do supervised learning, with say 80% of my data to train a model and the other 20% to validate. I'm using Azure to play around but hitting a complete brick wall, do you have any tips for me, is ml even the right choice for solving this?
@SirajRaval
@SirajRaval 7 жыл бұрын
Thanks! Yes this is an ML problem. Predictive modeling. Treat the first column as x values and the second as y values. So each row is a coordinate pair (x,y). You want to plot those points on a graph and find the line of best fit. See this stackoverflow.com/questions/22239691/code-for-line-of-best-fit-of-a-scatter-plot-in-python you can do this in python
@amadeusml
@amadeusml 7 жыл бұрын
Thanks! The speed with which you went through the code worked a lot better for me in this one (seemed slightly slower, I had to pause a lot in the other videos).
@SirajRaval
@SirajRaval 7 жыл бұрын
thanks for saying this, very good feedback i'll keep in mind for future vids
@bballfanmobile2544
@bballfanmobile2544 6 жыл бұрын
I'm trying write this program under macOS X, using Canopy Python 3.5. What libraries can I use to control the screen???
@spawnermaster3794
@spawnermaster3794 7 жыл бұрын
Congrats on 10k!
@SirajRaval
@SirajRaval 7 жыл бұрын
thank you so so much. holy shit i'm so happy, just getting started!!!
@lumlins2104
@lumlins2104 7 жыл бұрын
Ha ha now look at you
@vybhavab
@vybhavab 7 жыл бұрын
I did this in java for my APCS class. It was so fun! Great video btw!
@SirajRaval
@SirajRaval 7 жыл бұрын
Dope, isn't it fun?? thanks
@vybhavab
@vybhavab 7 жыл бұрын
It's so fun!
@wyattb3138
@wyattb3138 5 жыл бұрын
I’m too dumb to code 😪
@danielmuriithi8486
@danielmuriithi8486 7 жыл бұрын
Great content awesome as always Siraj
@manuhortet
@manuhortet 7 жыл бұрын
Great! Amazing videos bro, keep on the good work!! Subscribed!
@SirajRaval
@SirajRaval 7 жыл бұрын
Manu thank you!! much more to come
@Trendlitesocial
@Trendlitesocial 7 жыл бұрын
just got into your series and i like it. however i am a complete noob to coding as i didn't go to school for it. i am taking a udacity course and trying to follow along with you as i learn coding and ml. Do you think this is ok or would you suggest i learn to code first then come back.
@SirajRaval
@SirajRaval 7 жыл бұрын
follow along with me at the same time is best
@furkankaynar6491
@furkankaynar6491 5 жыл бұрын
Your energy is awesome
@liambond5653
@liambond5653 2 жыл бұрын
I was trying to follow the code, but it gives no module named terminal error ... can someone point me in the right direction?
@SaikatBasak
@SaikatBasak 7 жыл бұрын
Awesome video. I'll try to do it in Octave and share.
@SirajRaval
@SirajRaval 7 жыл бұрын
good call
@exec9292
@exec9292 7 жыл бұрын
Absolutely awesome!!!!
@SirajRaval
@SirajRaval 7 жыл бұрын
woot woot thanks!
@ignaciotonolidemaussion3249
@ignaciotonolidemaussion3249 7 жыл бұрын
Hi I tried out but there is an error at line 2 "from terminal import *" ImportError: No module named terminal I'm working on macOS El Capitan
@JoshuaShope
@JoshuaShope 6 жыл бұрын
only works with python2
@thesource3376
@thesource3376 6 жыл бұрын
The error goes away after typing "pip install terminal" in the CMD (command prompt).
@hligfl
@hligfl 4 жыл бұрын
me I do it but nothing happens. Indeed nothing is asked to be printed. Any idear ?
@xus9380
@xus9380 4 жыл бұрын
Can you make tutorial about making a slot gaming game (slot result from random number generator)
@choglog
@choglog 7 жыл бұрын
another great video!
@SirajRaval
@SirajRaval 7 жыл бұрын
Thanks Exor!!
@larryteslaspacexboringlawr739
@larryteslaspacexboringlawr739 7 жыл бұрын
thank you very much for video about simulation using python
@SirajRaval
@SirajRaval 7 жыл бұрын
anytime!! more to come
@diegoalpizar6857
@diegoalpizar6857 4 жыл бұрын
Great video!
@xxXXCarbon6XXxx
@xxXXCarbon6XXxx 7 жыл бұрын
You can see interviews with Conway on the Nuberphile channel
@SirajRaval
@SirajRaval 7 жыл бұрын
yes!! that is a great channel
@hugoporras14
@hugoporras14 5 жыл бұрын
Hey Siraj, any way of doing this on windows, i wouldnt like to buy a Mac to do this. :(
@Beyblade0battles
@Beyblade0battles 5 жыл бұрын
Yeah man of course you can do it on windows. I dont exactly know how but im 1000% sure you can do this on windows. its just a python program. and you can use other programming languages to do this too
@hugoporras14
@hugoporras14 5 жыл бұрын
@@Beyblade0battles the thing is that terminal is a MAC OS library, And you cant use It on Windows
@Beyblade0battles
@Beyblade0battles 5 жыл бұрын
@@hugoporras14 ah ok. I'm sure there's a way to do this without that library
@wyattb3138
@wyattb3138 5 жыл бұрын
I just watched a SpaceX presentation on aerodynamics and combustion simulations.
@44_bulldogT
@44_bulldogT Жыл бұрын
Brother, tried to run the code and it didn't work. Need help.
@JoelWilsonthelittlen
@JoelWilsonthelittlen 7 жыл бұрын
? what ver of python do u use ?
@SirajRaval
@SirajRaval 7 жыл бұрын
3.5
@endlacer
@endlacer 7 жыл бұрын
Line 36: Why do you set new_grid = grid ? new_grid is overwritten in line 33. No use assigning it, am I right? good job :)
@santhosh3374
@santhosh3374 6 жыл бұрын
bro i am sorry to say but i have to..that code contains several mistakes which include open and close brackets in several places for print function and few more...if i am wrong correct it...i am happy to accept it
@angelthekind1595
@angelthekind1595 3 жыл бұрын
NameError: name 'get_term_size' is not defined also more variables im not sure if this is real
@ianh5537
@ianh5537 7 жыл бұрын
Nice! Game of life weekend!
@SirajRaval
@SirajRaval 7 жыл бұрын
yes!! It is because we say so!!
@alifyz
@alifyz 7 жыл бұрын
You are amazing!
@SirajRaval
@SirajRaval 7 жыл бұрын
thanks so are you!
@mysmart_yg
@mysmart_yg Жыл бұрын
don't think I will get a replay after 6 years of this video but I am new to python and it's giving me an error import terminal could not be resolved Nice videos btw
@ramalingeswararaobhavaraju5813
@ramalingeswararaobhavaraju5813 3 жыл бұрын
Thank sir.
@pratikjain4704
@pratikjain4704 6 жыл бұрын
you rock :)
@Ascended
@Ascended 7 жыл бұрын
how can i run this script on windows
@SirajRaval
@SirajRaval 7 жыл бұрын
pythoncentral.io/execute-python-script-file-shell/
@ONSTART
@ONSTART 4 жыл бұрын
yo cool video dude
@puryteevee
@puryteevee 7 жыл бұрын
hey can you do this using turtle graphics?
@SirajRaval
@SirajRaval 7 жыл бұрын
yes
@chinmayanaik1380
@chinmayanaik1380 7 жыл бұрын
raj it says syntax error
@andrewhumphreys9020
@andrewhumphreys9020 7 жыл бұрын
I know I post way too much on your videos, but can you make some sort of series where you challenge us to do some shit, python, nodeJS, whatever? And review our results, and maybe compare it to something you did? IDK. I just like being challenged to do shit.
@SirajRaval
@SirajRaval 7 жыл бұрын
no such thing, post away. this is a brilliant idea. i'm definitely going to do this for my next video. thanks so much!!
@andrewhumphreys9020
@andrewhumphreys9020 7 жыл бұрын
Sirajology :D.
@andrewhumphreys9020
@andrewhumphreys9020 7 жыл бұрын
at 2:20, before I even get into learning your python code it seems incredibly doable with minimal code. The hard part for me (with all code in general) is figuring out how I would do that. So I am going to walk around for an hour or something, and think how I could carry that out. (I always just get all these ideas for coding.. I don't want to think about anything else than how I can carry stuff out.. It is.. weired but awesome.)
@andrewhumphreys9020
@andrewhumphreys9020 7 жыл бұрын
Well, I have an idea of how it is possible. Just scan in a grid, and go check around a live cell and all of that. I can envision the code, but I am too lazy to write it out, as I am not super hyped about coding this. (Lazy, it is 9:51...)
@andrewhumphreys9020
@andrewhumphreys9020 7 жыл бұрын
Anyways, I am going to use youtube to advertise my new website. Everyone goto getgnulinux.xyz for advice on picking a Linux distro, or (at now, a small small selection) information on various shits.
@SirajRaval
@SirajRaval 7 жыл бұрын
no dude i feel you. i do the same. walking and thinking is the best
@kacperozieblowski3809
@kacperozieblowski3809 6 жыл бұрын
Simulation? Mate it is just simple game of life!
@cameronbehar7358
@cameronbehar7358 7 жыл бұрын
Excellent video as usual. Minor nit though: von Neumann is pronounced von NOY-men rather than von NU-men. German :P
@SirajRaval
@SirajRaval 7 жыл бұрын
thanks Cameron good call
@danielhoward4333
@danielhoward4333 7 жыл бұрын
Okay but: singular == automaton plural == automata So, any individual cell is an automaton, and the cells together are automata ... See also: datum / data, criterion / criteria ...
@SirajRaval
@SirajRaval 7 жыл бұрын
good call, thanks
@xPROxSNIPExMW2xPOWER
@xPROxSNIPExMW2xPOWER 7 жыл бұрын
this was one of my assignments, wayyyy worse that you made it out to be lol good times
@SirajRaval
@SirajRaval 7 жыл бұрын
:) glad to hear it
@RS-so7ke
@RS-so7ke 6 жыл бұрын
How to create it without using a buffer matrix
@CTimmerman
@CTimmerman 6 жыл бұрын
google "sparse matrix"
@clearmenser
@clearmenser 7 жыл бұрын
classic universe mate
@SirajRaval
@SirajRaval 7 жыл бұрын
such a classic
@clearmenser
@clearmenser 7 жыл бұрын
You know about the turing complete 1D cellular automata from Wolfram, right? Or read "Pumutation City" from Greg Egan? Mmm automata.
@anger42
@anger42 2 жыл бұрын
This isn't a video on creating a simulation...this is a break down of how someone else created a game...or am I missing something??
@whatthefunction9140
@whatthefunction9140 7 жыл бұрын
why would an advanced martian rover be made of iron?
@SirajRaval
@SirajRaval 7 жыл бұрын
iron isn't a bad material, i'm sure the curiosity rover has some iron in it
@whatthefunction9140
@whatthefunction9140 7 жыл бұрын
I was just messing with you :) thanks for the great videos!
@gustavomartinez6892
@gustavomartinez6892 5 жыл бұрын
Pretty smart!!!
@elainekent6821
@elainekent6821 3 жыл бұрын
Check this web to Build a Simulator in 5 Minutes
@justinfrancis5834
@justinfrancis5834 7 жыл бұрын
Hey Siraj someone called you an owl!
@SirajRaval
@SirajRaval 7 жыл бұрын
a Twilio Owl? I used to be!!
@justinfrancis5834
@justinfrancis5834 7 жыл бұрын
The appropriate response is "Who!?!"
@againstballveer5316
@againstballveer5316 7 жыл бұрын
Hey Siraj, I sent you a Hangout request, please accept it. I have a great idea for a chatbot I want to discuss with you.
@SirajRaval
@SirajRaval 7 жыл бұрын
email it to me! sirajraval1@gmail.com
@againstballveer5316
@againstballveer5316 7 жыл бұрын
I sent it to you by email, check it out.
@simocennetten5239
@simocennetten5239 7 жыл бұрын
lol can i do that in trading
@SirajRaval
@SirajRaval 7 жыл бұрын
yes
@justinTime077
@justinTime077 2 жыл бұрын
This guys like a crypto salesman that sells coding. Fuckin Bill Nye the coding AI Guy
@fridget8799
@fridget8799 7 жыл бұрын
l tried to do it in pygame. Here's the result: i.imgur.com/Iilflf6.gifv Thanks for the tutorial Siraj!
@SirajRaval
@SirajRaval 7 жыл бұрын
dude dope AF. Keep it up, that was awesome
@againstballveer5316
@againstballveer5316 7 жыл бұрын
wwwwwwwhhhhhaaaaaatttttt????????
@SirajRaval
@SirajRaval 7 жыл бұрын
mindsplosion? :)
@Mikewee777
@Mikewee777 6 жыл бұрын
Down Voted over golden ratio.
@choglog
@choglog 7 жыл бұрын
another great video!
@SirajRaval
@SirajRaval 7 жыл бұрын
:)
Tensorboard Explained in 5 Min
5:49
Siraj Raval
Рет қаралды 75 М.
Planet Simulation In Python - Tutorial
1:00:02
Tech With Tim
Рет қаралды 493 М.
🌊Насколько Глубокий Океан ? #shorts
00:42
3 wheeler new bike fitting
00:19
Ruhul Shorts
Рет қаралды 43 МЛН
Why is P vs NP Important?
7:27
Siraj Raval
Рет қаралды 157 М.
WRITING MY FIRST MACHINE LEARNING GAME!
10:02
Jabrils
Рет қаралды 1,9 МЛН
Стили обучения - это миф [Veritasium]
13:12
Vert Dider
Рет қаралды 755 М.
How to Do Mathematics Easily - Intro to Deep Learning #4
9:51
Siraj Raval
Рет қаралды 204 М.
Simulating Real-Life Processes in Python
17:54
NeuralNine
Рет қаралды 72 М.
Molecular Dynamics in 5 Minutes
4:36
MD Simulators
Рет қаралды 102 М.
How to Make an Amazing Video Game Bot Easily
7:34
Siraj Raval
Рет қаралды 482 М.
🌊Насколько Глубокий Океан ? #shorts
00:42