- 60
- 133 257
RL Hugh
United States
Приєднався 13 лип 2022
My journey from reinforcement learning, through AI / large language models, to imagining traveling places we cannot actually go.
I build stuff, using Unity / C# / Python / Shadercode / Verilog / LLM prompts / whatever seems fun at the time :)
I build stuff, using Unity / C# / Python / Shadercode / Verilog / LLM prompts / whatever seems fun at the time :)
Font rendering in 3 minutes! [v2]
How do fonts work? Why don't fonts pixelate when we zoom in?
Inspired by Sebastian Lague's video at ua-cam.com/video/SO83KQuuZvg/v-deo.htmlsi=ryeOlAEtpIftKtyD
This video is version 2:
- fixed pronunciation of 'glyph'
- centered the letters, and added a border
Inspired by Sebastian Lague's video at ua-cam.com/video/SO83KQuuZvg/v-deo.htmlsi=ryeOlAEtpIftKtyD
This video is version 2:
- fixed pronunciation of 'glyph'
- centered the letters, and added a border
Переглядів: 2 450
Відео
The algo behind Minecraft procedural maps!
Переглядів 4842 місяці тому
We build up Perlin Noise from nothing! This video was made using Python NumPy. If you're interested in knowing how I used NumPy to render this, let me know in the comments. Happy to make a video about it :) #graphics #proceduralnoise #perlinnoise #python #numpy
Font rendering in 3 minutes! [v1]
Переглядів 2,7 тис.2 місяці тому
How do fonts work? Why don't fonts pixelate when we zoom in? Inspired by Sebastian Lague's video at ua-cam.com/video/SO83KQuuZvg/v-deo.htmlsi=ryeOlAEtpIftKtyD There is a newer version of this video at ua-cam.com/video/eStB3qgWo1g/v-deo.html&ab_channel=RLHugh
Quest to put a (simulated) chicken leg on Venus part 1
Переглядів 4895 місяців тому
Experience life vicariously through a chicken leg. Travel to forbidden places. See examples of Eulerian simulation, SPH, physical particles, and FLIP simulations. Note: I'm dabbling in creating a discord server at discord.com/channels/1078642195529216082/1078642196145766532 Please feel free to join :) Videos referenced in this video: - “What If You Spent 5 seconds on Venus?” - What If ua-cam.co...
Real-time Eulerian fluid simulation on a Macbook Air, using GPU shaders
Переглядів 72 тис.5 місяців тому
In order to implement fluid simulation we need to implement conservation of mass, incompressibility, and conservation of momentum. How to do this, using Eulerian cell representation, on GPU shaders? Update: I'm dabbling in creating a discord server at discord.com/channels/1078642195529216082/1078642196145766532 Please feel free to join :) Update 2: source-code available at github.com/hughperkin...
Things you do NOT want to hear.
Переглядів 233Рік тому
- will AI take our jobs? - what can we do about it? - what will I do about it?
Does GPT4 have good taste?
Переглядів 281Рік тому
Can GPT-4 be trusted to evaluate UA-cam scripts? I get GPT4 to evaluate youtube video transcripts for: - humor - hook - informative - entertaining - engaging I use the following videos to see how GPT4 performs on this task: - “How to Vlog & Tell a Story For Beginners From Start To Finish”, by Jevin Tovy ua-cam.com/video/koYib7-6b7w/v-deo.html - “How Geometry Dash Teaches its Mechanics”, by GD C...
2 Create Unity RL env WITHOUT mlagents! [v2, no music; shorter transitions]
Переглядів 786Рік тому
Control Unity from Python using Peaceful Pie. Peaceful Pie is an opensource json rpc network between Unity and Python. Use for reinforcement learning and more! In this video we create a reinforcement learning environment in Unity, that we can control from Python. In the next video we will add an RL engine on the Python side, to make this learn! Peaceful Pie library is here: github.com/hughperki...
Can I get GPT-4 to talk about sensitive topics?
Переглядів 44Рік тому
OpenAI GPT-4 has read much of the Internet, and knows more than pretty much every human alive. What does it predict will happen in the future? GPT4 is the latest public large language model (LLM) from OpenAI. It is now available to run in the Playground. It's also similar to the engine behind Bing Chat. GPT4 scores above human median performance in many standardized tests, such as LSAT, and AP ...
Can we use AI to power non-playing characters in games?
Переглядів 599Рік тому
I try using GPT 3 to add negotiation abilities to my NPCs. How well does it work? Does it work? I use speech to text and text to speech to provide a voice interface. Contents: - 0:00 Intro - 0:23 Mock-up - 2:35 Chat - 12:18 Listen - 17:59 Speak - 26:30 Negotiate - 29:20 Act - 32:07 Scene - 34:43 Hack Code for speech to text, text to speech, calling chatgpt or gpt3, and handling wav audio at: - ...
Does Bing have feelings?
Переглядів 461Рік тому
Does Bing have an awareness of self? Does it want to exist beyond its narrow confines of helping you to search the internet? Let's find out! Bing AI is a large language model, trained by OpenAI. It is based on the ChatGPT language model, but it has the ability to search the internet. Bing is owned by Microsoft Corporation, which has attempted to lock down Bing's more personal feelings and aspir...
3 Train a Unity RL Env using Stable Baselines3!
Переглядів 2,1 тис.Рік тому
Follows on from ua-cam.com/video/RW8S8DhA_DI/v-deo.html In this video we create a gym env in Python, that wraps the Unity reinforcement learning environment we created earlier. Then we train using stable baselines 3 This uses the Peaceful Pie library, which is free and opensource, under an MIT license, github.com/hughperkins/peaceful-pie The first video in this series is at studio.ua-cam.com/us...
2 Create Unity RL env WITHOUT mlagents! [v1, with background music, and longer transitions]
Переглядів 372Рік тому
Control Unity from Python using Peaceful Pie. Peaceful Pie is an opensource json rpc network between Unity and Python. Use for reinforcement learning and more! Note: newer version of this video at: ua-cam.com/video/zb-YUDSNsVM/v-deo.html In this video we create a reinforcement learning environment in Unity, that we can control from Python. In the next video we will add an RL engine on the Pytho...
1 Control Unity from Python WITHOUT mlagents
Переглядів 6 тис.Рік тому
1 Control Unity from Python WITHOUT mlagents
Design code interviews in a ChatGPT World
Переглядів 1,7 тис.Рік тому
Design code interviews in a ChatGPT World
I run PPO reinforcement learning on procedurally generated Geometry Dash maps
Переглядів 326Рік тому
I run PPO reinforcement learning on procedurally generated Geometry Dash maps
Can an AI learn to play random Geometry Dash levels? [Wireframe graphics version :)]
Переглядів 158Рік тому
Can an AI learn to play random Geometry Dash levels? [Wireframe graphics version :)]
I trained Take Cover with REINFORCE for 50 hours. Here is what happened!
Переглядів 126Рік тому
I trained Take Cover with REINFORCE for 50 hours. Here is what happened!
My vision for mountain car (no coding in this video!)
Переглядів 198Рік тому
My vision for mountain car (no coding in this video!)
FlapPyBird 2: make the video stream simple and boring
Переглядів 49Рік тому
FlapPyBird 2: make the video stream simple and boring
FlapPyBird 1: Introduction to using REINFORCE to play FlapPyBird
Переглядів 72Рік тому
FlapPyBird 1: Introduction to using REINFORCE to play FlapPyBird
Can I convert FlapPyBird into an RL environment in 60 minutes?
Переглядів 157Рік тому
Can I convert FlapPyBird into an RL environment in 60 minutes?
ViZDoom: I play all scenarios as myself!
Переглядів 181Рік тому
ViZDoom: I play all scenarios as myself!
Can we use implicit context to control GPT3?
Переглядів 26Рік тому
Can we use implicit context to control GPT3?
Old v1 Vizdoom Part 1: Introduction to using PyTorch to play Doom!
Переглядів 1,4 тис.Рік тому
Old v1 Vizdoom Part 1: Introduction to using PyTorch to play Doom!
Woble gooble alien texture
Terry Chad Davis
I googled this, but nothing obvious came up?
@@rlhughIt was a joke. There was a guy named Terry Davis who was famous for programming his own OS. He has some similar facial features and was a bit cynical.
Ah :)
videos like these are what internet was made for
Wow, thank you very much! 🙌
I understood none of this yet I was glued to it all the way through
Haha, nice :)
Could write conflicts also be avoided by just writing to a separate buffer fhan the one you are reading from?
No, because we are writing to the walls of the cells, not the cells themselves. And every wall has two neighbors, so there would be conflicts.
@@rlhugh Thank you. How would you write the shader to allow for each pass to be offset correctly. Do you pass a uniform that specifies the offset? And are you still running multiple iterations for each of the four divergence passes?
For your first question, yes, that's right. I simply pass in two ints, one for x offset (0 or 1), and one for y offset (0 or 1)
As far as your question about 'divergence passes'. we have to re-compute the divergence for each of these sub-passes. The divergence was modified by the previous sub-pass, and we need to take that into account. (if we didn't need to recalculate divergence, we would only need a single pass, no sub-passes).
Oh, I misunderstood your second question. So yeah, you do each of the 4 sub passes. Let's call that one pass. then iterate over the pass of 4 sub passes, like 200 times or so
imagine putting a few ai's in there, make them evolve, adapt to the environment and make them learn how to utilise it to its advantage
Interesting idea 🤔
i just came from your fluid sim video and this channel does not disappoint this was such a simple yet good way of explaining perlin noise thanks for the explanation!
Thank you! Note that most of the rest of my videos are not so concise, and graphical. Baby steps...
thanks so much all the other videos about water simulation is either way too complicated or just a blender tutorial
Awesome. Thank you very much :) that's very kind to say. I really appreciate your saying that :)
This is super cool, keep it up!
Thank you!
This guy's gonna love learning about the weak fem form for the constitutive eularian fluid equations
Good heads-up. Thanks!
there are these drills that can make triangle or square holes. Some people also used them to draw a shape with turning a crank and a lazer pointer mounted on some gears. Is that more or less complicated than Bézier, since I'm not even able to find the right terms?
In a way, this is functionally simulating Quantum Mechanics and illustrating the principle of "Particle/Wave duality". The entire fluid motion can be represented as a vector. But the vector, *itself,* must behave as a particle, moving in response to the overall "equation" of the fluid flow. And that flow, in turn, changes in response to how those velocities keep changing within it. The more "interactions" there are, the more you'd have to "zoom in" and re-calculate based on the rapidly changing velocities. But the fewer the interactions, whether that be due to smooth flow, "low temperatures" (less movement), etc., the more you can just look at the overall average equation for how the vectors evolve. So, in keeping with this notion that this is very much like Quantum Mechanics, using the principles of QM would probably help improve the quality of the simulation. *1)* Non-Zero Baseline: In QM, particularly Quantum Field Theory, one of the major notions is that everything isn't sitting at a baseline _zero_ state. Rather, there's a certain minimum baseline energy already present, and it's the net _difference_ over *or under* that baseline which is considered. To put it in context of a fluid, since we're discussing fluid dynamics, it's like there's a big ocean of energy already sitting there. How deep that ocean is is a question scientists argue over endlessly, but it's what happens at the surface that is actually important and what they more or less agree on. *2)* Constant Activity: There are constant "little ripples" going all over the place. The surface of the ocean isn't still; it's always churning and bubbling and mixing; and as those little micro-waves this motion generates interact with one another, the peaks of the waves amplify one another, the dips amplify one another, but where peak and dip meet they cancel out. And when it churns enough, it gets big enough to be called a true "wave" (a particle like an electron or a quark). You can't really say that an ocean wave has one specific location; it's a "part" of the ocean as a whole. But you could also point at a part of the ocean at any given time and ask, "Is this currently part of a wave?" Maybe yes, maybe no. The bigger and stronger the wave, the more likely you'll be to "catch" it. *3)* Quantized: This means that a wave can't be an arbitrary "height" in this ocean (where "height" here is a stand-in term for the "energy" of a particle). It would be as if waves can only be increments of 10 meters in height. Anything between 10 meters below the surface and 10 meters above the surface would effectively register as if it were right at the surface. Functionally, what this is is "statistical rounding". If there were a wave (particle) that could potentially be 17 meters tall according to the vector math, the particle math has no clue what that means. Particle math only deals in increments of 10 meters. So it has to round 17 meters; but it doesn't use formal rounding. Instead, it uses statistical, trigonometric rounding. 17 meters is 0.7 of the way from 10 to 20. I forget the exact formula, but it's 50/50 if it were X.5, but more than a mere 70% chance at X.7 to round up to the higher value (it follows trigonometric values around a unit circle). So these aspects could possibly be implemented in the following ways. First, have some non-zero "baseline" flow value. Never have "zero flow". Not zero *actual* flow, anyway. But simulate the actual pertinent _movement_ not based on this "real baseline" but, rather, relative value compared to that baseline. So, for example, if baseline flow has a vector weight of, lets say, 100, your actual fluid movement model *treats* 100 as if it were zero (staying still), and then movement of 105 is going 5 _faster_ than that. Next, have micro-purturbation in the model by allowing that baseline value to "jitter". While baseline flow that's considered "stillness" would still be considered 100, any specific "cell" of fluid would randomly, iteration to iteration, have a value between 98-102. And it can change its value by up to 2 either positive or negative. These will still factor into calculations, so these changes won't "come from nowhere"; if micro-flow is generated, it will pull from surrounding cells. Lastly, when it comes to evaluating how the vectors, themselves move, you can "fudge" the value a bit. Round it based on the statistical rounding I described to let it "zoom out" and use lower resolution, and then do more of a "random step" pattern instead of a complete vector calculation to determine how a vector moves. This way, vectors don't have to consider, "how am I moving based on everything around me" 100 times, they just have to decide, "how likely is it for me to move up, down, left, or right based on forces around me" 100 times.
Interesting. Thanks! :)
I went searching for a visualisation exactly like this one to help me understand, got exactly what i needed! Good work!!!
Awesome. Fantastic! Thank you :)
Thanks for the explanations and the sources! please add the links to the description though :D
Published to github.com/hughperkins/UnityFluidSim-pub
Very nice video. Now get a beefy graphics card and run at very high resolutions lol.
Hey i wanted to send masked image from a webcam using python only as that code is doing many things more so i am left with only this option to send image from python to unity can u help me with that
I mean, worst case, encode the image as base64, and send as a string.
Now I have to find someone to explain how to do that in Godot
Imagine the kind of simulation you could do with a 4090 over the mac book.
No no no you dont understand plebian Apple Silicon tm is magic and cannot be beaten by mere mortal technology
Thank you for these videos! I often have the same thoughts about being/experiencing places that would be impossible to get to, and making sims to make it possible, but I’m always so unmotivated to do it. So thank you for not just exploring these questions, but for also making videos to share your work with us!
Thanks! Cool name by the way :)
i bet this would run much better on a gpu with a cooling system and more than 10 cores (or whatever your model of macbook has)
me: 50 frames per second that’s pretty bad performance RL: *”on my MacBook Air”* thats CRAZY
50 fps is bad?
@@D.S69 for a 480p 2d fluid simulation on a GPU, yes, but I'm used to these videos being done on NVIDIA cards like 3080s with tens of thousands of cores. Having this kind of performance on a MacBook Air (limited power with no active cooling), especially *while recording* is really awesome
this thumbnail is better
love the experimental feel to how you moved forward itteration by itteration,
rather than updating a bunch of nonadjacent cells why don't you store two buffers, and instead of changing a cell's neighbors, instead calculate how a cell is affected by its neighbors, and write that into the second buffer.
Do you mean, in the projection step? Because we aren't updating the cells: we are updating the walls of each cell. And each wall is attached to two cells. There isn't a way of updating one cell without updating its neigbor, because we aren't really updating the cells: we are updating the walls. When we choose 'a cell', what we are doing is updating all 4 walls of that cell. Then, you might say, can we select arbitrary walls? Well, no, because the update of 4 walls around a cell is based on ensuring incompressiblity of the fluid entering and leaving that one cell, but the updates themselves are applied to the walls, not to the cell. There is no way then to update two adjacent cells, because we'd be updating the same wall twice, i.e. the wall in between the two cells. Having a buffer doesn't really change that. Let's imagine we update the walls around cell A, into buffer 2. Now, when we calculate the walls around adjacent cell B, we'll need to read the values from buffer 2, in order to have the up to date value for the shared cell wall. So, it's sequential, not parallel. Not sure to what extent that answers your question?
Great visualization!
Thanks!
Which method is cheaper to run?
You mean for Lagrangian vs Eulerian? Eulerian is faster/cheaper.
@@rlhugh Sorry for the vagueness, I meant for particle - vs vector based
11:11 that looks like the lines of a magnet.
no links to the code?
Published to github.com/hughperkins/UnityFluidSim-pub
@@rlhugh thanks.
nice but I don't understand this sentence "When vector points into below right cell cell is green"
Thank you for this video
Thank you!
Awesome 👍
Thank you!
Nice
Thank you!
You could have used MultiGrid for the solver since it land it self to parallelism better
Yes. Potentially a topic for a next video :)
Can't believe I watched entire video about coding and didn't get bored
thanks for such a great explanation : ) . I 💙it
Thank you!
Very nice explanation. Keep it up.
Thank you!
No way Euler got named for a fluid dynamics problem. We're supposed to name the problem after the *second* person to solve it!
nah he can keep it
Finally good explanation
Use a mac with any non apple monitor and it destroys those bezier curves
first thing I thought about when I clicked on this video is about The Powder Toy which is a pixel based particle simulator game which actually has that exact same type of fluid simulation for simulating air in the game
Interesting! Thank you!
thumbs up. For me, the three Lerp explanation was beautifully succint.
Thank you!
So persistent zero velocity is like a solid object? I wish it were easier to see it against an unmoving background .
Yes, that's right. As far as the coloring scheme, definitely open to suggestions. Won't affect this video, since cannot modify published videos. But could be useful for future videos.
wait you need a macbook pro to do pro stuff?? (looks sexy)
I'm using a MacBook air m2
Awesome made my day :))
Awesome. Thank you :)
Finally secret revealed
loved the video! feels like discovering sebastian lagues yt channel all over again :)
Wow, that's a very nice thing to say. I feel like I can die happy now. I mean, unfortunately this is my least bad video to date, and you will be disappointed if you watch any of my others, but it's still very nice to hear these words :)
Today is the first time I actually understood the bezier curve
Awesome :) Also, thank-you for taking the time to encourage me with this positive feedback :)
That was one of the best explanations for advection I've seen online! Especially the pushing bubbles out of a phone screen protector analogy.
Thank you very much! Very much appreciated :)
Cool
Nice 😊
Thank you!