GoL operates on a discrete grid and discrete time steps. There is quite a lot of interesting behavior that can come of this very simple rule set.Īnother of my GoL projects can be found here - GoL in 9 lines of horribly obfuscated C. If a dead cell has exactly 3 live neighbors, it will come alive. If it has more than 3 live neighbors, it'll die off from being overcrowded. If it has fewer than 2 live neighbors, it'll die off of loneliness. If a cell is alive and it has 2 or 3 live neighbors, it will stay alive. Each cell has a total of 8 neighbor cells. At each next moment in time, a cell can change state or stay the same. Each cell is either alive or dead at any moment in time. Imagine a 2D grid of cells (think graph paper). There is a bunch of information on the internet about Conway's Game of Life (GoL), and if you haven't heard of it before, I suggest you learn about it because it'll make the rest of this make a lot more sense. I wasn't happy with the look of the continuous time solution, but it's in the source comments if you want to poke at it. So far I have the discrete time step version working well. Written in Python using numpy and explained (hopefully) without too much fancy math.Īlso checkout the Android version (available on the Play Store) Participants should have a basic familiarity with NumPy, such as the content of the "Introduction to Numerical Computing With NumPy" tutorial."Generalization of Conway's "Game of Life" to a continuous domain - SmoothLife" Since this is a big dataset, we'll also look at ways to scale it up with Dask.ģ:40‒4:00 (20 min): Solutions to Project 3. Discussion of performance and trade-offs.Ģ:45‒3:05 (20 min): Non-rectilinear (ragged) arrays and arrays of arbitrary data structures: Apache Arrow and Awkward Array.ģ:05‒3:25 (20 min): Project 3: a big, ragged dataset: computing lengths of taxi trips from polylines with varying numbers of edges. How to update arrays in which some elements have converged and others haven't.ġ:35‒1:55 (20 min): Project 2: evaluating a decision tree, by walking over each node individually (as in a computer science class) and by million-ball Plinko! (how Scikit-Learn actually does it).Ģ:10‒2:30 (20 min): Solutions to Project 2.Ģ:30‒2:45 (15 min): Demo: Mandelbrot (fractal) picture, computed 11 different ways: Python, NumPy, C++ (pybind11), Cython, Numba imperative, Numba vectorized, CuPy, CuPy with custom CUDA, Numba-CUDA, JAX-CPU, and JAX-GPU. Calculating number of neighbors and updating the board "all at once."Ġ:55‒1:15 (20 min): Guided discussion of solutions to Project 1.ġ:15‒1:35 (20 min): Array-oriented programming and the "iteration until converged" problem. Powerful concept: element indexing is function application and advanced slicing is function composition.Ġ:20‒0:40 (20 min): Project 1: Conway's Game of Life. Overview of basic and advanced slicing, broadcasting, and dimensional reduction. We'll alternate between short lectures and small group projects (3‒4 people each), in which tutors will be available for help, followed by a guided tour through solutions, alternatives, and trade-offs.Ġ:00‒0:20 (20 min): Array-oriented programming as a paradigm: APL, SPEAKEASY, IDL, MATLAB, S, R, NumPy. Matlab will be used for plotting, but all plotting commands will be given (not prerequisites). This tutorial focuses on the thought process: all of the problems are to be solved in an imperative way (for loops) and an array-oriented way. From APL in 1966 to NumPy today, most users of array-oriented programming are scientists, analyzing or simulating data. We'll focus on techniques that are equally useful in NumPy, Pandas, xarray, CuPy, Awkward Array, and other libraries, and we'll work in groups on three class projects: Conway's Game of Life, evaluating decision trees, and computations on ragged arrays.Īrray-oriented programming is a paradigm in its own right, challenging us to think about problems in a different way. This tutorial is an introduction to array-oriented programming. This is because most scientific problems can be split into "metadata bookkeeping" and "number crunching," where the latter is performed by array-oriented (vectorized) calls into precompiled routines. Despite its reputation for being slow, Python is the leading language of scientific computing, which generally needs large-scale (fast) computations.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |