I liked Raylib better than SDL (ML in C Ep.05)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
looks like we're live hello everyone and welcome to yet another azusin session hello hello welcome welcome welcome uh let's make a little bit of an announcement and officially start at the stream how about that so uh the usual a red circle live on Twitch and what are we doing today on Twitch at dot at television website today we're doing neural uh neural networks with array lib visualization right that's what we're doing today I'm going to give the link to uh to Wichita TV https oh my God can't type today and also I'm gonna ping everyone who's interested in being pink and there we go the stream has officially started the stream has officially started so what are we doing uh today essentially today we continue developing nn.h which is a simple stb style header only library for neural networks we've been developing into for quite some time I really enjoy developing it because I'm learning a lot of interesting things I'm going to give the link to this thing here in the chat and for people who's watching that on YouTube it's going to be here in the description right so uh what we were doing on the previous stream on the previous stream we were trying to implement like a very simple visualization of how the neural network learns essentially uh we would visualize the uh the neurons and the connections and color them differently depending on their strength right so uh let's actually take a look at how it looks like right so what we implemented we implemented a simple Adder as a neural network so I don't remember how big it is so it it can actually add only four bit uh two four bit numbers that's what it can do uh right and essentially while it was learning to do that uh we were taking snapshots of the state of the neural network right so if we take a look at one single snapshot so I think we can start at zero zero zero and let me actually make a black uh background so this is how the neural network initially looked like right it has eight uh sort of inputs right so two hidden layers and uh actually two outputs uh right so this is how it looks like and essentially what we can do now we can try to display all of the all of the images and just go through these snapshots of the uh of the neural network and how it learns so here we have 50 snapshots and I think it doesn't really happen like do anything until like snapshot 13 or something like four yeah so on 15th snapshot it sort of jumps and learns really quickly and basically continues learning uh kind of from from them and so the as you can see I keep suggesting the things uh right so here I'm going backwards right so this is this sort of initial State and then I go forwards and this is how it sort of adjusting its uh weights and biases until it learns how to add 4-bit integers so that's pretty cool visualization it's actually kind of cool to see how uh right it just jumps to a particular configuration and then continues to like adjusting weights and biases so that's actually pretty cool and uh this is not particularly a convenient way of looking at the visualization if you know what I mean right so what I initially wanted to do I wanted this thing to be actually like a GUI style thing so essentially I would start the application it would open a window and show me the protest in real time it will show me how this thing learns in real time right so and this is what I want you to essentially dedicate to this stream for uh two actually I'm sorry I didn't speak English uh right and to do that we'll need to use some sort of a graphical library and I was thinking what kind of Library do I want to use initially I want you to use sdl but sdl is kind of an ass so when it comes to like shapes that are more complex than a rectangle so if you want to draw anything that is more complex than rectangle you just use sdl as a glorified opengl initializer right so and what I decided to do today I decided to give array leap another try I already used trail deep uh some time ago just like checked it out on the stream but didn't really do anything useful for myself in this Library so I decided to give it another try and see how we can utilize it for visualization of the neural network learning process right if you know what I mean so I'm going to give the link to this library in here right so here you can find it and also for people who's watching on YouTube it's going to be in the description as well so let's ago I suppose let's ago I think some people subscribed so let me quickly acknowledge the subs let me quickly launch this up so the big the big big guy one thank you so much for tier one subscription it was four days ago but I mean that which shows me that so I might as well acknowledge that towards Kaya thank you so much for watching One subscription thank you thank you thank you and shy resubscribe with tier one um with a message OE and oi indeed thank you thank you so so much for for the subscription marcelonetto thank you so much for tier one subscription a great weekend to everyone thank you a great weekend to you as well so function thank you so much for 47 months of two one subscription holy the OG of this Channel with the message are aai leap and by the way so there I recently created another option to support me so you can find more details by doing the uh donate command but unfortunately for that option I don't have any notifications or any perks yet uh right so I apologize if you donated through these options and I didn't acknowledge that in the future I will set up something to be able to acknowledge this option as well uh right so let's go ahead and take a look at this Ray leap as far as I know I do not have Ray lib installed on my system so one of the things we'll probably have to do we'll probably have to uh build it from scratch luckily it's a very simple uh it's a very simple Library so it should be relatively easy to do so right so it's actually clone the source code and build it from scratch so I wonder maybe I already have the source code somewhere here no I don't okay so do libclaw and let's clone it this is not particularly what I wanted I am not really sure what the was that um uh git clone it just like yeah it called something weird uh yeah there we go so and I like to do a shallow clone right so essentially we have like a thousand yes six thousand commits in here I don't wanna like clone uh all of these six thousand commits uh right so I'm going to just do depth equal one um so isn't it header only no it is not unfortunate right it has its own build system and stuff like that build.zig is it written in Zig these days uh okay uh and that's that's the whole thing I suppose right so that's that's kind of interesting so how much Zeke is there uh not that much actually right so it's primarily C but they're using zika as a build system okay but fire and sure why not but uh does it have any other options yeah it does have c-make so we'll be able to probably build this C make okay so let's actually go in here and uh okay so that's cool make deer uh build uh C mate and let's do synthetic I probably want to install it locally and to install this thing locally I probably need to set up the installation prefix but I don't remember how to do that uh so make set prefix so let me quickly actually just so we make install prefix okay can I just do something like this make install uh install prefix right essentially it's a prefix for the path where all of the installation is going to happen right so and we're going to install it at home opt array lib right so these days I kind of like to install the things that I built from scratch like for a local user uh right without using root or anything like that so maybe it results with a lot of waste if you're using multiple users I think but I kind of like it right so the fact that you don't have to use any uh like root and don't have to worry about breaking something it's actually kind of nice uh right so I think it's kind of cool so as far as I know simik actually caches all of that in a cache right so we can try to find the prefix and here is the prefix it actually set it up correctly right so let's go ahead and just build all of that with three threads even though I can do five I usually do five because I have four for high threads on my machine so I I'm gonna use three because I'm streaming right now so I don't want to you know spend all of the resources on building this entire thing so how are you guys are doing how are you guys are doing while while we are building this Choice shots um I have four chords so I do five threads LOL yeah so that's usually a recommendation right so it's a it's a usual recommendation that uh to spawn n plus one threads right you see if you have like n course or n hyper threads like the most optimal thing is to do n plus one but I don't know the justification of that you know best practice right this is something that I heard and this is something that I do as a reflex right so if anybody more knowledgeable than me can explain why it is like that so feel free to to tell me um I do to end because I want my course to work for their money um you should have two people Romper threads as well oh yeah that's true yeah since I have eight eight Ram eight gigabytes of RAM so that makes sense um all right so it looks like the center I think built successfully which is kind of cool so I'll go ahead and install this in Diving uh yep so and it installed it in the local thing Imaging game right so this is where it's installed it uh let me go to Ray lip and it's actually very small even though it's not header only it consists of three headers a single static library and a bunch of simix scripts and also package config scripts which which could be actually very useful in the future so this is the entire Library actually um so yeah that's kind of cool I really like the Simplicity of this Library even though it's not as simple as stb for instance it's still very very simple so one of the things I want to do before I go and try to visualize the center and stuff um I want to try some sort of like a hello world for review do I already have some stuff for radio yeah I will already tried Ray lib some time ago right so in 2021 so two years ago right so already kind of kind of familiar with this library but I want to try to do this thing again right so I'm going to remove it Ray lib probe right because I forgot everything what I did with this Library so um okay so let's include std.h I'm not sure how useful that is for specifically radic and maybe let's take a look at some of the examples that are available within the array Loop itself right so if you go to software and uh array lib so there's some examples in here so what kind of examples we have so there's a lot of stuff in here so I want to take a look at the core is there something like a basic um right basic window yeah there we go let's actually start with a basic window uh okay so you just have to include Ray lib so here is the entry point so you initialize the window right to create this entire thing you set you cap your FPS to 60 FPS right so because we're running on a console of course that's what you have to do uh I and my keyboard has that yet walk in again mate get them all right so we kept it cap it to 60 FPS and then we organize the event Loop right while window is not closed yet right so we begin drawing We Begin drawing we clear the background draw some text and the drawing and then uh once the window is closed we close the window well I mean it's not really um when it's closed when it should close I suppose like this I think contains like an event Loop right it basically drains all the events from the from the event queue right and one of the events that you can receive is probably like the user request to close the uh the window right and only then you handle a request and then you just return so this is actually straightforward like everything that you want to do is expressed with a single function call right so this is kind of cool one of the criticisms I heard for Ray lib is um its functions don't have any prefixes and since it's a like a c only Library uh there's no name spaces in here like in C plus plus or anything like that so their names kind of pollute uh your current namespace right so I think this is like the main criticism of this library that I heard it just like basically says that's it you can't have function in your entire application called init window and it's a very generic like name that you may want to have or may not I don't really know like maybe or something like begin drawing like you can't have that though maybe it's kind of remedied by the fact that they're using Pascal case and Pascal case is very unusual for a c program um that's actually very interesting I was thinking why do they use a pascal case and this is something that they actually emphasize in their sort of like a marketing speech if you know what I mean so if you take a look at them at the header of this thing array lead include uh Rayleigh Pascal kick yeah there we go so it's plain C code but it uses Pascal case all right so which is kind of unusual like a C library using Pascal case and maybe that's literally the reason because it wants to have like a very simple very readable names uh but having a prefix for namespace purposes actually ruins that but you want to have some sort of a name spacing so that's a very interesting idea I never thought about that yeah so using keys as a way of name space in your library this is actually kind of cool I never thought about it uh yeah that makes sense right because if you are a c programmer and you want to have a function right you want to have a function uh called begin drawing you're probably not gonna case it like that you're probably gonna case it like begin drawing so that's how you sort of like namespace that hmm it's very interesting and something to think about so that is something to uh think about so we've got more subs we'll get more subs thank you so much uh mfamily BG 4 tier one subscription thank you thank you thank you uh Excellence thank you so much for twitch Prime and the red B rigor thank you so much for a tier one subscription thank you thank you thank you really appreciate all the subs even though I don't get any money from that but there is an option from which I can get some money just check out the genetic man so yeah uh anyways so let's actually go ahead and try to use this entire Library let's actually do include array leap.h because that's what this example recommends you to do there is a lot of comments in here which makes it readable which makes it difficult to read so can I do uh toggle truncate lines yeah there we go so basically it's not going to wrap around anymore okay so let's have a screen width and Screen height so I probably want to have something yeah I think yeah I think I want to have this kind of resolution I think it makes more sense uh all right so here this is a ray lib uh what I want to put in here your Mom all right it's usual classic so now let's cap the fps to 16 right so we capping this stuff to 269 to 60 I want you to say to 60. uh all right so while a window should not close uh what we're doing is we begin in the drawing right so begin the drawing begin drawing right so maybe I'm going to put the scope in here just to have some sort of indentation right so and then we end the drawing process uh clear background and we have the supply Ray White right whatever that means I don't really know what that means maybe it's a custom color it's a specifically like um you know the white that is used throughout the this website because it's not really like pure white right it's a little bit grayish so to speak maybe that's that's the color maybe that's what it is so and let's actually draw the text uh right so let's see how we can draw the text so we have to provide some numbers so I suppose this is width and height oh no maybe X and Y and this is the size and this is the color like a light gray okay so let's actually go ahead and do that it's like your mom uh so here I actually want to do something like a screen width divided by two end screen uh height divided by two so the size is going to be let's say uh right so and the last thing we have to do is just close the window to be fair this thing already feels more simple than even simp sorry John but yeah this is actually simple simple than simple all right so yeah so I just nuked myself out of the Jabet please don't show that to John uh all right so let's actually create a build uh sh right so and let's do business yeah what the is going on so if I try to do something like clang oh main main.c this entire thing is definitely not going to work right because you need to supply some uh some Flags right so that's very important so it's actually observe that so as you can see it doesn't even know where Ray Loop is located so usually what I do I just use package config to get that information right so I just do ray lib and I say give me the C Flags right give me the C Flags but one of the problem is here in here is that it cannot find rayleeb.pc which has all the descriptions of the flags and leaves and stuff like that but this entire thing is located within uh sort of the installation that we have in here so if we do grab actually we need to find the file with that specific name and here it is it is located within like leap package config blah blah blah blah blah blah right and here we have all of the flags so uh if I remember correctly package config right had some sort of like um variable yeah package config path right so one of the things we can do in here in the builds sh uh we can just say Okay so package config is essentially at home opt Ray lib right opt Ray lib and it's located somewhere in Lieb package config yeah there we go so let's actually put this stuff in here so it should now kind of work right so and if we let's actually put it in here package config uh C Flags um package can fix the flags radiant right and if I try to build this entire thing there we go it actually printed the flags right so it provided the include flag so we should be able to find everything so what we can do now uh we can take this entire thing and shove it into the command line of the compilation so now it will be able to find the center step right so but as you can see it can the Linker now complains that it cannot find this uh these sort of functions to fix that we can also query package configs and say give me the libs right so give me the flags necessary to link uh with this specific Library uh right and here are the flags so it gives you the path to the libraries right so in here and the flag that tells you to to link all of that uh right and we want to put that stuff somewhere in here so it's not particularly convenient to put this entire stuff inside of the build script one of the things I usually like to do right one of the things I usually like to do is to have sort of like an environment uh an environment script right as you can see I have that environment script for uh for free type and what this environment script does essentially it sets all the necessary environment variables for this thing to work uh right so and I want to create a similar thing for Ray lib so let's actually create a relieve.n and this is where I'm going to move this entire thing so and how do I usually use this kind of environment environment scripts right so I do source which basically write executes everything in inside of that script in the current shell session so that means if I do end end and build it will automatically work as you can see it automatically worked so the Linker still complains about some other functions but it doesn't really matter uh right so and why do I want to do it like that so the problem is that somebody may have a ray lib installed in a different place and somebody may have even really installed system-wide right so they don't really need any of these kind of tricks or anything like that so we want to have like a build script that works pretty much for majority of the cases but at the same time I have my own custom environment and for my own custom environment I have this separate script uh right so this is basically how I do that so this is the brain damage that I got from using NYX OS for five years yes I've been using Nix OS for five years and this is a thing in Nix OS which is basically you have uh packages that are installed in separate uh you know folders and then you have sort of like a system that builds up the environment out of these packages setting up the environment variables and also syntax and stuff like that and that damaged my brain irreversibly and that's why I'm doing these things like that since then even though I don't use Nix OS anymore so yeah doesn't make sense so yeah anyway so we've got even more subs uh we've got even more subs um so I don't remember I think I already acknowledged regular agor uh thank you Alexander thank you thank you thank you young thank you so much for 47 months of tier 2 subscription another OG of this channel uh with the message I hope Mr Jeffrey bases appreciates my money I don't know if he does but I do appreciate your intent thank you so much thank you thank you thank you maybe one day I'll uh get those money we'll see we'll see uh thank you so much Mike rossoft for a tier one subscription with the message it's sodium cool that is sodium a cool indeed that is okay so it still complains about some other choice so let's see what is it complaining about so it cannot find things like sqrtf and since app and we know what that is that is basically the uh mathematical library right so and now it complains about something from glfw so it's actually also link it with jlw right and it still complains about DL close so if I remember correctly like DL stuff is located in DL so you have to do LDL right so and now it complains about P threads okay that is interesting so it also wants to have like a p threads uh let's link it with P threads why not and now we compile would you look at that we managed to compile it and if I run this entire thing it says your mom that's it we successfully build really deep from scratch and we successfully used so that's actually kind of cool I really like that uh so yes yes it's not really centered properly because it like renders it like that in here but so what I really care uh in our specific case what I really care about in our specific case is how can you draw the circles right so let's actually take a look at the header right so as far as I know you only have like a three headers so the main thing is in Ray leap do you have circles on my phone uh okay so there is a draw Circle uh let's actually put it in here so because that's what the neural network visualization consists of right it consists of circles so Center where we're going to put the center on uh let's actually put it at a screen width divided by two and screen uh height divided by two so the radius is going to be 100 and the color I want to have the red color but I'm not sure do we have the colors somewhere oh there we go so there's literally a red in here um right so yeah that's kind of obnoxious right so imagine the library actually taken away from you the word the red um so that's okay I mean you can always undef it if you don't like it but it's just like him anyway so let's actually try to draw the circle I'm gonna command this thing out and I'm gonna do build uh Main and it's oh yeah so also one of the things I have to do I have the source uh opt uh array the environment and there we go so that works that's a flag of Japan how about that um so that's pretty cool no anti-aliasing what the absolutely literally unusable literally an angel connection but it's fine it's actually kind of cool I think so what is it used for um for drawing actually right I think it's used as opengl right so let me actually see so if I take a look at op team actually uh software Ray lib let me find the implementation of the draw Circle holy okay um so draw Circle I actually only care about the draw circle like just draw circles so I didn't think it's that much so okay so there is this thing and it just calls the function draw Circle V right so try to find a draw Circle sector uh what do we have in here and okay so we have segments and stuff like that um okay we have rlb okay this is actually interesting this is not the JL it's RL uh right it's okay this feels like immediate mode opengl but it's this is not opengl this is a custom thing uh right so that's actually kind of cool right so let's actually find RL I think I know so there is a flat there is a header in here called rlgl uh so maybe that's what it is and a multi opens your obstruction layer with immediate mode style okay so that's actually kind of cool so I will begin initialize okay wait does it use opengl literally uses opengl 1.1 uh it's actually full okay it's actually a fallback so maybe there is a different version uh okay so there is a different version in here and in a different version it uses like a different thing it uses a custom renderer with batches and stuff like that okay so that makes sense it's kind of cool so if you run this thing on opengl 1.1 uh it uses the immediate mode opengl one point like 1.1 but if you have a high open 0 it just basically adapts that stuff uh right so that's actually kind of cool um um okay so that's kind of cool uh all right so um what I want you to do actually um so let's actually go ahead and like initialize this entire thing um in the nn.h right so we have visualization in the adder right so we have the visualization in edit um so we have the renderer in here right so and what I want to do in here I want to actually Port this piece of code to uh rayleap right uh so how can we even do all of that so uh all right so I'm gonna go and just open this entire thing so what's going to be the resolution of this screen so we already kind of have the resolution here so we have image width and image height which is something that we can use in here uh right so I'm gonna start initializing these things in here so here we're gonna do error uh right set Target FPS uh right so this is going to be 16. um but the question is at which point we're going to be initializing all that right because here is the thing here is the thing so we have like a bunch of iterations in here right we have a bunch of iterations but then we need to organize some sort of an event Loop right we need to organize this so the event Loop and when do we do one single iteration like a bank propagation right when do we do that um so maybe we should actually run the training process in a separate thread that sounds like a good idea I believe it or not I think like running this entire stuff in a separate thread uh could be an interesting idea so and then in like the event Loop in a current thread basically periodically like looks at the state of the neural network and just like draws that state specifically um right but maybe I'm gonna do that um a little bit later right so let's actually try to do that a little bit later so what I want to do for now is amazing just like transform this entire thing into an event Loop right so let's just transform it into an event Loop uh and see how it is going to go right so let me go here so we're gonna have a while our window should close right so we're not gonna do any uh login in here so I want to actually remove all of the login so here we have like saving to like a separate file I'm not sure if that's very useful so we probably want to we probably want to do the rendering in here instead right so that's probably what we want to do we want to do the rendering here uh and uh We're not gonna we're not going to be using finite differences anymore because they're very slow so we're only gonna uh like a lean towards back propagation right so that's what we're going to be doing uh okay so maybe what I'm gonna be doing is essentially just have it like so right and maybe we're gonna have like a i in here which is initially zero and uh if I is less than five thousand we're gonna do back propagation and uh learn and increment I buy one right essentially if it goes over 5000 iterations right so it will stop learning it will start stop doing things right and in here what we probably want to do uh we want to do the actual rendering right so let's do a begin draw uh let's also clear the background and and the drawing right but on top of that on top of that I want to do something like maybe um and then render array lead right and what I want to pass in here I want to pass the neural network right so and as you can see it's already kind of like a namespaces the uh the function calls right because of everything in my application uses the snake case but the ray leap uses the Pascal case and that's a very interesting way of like yeah namespacing this Center I think uh right so that's actually kind of cool okay so what I want to do is basically copy paste recently I think uh this entire rendering that we used with Olive C and I'm gonna just remove it right so this is going to Simply array lip uh oh look at that by the way we already have a feel maybe that means I need to remove clear background right and just like use the background color in here uh okay so we want to actually port um the color is here as well right I want to like render it similarly to how we render these images in here right so yeah so I want like to use even the same colors in here I think that makes sense uh so to do that we'll probably have to do the the usual thing all right so we need to find the colors we need to find the colors okay so how they defined collateral what the is coming I'm 13. it probably stands for silly roof what is this so funny um so yeah okay so C plus plot does not support compound literals and okay I see what they're trying to do here it's just like a difference between C and C plus plus so Jesus what a name okay um ah okay so um and uh so this is essentially yeah uh it's basically designated initializer or something like that and for the caller right so where the color is defined so do we have like a maybe a color yeah there we go so you have rgba okay that makes sense so uh what I usually like to do uh right so here we're gonna have a color and again okay so it like literally took away the name color um another really big fan of this kind of stuff but yeah yeah uh so this is going to be 18 18 and just add F so that's the color we're gonna have in here uh so this is a low color which is basically purple right so if I'm not mistaken [Music] um so in here we actually put the alpha to zero because of how we blend things but maybe um maybe Ray leap has a better way of blending things so we're not going to do that in here like that so listen FF uh this one is zero FF F there we go and so this is going to be so the high color was actually green all right so that means we have to do something like this and this is going to be Alpha and I want to even do a line uh logo and then I can say um clear background and I can just set the background color there we go so it's not poggers I think it's pretty freaking progress okay so let's actually try to compile this into everything and I'm pretty sure it's going to complain in all the places uh where we need to change things right so let's go and just do the build so we have implicit declaration okay so essentially one of the things we'll have to do we'll have to do the usual setup that we established in a different build sh so we'll need to Port these things in here uh right so let me actually do the following thing I want to have separate like variables C flags and Libs which are going to contain all the necessary flags and leaves and stuff like that so one of the things we want to put in here is this right so that's kind of important for the beeps we can put this stuff in here and here we're gonna do c flags and uh lips and there we go so then later we can add all of this package config nonsense right that we established later earlier I mean right so and here all the all of the lips stuff right we're already linked with pre-thread so that means it should be actually uh super easy to make the entire process multi-threaded meaning that we can learn in a separate thread and the UI thread is also a separate thing and it periodically just looks at the current state of the neural network and just displays it right so we already linked with the thread so why not just use it for for our purposes I think that makes sense so maybe here I want to actually put it before I enable the tracing so it doesn't really trace this entire stuff but maybe it doesn't really matter so it's better to trace everything just in case you just in case uh all right so if I try to do this kind of stuff uh W all not found yeah and this is because you have to actually rub this entire stuff in quotes because welcome to bash uh right so welcome to bash and as you can see so it cannot find the Rayleigh PC because we have to use the corresponding environment right so we have to do something like this onpt uh array deep end and if I try to do it now it seems to be working it seems to be working how about that right so it cannot find the image width because we don't pass any image here anymore right in the previous version that used Olive C we actually put image in here right which contained the width but this one doesn't contain the width but we know the width and height of the window it's literally uh Imaging width and imagery height right so that's basically what we have in here and might as well maybe you know I think I need to actually do query replace image width is image width there we go it's actually not that many so I suppose that's the only place where we have to do that so what's the other thing so here we are actually you know blend in the colors and the question is the question is how should we blend that um so the actual sort of alpha right the actual Alpha that we computed in here is this all right so that's the actual Alpha so I suppose one of the things I can do in here I can just take the high color and set it Alpha to this maybe even cooler just set it like this all right and no it doesn't really blend these two colors together that's the problem it doesn't really blend it because we're not drawing them on top of each other so we need to find something that would blend this entire stuff so Ray lib include so do you have anything for Blended the colors I actually kind of doubt that blending okay so they're blending modes but how do you use that okay blend begin blend mode and blend mode get SSC Alpha blended into DST color with scint not I don't quite understand why do you need to do tint in here right but that kind of looks like what we need is there any other Blends no this is the only thing in here um SSC Alpha Blended so this is the source into the sticker with tint so because I don't really need tint right [Music] maybe there is something like mix no there's there's only blend uh so color Alpha blend cynical Alpha aligned so I kind of want to take a look at how exactly the synthetic implemented um right so let's uh do this thing uh so include where was that it's really ah I think it's nsrc right there we go rain leap Dot yeah so essentially what I want to find I want to find the implementation of that specific function right so let's actually try to find this kind of stuff all right let's try to find uh so our textures all right so what we're doing here we're essentially we're multiplying this thing by The Tint plus one [Music] and then I suppose we're blending all that so if I set the tint to zero right if I set the tint to zero that just means that it will be added to one right it will be edit one and then multiply by this into I think using the original color right so that's what I think it will do but at the same time it also shifts this entire stuff by eight which doesn't make much sense to me at all like why do you shift it down like that so let me let me see so this is integer all right so maybe what we have to do is use the white tint right um use the white tint and essentially that will kind of overflow and we'll end up with the same color it's kind of a dream excuse me so I have this sort of idea yeah I think using white Pure White is um is the way to go so it's actually quick to do that uh how are we going to be doing all that so um I think this is where setting the um the alpha to zero could be actually useful right so this is where so the destination color um yeah I think I can set it as the low color right and this one could be a high color and a tint uh I'm gonna set the tint to White it doesn't even have the white that's that's the good question right do we have an array lib dot h uh White whites yeah okay so and uh array white is sort of like a different white my own white rail lip logo okay that makes sense um I can't get over this goddamn freaking clearly I swear to God this is done intentionally uh this is done intentionally nutrition oh um anyway I'm sorry again I'm 13 like I just like I don't know why it makes me laugh so much uh so this is the color and we Blended this entire thing and here we're trying to draw a line okay so that kind of makes sense right so that kind of makes sense so this is a connection color so probably it doesn't doesn't remember and might as well just set this entire stuff like this right so this is a high color and then we blend and that creates a new color right so that creates a new color that we can then use for the uh for the lines so how do you draw a line can I just do draw a line perfect Perfection okay so and essentially this is where I can put that color all right so and we're starting to draw um since cx1 cy1 CX2 cy2 there we go so we just ported this into a step just ordered this into desktop uh all right uh okay so how can we build this entity I think all right okay so this is a similar situation right very much similar situation and I think I'm going to Simply copy paste this entire stuff so here we're drawing circle all right so let me grab draw a circle we already know that drawing circles actually works uh right it actually works and so here we're doing a neural coral color right so that means neuron color blue color honestly I think a neuron color and where is the neuron called I can't spell it neuron color yeah it's just like literally local yeah it doesn't really matter uh so here what we have to do it's a high color this is the alpha of that thing um I'm an idiots so I'm actually modifying the wrong thing I'm notifying the wrong freaking function wait what I'm modifying the wrong thing all along okay so I'm going crazy so it's a completely different thing right right oh boy uh all right so let me bring the draw Circle back in here so I'm gonna remove this entire thing so blending the colors uh so this is the alpha we're gonna bring you that and the only thing we need in here is the color blend uh I'm gonna put this stuff in here so C X1 right so this is six one c y one and in terms of the uh radius we have a neuron a radius right so this is a neuron radius so that's what we have in here so Aha and for this Center I think we just use gray right we just use gray and let me maybe go ahead and express that so maybe it's just like literally going to be gray so that means the color scheme is not going to be precisely the same but it's going to be close right this is going to be kind of close uh all right so what else do we have in here so um and declared identifier J are you serious why it works in here then did I accidentally remove something oh yeah I see so this is because yeah we should have not copy pasted it like so so this is a j yeah just a second um we need to go here and that's the actual value that I have to put in here uh so I think that's is going to work now at least here um and this is yeah we don't have to okay so I'm I'm having a lot of brain farts but that's fine okay so this is screen width it has to be image width image height all right and is it going to work I think it's going to work yeah there we go so it works but it complains about like stb stuff uh not really sure multiple oh okay that's actually kind of cool Ray lib is using stb image right so we can't link it with stb image luckily we don't really have to right since we're migrating to relieve uh right we we don't really need that stuff anymore so we can just basically remove this thing uh right so let's go ahead and do that and that should be fine now yeah there we go so so let's actually try to run this into I think so let me double check if it's going to work properly uh and how exactly is it going to work it's gonna be rolling slow learning slower it's going to be learning at 60 FPS imagine a neural network that is learning at 60 FPS isn't that pokers I think that's pretty freaking purpose okay so I'm gonna try to run it and is it doing things it's kind of hard to tell like I don't see it doing anything uh but yeah oh this is actually kind of cool so once we close it it will try to verify it and just confirm that it it's actually doing something okay so we can't really see if it's doing anything right so maybe one of the things we have to do in here we have to print uh the cost the cost function of this entire thing so let's do NN cost and I don't quite remember nn.h and then cost right so it accepts the neural network and the input and output in here there we go so let's actually go ahead and just try to do that so we're going to be building and then running the entire thing so yeah we just need to see if it actually doing something well it's it's actually kind of doing something but now it's stuck um I wonder why right it's probably because this entire thing is dumb right that's kind of weird it should be actually way better let's remove some of the like internal things maybe this is because it's like too many internal layers that's probably the problem here um all right so it's going down I think yeah I think something is actually yeah there we go so they are appearing yo this is so cool look at that it is learning it changing its weights and biases that is so cool and we can see that in real time we literally seen that in real time this is so freaking cool um yeah okay so then we can probably close let's actually wait until it actually gets to a decent level so we since we have a UI now since we have a UI we can actually uh plot the the cost function somehow right so we can actually upload it all right so now if I close the center I think it's going to verify it and say that it's totally okay all right so now we're able to actually like render this entire thing in real time without like um you know taking the snapshots or anything like that right so we can just do it like this um right so and that means we don't really need Olive C so we only need the nn.h and Ray lib and there we go so I'm going to just try to recompile this into I think so yeah it will require probably remove a couple of things in here um yeah there we go and now it is learning man this is so freaking cool I love it you you can like literally see how it's just like uh you know gets to some point right so as far as I know like the um the purple ones are the ones that are sort of get disabled right because the closet is to zero the more it's disabled maybe we can even try to sort of like emphasize that by using literally a gray color for the low color that's one of the things we can try to do uh right so let's actually quickly try to do that uh yeah so initially everything is sort of like a green and then some of them are gonna get disabled right so they're slowly getting disabled uh right and that creates sort of like a certain pathways wasn't minus one it is able to we're using sigmoid activation right so um well not really so maybe it's not particularly representative of what's going on in here but yeah so grayish means they're negative right Grace means they are negative all right that maybe it will be better to just keep purple I think purple was a little bit better um okay gun so but here is the interesting thing so the nn.h and then dot h is supposed to be a header only library right so but to have this sort of visualization step we need a whole freaking dependency in in like in terms of Ray lib uh which doesn't really make any sense what I'm thinking is that what if the visualization tool is going to be a separate self-contained program specifically for training neural networks here's the interesting thing uh what I noticed while making the neural networks with nn.h is that the structure of the program ends up being the same it literally end up ends up being the same so you have some training data right so then you allocate a bunch of neural networks uh right with a certain architecture and then you just have a loop that trains this entire thing what if we turned this entire stuff into like a self-contained application where you can customize all of that stuff where you can say okay here is the file with the training data here is the description of the architecture of the neural network right so basically a bunch of numbers like that indicate the sizes of the of the layers go ahead and train that neural network on that data and it will just stat visualization right it will show how the architecture that you described actually like evolves and stuff like that and then it saves the trend neural network on a hard drive where you can then take that neural network load it into your custom program and integrate it and use it right so in that regard an end.h can be used for integrating these neural networks that are trained by this sort of like separate application and that separate application also uses an end.h does it make sense right so uh let's actually uh come up with the name for such applications so we're sort of like having a separate place for training neural networks let's actually maybe call it like a gym dot C and it's going to be the graphical application that just like shows the training process right uh so yeah essentially like I'm going to outline the basic architecture that I sort of like envision ah so definitely confusion so I started my paint okay so here it is so essentially we have an N um just a second and N dot h right so this is basically the header only library then uh we have a gym right gym that uses NN dot h right that uses nn.h but on top of that it also uses arraylib so that's what it does so uh what should do right you give it the data right you give it the data and the description of the architecture right so the arc at the architecture of the neural network so you give all these things to the gym in the form of files maybe right so that's why I'm sort of like uh drawing it with the rectangles to indicate that these are not libraries these are libraries library dependencies and this is sort of like the funnels you give all of that stuff to this thing right and it spits out a neural network in the form of a file right so in the form of a file so that's what you have so and it's a abstract application right that uh just you know trains your neural network and then you have your app right so you have your app that also uses nn.h and basically uses these trained neural network so that's basically the architecture that I Envision right now with Ray lib and as you can see uh in with this kind of approach an N dot h does not depend on relief right and uh your application also doesn't depend on relief right so it's still a single header only library right so it's just it's used to create this sort of like a neural network and then you can integrate this thing into your application sort of deployed an end.json yeah maybe it's going to be an endo Json right who knows but maybe this thing should be like a single file but I didn't think it's that good of an idea right I would like to separate the architecture and data and again I'm not a artificial intelligence person right I'm pretty sure there's some sort of like a conventions and standard developed over the years of doing this entire step but that's where this entire I think sort of wants to converge if that makes any sense there is a thing that it keeps talking about like uh on my streams almost like all the time is that when you develop in a certain application your source code sort of wants to converge to a certain architecture it's sort of like the requirements of the application dictate the architecture of the of the entire thing if you know what I mean right so you basically have requirements and you start iterating on these requirements and the code base sort of emerges all out of the requirements and what's interesting is that it's kind of similar to how the neural network learn you know so you have the data and you're just trying to optimize the cost function and by trying to optimize the cost function on that specific data a certain architecture just emerges out of nowhere and it's kind of similar right so it's just like you are the thing that you can view your code base as the neural network right as some sort of a model and you are training it on the requirements and by trying to fit this entire thing into requirements a certain active architecture emerges sort of by itself right which is kind of like yeah it's kind of like similar in a sense if you know what I mean does it make sense does everything I say make sense right and that's why when you're trying to architect up front it rarely works because whatever you're trying to architecture from doesn't really correspond to the reality it doesn't correspond to the requirements um it's not by itself but it's a very similar process yeah yeah so it's not by itself but it feels like it dudes doing by itself if you programmed long enough and your program click uh very complex applications you probably know that sometimes the code just wants to do its own thing like you are of course you are modifying the code you are like the the programmer you are in control of these things but sometimes it feels like you're very limited in terms of what you can do and those limitations kind of give the code the character if that makes any sense so it's just like codes wants to do its own thing right so and at some point when you zone out and you program it feels like it's just like the code just writes itself right and it feels alive um who's the boss of the gym that's a good question actually um who's the boss of the gym um right and the gym itself can also contain not only visualization of the neural network right it can also contain the the cost plotting right and stuff like that is it Whiskey no it's a green tea it's actually oolong tea right so I don't drink alcohol at all like AI the code steals your job well nobody can steal your job if you don't have a new job ah smart right so I quit my job five years ago because because I knew the AI is coming just like Billy Harrington it's coming right now right so for your job of course so let's actually what is wrong with me holy um twitch is the job but I mean it doesn't even pay right so it's just like I'm literally posting on the internet free um so I literally don't have a job uh okay guys so we're gonna have Ray lib dot h and uh let's do this kind of thing um so okay Jim is the uh is a GUI app that trains your uh NN uh on the data on the data you give it right the idea is that it will spit out a binary file that can be then load it up with nn.h and use in your application right there we go so that's basically the so the the main idea of this entire Style um Jim stands for your mom oh all right so what we're gonna accept in here I suppose uh we're gonna pass the um the files with the description of the neural network and the data in the in the command line arguments so maybe in the future we're going to have some sort of a UI that will let you just pick the file from the file system and you don't have to pass it to recommend that or line arguments but I don't want to research how to do that right now by the way I remember array Lieb had something for UI if I'm not mistaken uh Ray GUI yeah regular Rogue yeah so it's a simple and easy to use immediate mode GUI library was originally inspired by unity I'm going okay has its own immediate GUI that's very interesting so yeah who needs uh dear I'm GUI when you have this uh where is the where is this thing yeah it's not Publishers I think it's pretty freaking polished look at that yo that's so cool we should definitely try that at some point okay but but not right now a little bit later okay so I'm gonna start copy pasting the code from the editor and stuff like that so obviously I'm gonna just have this thing in here right so this is the sizes of the window right there are super super important uh-huh so here we have to initialize the window right so this is going to be gym all right so this is the gym and here we're doing this kind of stuff um yeah it probably makes sense to also um copy paste this kind of thing right so we need to come up with the format on how to describe the architecture of the neural network the thing about the architecture of neural network at least right now is that it's just a sequence of numbers it's a sequence of integers I would even say right if you know what I mean right so essentially we could say that we have an Adder right and let's call it error.nn or something like that and uh so we could say that you have like a four inputs right actually you need to have like four uh things in here because if first four beats are are the first number the second four bits is the first four beats is the first number and second for Beats is the second number right so that that means that the input is going to be eight neurons right so then another thing we want to have in here is probably uh just say maybe 16 like a like a hidden layer and then we're gonna have like a four bits as an output and plus one for the uh for the Overflow bit right we need a way to describe this kind of stuff right but describing that with the numbers as you can see is not particularly convenient because you kind of want to have like a arithmetic operations uh just for the reason I set right so just for the reason I said uh because you may want to have like something like n equal to uh four and then you can say that the architecture of this neural network is essentially uh 2N n by n and uh n plus one right so you want to be able to say something like that um when you're describing your neural network right because you want to kind of give the meaning to all of these numbers if that makes any sense so would be the best way to actually like describe the center I think so that means that the gym has to have like a simple interpreted language if that makes any sense right but do I really want to go that route do I really want to go that route ah I don't really know I don't really know right because it would be better if the gym was uh some sort of like a separate library but it depends on Ray leap which makes it kind of yeah so listen to that thing naturally wants to have uh like a scripting language right so the description of this stuff needs to be like flexible enough uh right it needs to be flexible enough but maybe for now just for now we're going to be using numbers right so and then later I'll see what we can do about that maybe we could make some sort of like a stag based language like a poor style or Force style language where I could say okay four four all right so basically maybe four two multiplied so this is the first thing and then four for that and then four one plus something like that and then here you could say let's be equal to four or something because like in interpreting the stack based language it says a little bit easier right but anyway so for now I'm gonna say it's gonna be eight uh 16 and 5. right so the first thing we probably want to do in the gym uh is read this entire stuff right so we're going to read this entire file uh AI poorth it's all coming together yeah right I don't know if I Really Wanna uh a develop another programming language but we'll see we'll see um so we need a way to maybe read entire file uh so let me go ahead and steal uh reading the entire file from some places I think I had that in Olive scene uh right so there was was there a written there was a writing type file uh okay so it doesn't we don't really have that in here so what else maybe that right so maybe we have that stuff in a dead in a common uh read entire file so I'm gonna actually steal this entire stuff it's actually read entire dear right so read and time file let's take this into I think and use a string Builder which is kind of meh for our case right because it will require taking too many things with uh with all of that so do I want to really go that route so this internet I think also wants to have file size which is fine I can give it to it sure uh so this is the capacity so we just do reallocation um yeah I don't really want to use the string Builder so let me try to compile this into I think so I'm going to build the stage for now I'm going to just put it like that and in here we're gonna just have the gym okay all right so let's go through all this entire stuff so if I remember correctly I type depth error no to integer okay uh what else do we have a file so that requires including stdio by the way maybe array leap has something to do with files does it have something for reading files um so file path file path this one is interesting okay file path load file data so this is the Callback stuff uh right is there something like load file no um yeah I didn't think it's load file data this is actually convenient okay so maybe we can just use this into anything unload file it's located in load data file hmm huh yeah so since we're using Ray lib we can just use this Center I think okay so that's actually kind of cool um let's get rid of this stuff right because it makes it even more cross-flat from and everything I mean the C is kind of already crossed platform I think whatever so this is the buffer and we're going to provide the file name so I already have adder.nn right so enter.mn and in here we're going to have something like so this is unsigned integer buffer Len and I'm gonna pass this entire thing in here zero we're gonna put the pointer in here that's actually kind of cool and we can do add for right let me take a look at how we do F right in here to the two either dot Arch maybe yeah we'll see I'm not really sure how exactly like what kind of extension to use exactly uh but maybe Arch actually makes sense yeah so let's actually change it to Arch okay that makes sense because it's architecture not really the data it's just a basic architecture and I'm pretty sure this format is going to evolve over time because this assumes fully connected neural networks right so but there are different kinds of neural networks what if our library is going to support like convolutional neural networks and convolutional neural networks are described differently furthermore uh there are sort of like a come like hybrid neural networks is that even a term that AI people use but as far as I know quite often people at least used to do I'm not sure how common it is today but they used to like have several convolutional layers as the first layers that sort of perceive the image because it's usually for images and then at the back end they have fully connected neural network that sort of has the logic on the convolutional neural networks so the conversion layers sort of compress uh different things and filter out and then you have the decision making with the fully connected you mean High dimensional I don't know I'm not an AI person I don't know the terminology so how do you call the neural networks that combine convolutional neural networks and fully connected neural networks is there any term sort of like a hybrid ones heterogeneous because you can come up with a lot of pompous terms to sound cool to your investors so I don't know which of the pompous terms the AI people chose to call this kind of stuff like because I'm not in the Indus Street like I don't know like your conventions so I can't remember a term for them like me neither I don't know like which term actually gives you more money from the investors like which one like sounds cooler like I don't really know uh it looks like hybrid is actually used in some papers nice okay so I guessed the pompous term correctly that's cool so that means I can already work in AI industry because that's what's important uh because otherwise how can you get the money out of the investors if you can't get money out of the investors by constantly using this pompous five head terms you won't be able to even do anything right because you can't do research if you can't eat right so that's why the terms the cool terms are way more important than what you do because that's what gets you must remember I'm just joking don't get me serious okay but I know how it works I know how it works I worked in other Industries anyway so um Pokemon right so let's actually write this intest and then buffer so this is the buffer LEM and then we're gonna have like one [Music] so and I just want to see if it actually like reads the entire file just put action release anything so let's command this stuff now and uh let's do the gym let's show it who's the boss of the gym failed to open file because it's not error.nn it's actually kind of cool that um this entire thing automatically logs everything for you yo this is so cool um you're joking but similar uh happened at my work recently we had to describe a multi-threaded job system in a fancy way to impress stupid people yeah I know like I'm joking but I'm actually half joking right so because because I've seen how that happens like I've seen how that happens I know how that works and because of that if I met meet people from other sort of areas of like work and like I.T and stuff like that and they start throwing all this fancy pompous term I know what they're trying to do like like I I know because I know how that works like you're not gonna fool me with all of that stuff right uh because you can always describe the same thing with simpler easy to understand terms you can do that you just choose not to do that for certain purposes for gatekeeping purposes for impressing purposes like I know how it works uh anyways so um cool we managed to read that shite how about it how about it so the next thing we probably need to do we need to parse this entire thing and maybe I'm gonna just use like something like as sv.h right so this is the yeah is it is it just a sweet I think it's just a sweet right it's it's another single header uh single header library right so we can find it in here and this is just like for string views people keep uh sending me pull requests but I don't have time resources to actually look into them so I really apologize for for anyone who sends the pull request and I don't really look into them uh right so let me just download the synthetic it's actually very convenient for parsing in general in C specifically uh and then use it for that finally wait a second did they just edit the download button what the I mean wait a second so like this website exists since nine since 2009 it's it's over 10 years holy it's almost 15 years and it took them more than 10 years to come up with this revolutionary feature to download a raw file holy it took uh resources of multi-billion Corporation because before they got bought by Microsoft they couldn't do that it was impossible computer science problem and then Microsoft bought them and they reused their multi-billion corporation resources and they finally came up with this beautiful solution holy oh my God finally that's the actual advancement not all of that AI hype this is the actual placement in software development solution look at that yo what the anyways so but really why was it so difficult to just add this button I don't know um so anyway so I guess you didn't change uh I'm gonna move this thing in here and there we go uh okay Jim dot C uh we need to include sv.h and what we have in s3.h we have to also do SV implementation uh there we go and Define so what we can what we can do we can now construct a string view out of the parts right so we can say that uh we're gonna have a string view content right so this is the string view content and the data is the buffer and this thing is the buffer Lan and we may have some problems in here right because the string view sort of expects just a pointed to the character but we have appointed to unsigned characters uh right and uh we'll see so let's actually take a look at the compilation errors and what they're complaining about uh what are they complaining about there's a couple of warnings but I think we can quite easily just say a shut the up and just like suck it up and that should be fine okay so we have content so now while contents is greater than zero right while it is greater than zero one of the things we can do we can do SV chop by delimiter right we shop by delimiter we provide the content and the delimiter is going to be actually space right we're dropping by the space and here we get like a single layer in here right so we essentially get a single layer and one of the things we can do now and we can say uh print listen to that thing svr right so in this vfmt S3 Arc is a classical thing that I use right so essentially it just allows you to use printf with a structure because string view is a structure but sometimes you want to use printf with this entire thing and they come up with a bunch of macros that makes it a little bit easier for you right for the formatting you have to use this thing and svr basically just structure destructurizes this structure into several arguments right so then you can essentially print it like this right so it's kind of cool all right so and now I might as well actually wrap this entire stuff in this all right so we can rub this entire step in this and uh let's go let's go and as you can see it kind of worked but the problem here is that it printed this entire finger and we separated this entire stuff into numbers we can now uh parse these numbers as far as I know um there was yeah so you can literally try to do something like this we can also try to use this thing chop u64 right which literally tries to chop a number out of this entire stuff I think that's that's even better than just separating it by spaces right because what if we have several spaces right if you have several spaces you're going to have a little bit of a trouble uh all right so let me take a look so we have like several of these things you have a little bit of a treble uh all right so as you can see yeah so it's kind of dumb I'm not gonna lie so what would be better in my opinion is to use this thing which is chops this stuff out of the content right so uh does it trim the white spaces in front of this thing okay it doesn't trim them but we can do that ourselves right so essentially this is old way of doing that we don't care about it we can do SV SV trim a left uh we just trim all of that stuff in the content uh right and then we chopped the number right so here is the number uh and uh then we basically just print this entire thing right so now we should be able to do something like so this is you in 64. let's cast this something to integer right so just to make it a little bit easier because like you in 64 has a special way of printing it with printf so it's a little bit pain in the ass so let's actually do it like that uh there we go and as you can see regardless of the amount of spaces it just works like that though if you have um for instance no things at all right and just a bunch of spaces it's still going to be rather weird right because it says that you have at least one number in here which is like not true right so essentially what we want to do we want to have like a slightly different way of doing that so first thing we do is trim and only then check if it's empty or not only then check it with the empty or not and then trim again at the end of the iteration so first we trim and then if that makes the content count equals zero that means we stop the iteration but if it's not we try to chop the character out of that and then we continue and so on and so forth so there could be some problems if uh this entire thing starts with for example a character right because if I remember correctly uh this entire thing just handles up until the digits right so this thing May basically hang if you have anything that is not a digit in here right so that means uh that one of the things we probably want to do is content count is greater than zero and and content data zero is digit only then do that so that that will make the entire Loop stop as soon as it sees a single character right okay and that's way better way of doing that in my opinion right so here as you can see there's no numbers there's no numbers we can now put um uh eight in here right so we're gonna put eight in here uh right so as you can see there's one eight we can even put some stuff here on a separate line so as you can see it still works and then if we put accidentally like a character in here it will just stop at the character right so maybe one of the things we can do is just like make a warning there uh and stuff like that but I'm not going to do that so here we're going to hit five uh and as you can see this is a very robust way of doing this in that stuff this is a very robust way of doing that and maybe it will evolve into something uh interesting in the future right ah isn't that Foggers I think that's pretty freaking progress so um cool so but that means we have to now add these numbers to uh some sort of array right we need to add those numbers to some sort of array so what we're going to be adding that to we need to have a dynamic arrays right so and you know how a Implement Dynamic arrays so I usually have a macro I can still that macro from dead yet again so it's going to be SRC so I think it's located somewhere in a common the a append right so that's a very simple macro uh it's a very simple method that we can just put in here so in essential what this macro expects is some sort of um associated with structure that looks like this right and in here we have to do uh items I think so this is how we do that so it calls them itl so this is the items it should also have the count and the capacity uh right so and essentially what we can do we can say okay so here's the architecture it's initially zero initialized and then as soon as we read something so let's actually convert this stuff to size T I'm going to do da append a arch X right there we go and now we have the uh the architecture with which we can now construct a neural network right so that means we can just like do it like this Arch data or Arch count and that should create the neural network for us we can even randomize this entire thing and then we're gonna actually print this entire thing like so so let me try to run this into I think and there's a couple of warnings so did I append oh yeah so it wants to have the initial capacity uh so let's set the initial capacity to something like uh 256 I don't know I think that's more or less reasonable more or less implicit Declaration of assert okay let's include assert here as well so here is the assert uh what else do we need to have in here uh implicit Declaration of an end so we have to include uh and then the page and an implementation uh there we go so is it working so it's actually items so what else do we have um so when we randomizing we have to specify the range right so basically lower and upper count upper value and it kind of worked but it took a little bit sometime yeah okay so yeah that's actually pretty cool and it also logs all right uh file loaded correctly but yeah this is basically the neural network that we managed to create in here and uh so that means here I can have like other neural networks right so uh for instance zor ones so Zorb one is basically two uh two one all right and if I try to restart the center I think I wonder why it takes so much time but yeah so as you can see we can specify the architecture of the neural network at the runtime now using progress isn't pokers I think it's pretty freaking Powers uh right so and for Eder let's actually get back to here and we can have several like different files for this entire stuff right so I think I think that's pretty cool I think that's pretty cool all right so uh we managed to read this entire stuff so the next thing we need to do we need to initialize the window and stuff like that right so let's initialize the window um already okay um so adder.c so we're probably also gonna do something like this so the other thing we need to do we need to be able to read the um the data right but to read the data we need to generate the data as well so the question is how exactly are we going to be doing all of that how exactly are we going to be doing all of that so the input and output data is basically the uh the matrices right so where are the rows is the amount of samples and the columns are the things okay the columns could be quite easily derived from the architecture of the neural network right so here so we have at least eight columns for the input and then five more columns for the output right so that's what we have in here so that's what we have uh the question is how do we specify the rows we can come up with some sort of like um binary format we can come up with the binary format where for instance first aid bytes right so we have first 8 bytes and this is basically the amount of rows in your neural network right medium maybe we can specify columns as well all right so who said we can't really do that so it's gonna be eight bytes and then you have basically sequences of eight bytes right sequences of a bytes like so where each byte is the element of the Matrix of this specific Matrix okay so this could be like a general format for serializing the matrices right so if you have a matrix you can just serialize it into this binary format and just like dump it and then load up if you want to right it would be kind of also nice to have a magic in here right some sort of a magic uh usually like how big of a magic people put in their binary files I suppose like eight bytes all right so this is basically the binary format I'm thinking about right so when the question is what's going to be the magic um uh the magic could be something like I don't know nn.h this is literally four bytes actually um and and H so because what if I want to actually also serialize neural networks entire neural networks right so that means I may have separate um separate Magics for that right separate magic so that um so it would be kind of cool to have like n n M so this is for Matrix and for the neural network uh I don't know it's kind of difficult to come in so Matrix man this this kind of hard like how can you even come up with this kind of thing dependent H dot matte but that's a lot of bytes right that's uh eight characters which is probably fine yeah thank you right so it's basically in that case it's gonna be eight bytes I mean this is a 2023 why do why even worry about uh you know this kind of stuff right so we can have a matte and then we can have like n n right so that makes sense I think I think that makes sense all right so uh let's go ahead and maybe Implement some functions that will enable us doing this kind of stuff right so if we take a look at nn.h uh right so we have Matt a lock you can allocate you can randomize um you can print this entire thing and uh let's actually do something like matte save Maybe all right Matt save and essentially here we're going to accept the the file right so the output and the Matrix right so and it will just like literally save and another thing we probably want to have is load uh right so this is going to be in so this is the two function that we'll need to implement like save and load uh some of them may fail I don't really know what we have to do in case of a failure but we can just crash at least for now uh all right so let's go met a log uh let's for now Implement only save right so this is going to be that um okay so let's do a right right so we're gonna have something like magic and the magic is going to be nn.h matte right so there is like uh eight characters in here right so and we're gonna just do F right output magic and then Ester Len of the magic all right so we're still in all the magic and then one think out has to be actually at here right in the case of an errors what do we do in case of an errors um so we can do use the ray lib approach essentially if an error has happened we just log it and exit right we can say something like f printf is to the error and then.h could not could not write to file right so could not write the file but maybe I don't know how useful that is for now at least right because we're going to be opening the file outside of this entire thing and if you manage to open the file it's usually fine so there's no need to do this kind of stuff so maybe whatever uh okay so um let's do F right and let's actually write the following things so the first thing is going to be rows right size of grows at one an output and also let's put the columns in here so this is the columns all right so and then uh one of the things we want to do we want to do F right so this is the elements size of a single element and the amount of enemies we have in here is M Rose and M columns right so the emeralds and mo columns multiplied to each other right by each other and that's basically the whole serialization uh that's basically the whole serialization so so this entire thing may actually not uh provide like like save everything so I suppose you have to run it in a loop uh right but one of the things we can do we can kind of run it in a loop right essentially work while and is sort of like a less than vicenter I think right well it's less than this and I think we may want to do the following stuff right Plus and plus m minus M right and then we are ready to another M and then let's go and also maybe a while not F error out right because if it errors it may keep returning zero and we can actually hang in there uh right is that a good thing I think that's a pretty good thing uh right another assertion that we may put in here is basically that m is always less or equal than the current n just in case because you never know what's going to happen otherwise it's just gonna actually here yeah no I'm doing something stupid yeah that's fine that's that's so different it's actually like Perfect all right Okay so isn't it cool I think that's pretty freaking cool so let's go ahead and try to write a generator for some data an intentional completely unintentional uh right so this is going to be a separate program so I suppose the the idea is going to be the following Okay so you need to somehow come up with that data somehow the question is how are you going to come up with that that's a very good question I suppose they're going to be like another like gen right generator that creates you the data right which should then fit into the gym then gym speeds out the uh the neural network that that you can use in your application is that too complicated over overthink what about this trade that's a good question yes I should probably take it straight into account yeah thank you thank you so much [Music] um so is that too complicated over like a workflow with this internet I think I don't know it kind of feels a little bit complicated but I don't know how else what else would you do right so if you want to have this visualization tool that just shows you the process of learning I think that's what you have to do um you have the number of rows and columns no need for stride what are you talking about is that the words of the person who have no idea how this Library works we do have stride so and what if somebody will try to save the the entire thing right we do have a stride and we need to take it into account because that's how the library works and I know how the library works because I roll it and the viewer in the chat knows how the library works because they watch the Stream okay so uh I suppose what we need to do in here so yeah so let's do this kind of stuff [Music] um so let's iterate by rows right so this is going to be a room what was I uh-huh so we're gonna put it like this and the question is where do we start I suppose we can do one of the things we can do matte at and we can just do M and then we start at the row I at the column is zero and that resolves the stuff with them with this tried automatically right so we're going to do it like this and here in fact now we're just trying to save columns right so we're just saving the columns uh and that means that here instead of this kind of stuff we can just do like that there we go isn't that boogers I think that's pretty freaking pogous so um yeah let's come up with the generator but don't you need to also save this right field it gets lost after civilization it gets lost after serialization so no um so all right adder again dot h it will be kind of interesting to actually store the architecture here as well if you know what I mean Because the actual training data is tied to the to the architecture right if you change if you change the architecture you have to change the training data and if you change the training that you have to change the architecture so it's kind of a it's kind of an interesting thing isn't it it's kind of an interesting thing so maybe we should actually save uh the whole thing in here right the whole though knowns not necessarily because it's only about inputs and outputs yeah it's only about inputs and outputs so should be probably a different thing okay so error gen uh let's create this scene right so let's do the following thing and on the page Define uh and then implementation right so this is going to be a separate program that just generates the stuff and we can actually take the adder.c and take the Beats right so I'm going to take the bits and how do we even generate this entire stuff so this is how we generate the data yeah that's the whole thing actually available to mount and what's funny is that we are doing separate mattresses in here we're doing separate mattresses which actually raises the question maybe what we have to do instead we have to superflick to put it into a single Matrix right put it into yeah okay so we can just allocate a single Matrix which is going to be like a combination of these two and then we can take like a sub views of these mattresses this plus one all right so this one is essentially going to be like this so yes we start at uh essentially met at t 0 0 right so that's what we start at the amount of rows is the same as the amount of rows of the original one the amount of columns though is 2 multiplied by bits but this stride let's try it stays the same as from the original thing so this is the sub Matrix in here so for the outputs for the output we do the following thing I mean what the hell is this actually uh-huh so yes um in terms of the row it's still zero in terms of the column though it's going to be offset by this thing right it's going to be upset the amount of rows is the same amount it was the same the amount of columns is different it's beats plus one and stride is also the same because that's kind of the point that's kind of the point of the strike so and that means I don't have to modify any of the code below right so this this is done so I don't have to modify anything in here because I'm afraid to make a mistake right so they now are viewed uh like this is a single Matrix but we take sub mattresses like the sync views uh and then we can quite easily just say Okay save this entire stuff to like say output uh let's see right we're saving not TI or or to oh we're saving like the entire team so but to save this and I think we have to like open the stuff F open uh Adder uh right so so what the show should be called the adder mat right so I think it makes sense to call it addermat and then we're going to close this entire thing and if out is equal to no we can say something like a printf uh error could not open file this uh right and I have to collect this to the error exit one maybe just return one okay and uh I suppose we need to have a file path maybe alt file path uh const Char uh this thing and then put it in here alt file path and then after that we can say printf generate it as out file path there we go so we have a program that generates some data so it's added to the build script so we're gonna have Adder Gem and let's see if it's going to even compile so um uh I call it the get not get damage my God okay so let's recompile Okay so let's go to the compilation errors so it doesn't have a string uh let's add the string dot h in here so what else do we want um so m is not a structure or Union member reference has a base size HD what are you talking about right so es if I'm not mistaken right so if you take a look at the matrix it's a pointer and then I just do that so that should result in a pointer um [Music] what am I being dumb reference base type size T so maybe I don't understand how F right works right here you're supposed to have a pointer right so here's the pointer uh by doing m dot E S Plus N I get a pointer because this is a pointer this is size T so if you add a size T to a pointer you get a pointer um oh I see because all right yeah why it wasn't complaining about yeah this is because it was shadowing it's get get them shadowing all right I see I see I see I see shadowing yeah should affect me yet again okay so we are trying to actually write binary and that should work implicit Declaration of an end save ready that's actually really weird um [Music] wait excuse me it's not an end safe yeah it's a mad save yeah it's a Mad City all right we're good we're Gucci uh so yeah all right that's cool and now one of the things I want to do I want to do error Gem and it generated editor metrics right uh what is shadowing um it's when you define a variable two different variables with the same name right essentially you have a variable in one scope and you have another variable with the same name but with the different type in a different screen uh yeah maybe I can even do something like integer because not everyone familiar with size t right so what's going to happen in this specific case which X is going to be picked in this specific case it's going to be X so X float X shadowed the integer X so that's what shadowing is referring to usual some languages allow that some languages disallow that depending on the like style and community and culture and religion uh shadowing may be a good thing or it may be a bad thing right so it's a kind of like a polarizing topic if that makes any sense okay so we created the metrics right so uh and this is how it looks like so it kind of like probably ruins the encoding so yeah here is the magic and then we have the rest of the stuff so we can take a look at in HEX mode uh right and yeah so we have some data in here we do have some data in here so let's actually close this into I think and uh now we should implement think that loads up the The Matrix from here right so essentially we need to implement a symmetrical function to and then save and it's going to be NM load so uh since we know that the magic is essentially eight bytes I can actually save this entire magical here right so we're loading so loading is probably going to allocate some memory so maybe we just have to do it like that I'm going to return the Matrix here we go uh all right so we're gonna have a Read Magic says of magic one and this is going to be him right so we just read the magic and we have to confirm that uh Magic is equal to that thing somehow uh right so we can take a look at how it is represented Within uh the entire thing so I need to open the editor matte so I can take a look at the hexel I suppose right uh what is it and ended H and xxd what is it called adder dot Matt right and let's actually do the head right so this is basically how it looks like and what we can do I think I do believe so is copy this here and just say okay we expect this magic to be equal to that I think that's how it's going to work hopefully but maybe uh because of the um yeah because of the little engine and some other it could be actually written in a reversed order right so it's probably gonna yeah it's probably gonna fail so that means we'll have to uh you know reverse the the bytes or something like that though quite often people use this kind of stuff to determine uh What uh platform they're in whether it's a little engine platform or a big engine platform and stuff like that so uh in any case I'm gonna just keep it like that and if it fails we can fix that doesn't really matter so uh the next thing we need to do we need to have rows and columns right so we need to have rows and columns so uh let's read Rose size of rows one in the cones and one of the things we want to do we want to allocate The Matrix with these rules and of course once we're located at we just want to keep reading this entire stuff right so we're gonna have a size TN F read so es size of s and what we want to read we want to read rows and columns right so this is going to be rows and columns in and while n is less than rows and cons and there is no error a while written over that um we want to repeat this entire step but actually plus n minus M right so let me double check Matt save plus n minus n okay so just double check that everything is correct and uh n plus K there we go so that should read the center I think um so okay so the thing we want to do in here right the thing we want to do in here now is uh go to the gym right and read uh the whole thing right I want to read the whole thing um interestingly so in case of huh you know what that is very interesting when we are reading this entire thing we don't really need to use NN load we could have just like loaded the whole Matrix into the memory and then just use that right so then we can could construct the metric structure and just point its Es at the corre correct place and set rows and columns that's one of the things we could have done right so who said we can't do that I think we can um so yeah that's actually that's actually probably even better if you know what I mean um right it's actually probably even better but uh I probably won't do that a little bit later so uh I think I want to make a small break because I'm already streaming for two hours right so I would like to make another cup of tea uh right and after the cup of tea we're going to continue doing this stuff um okay let's continue so uh let's go ahead and maybe open some stuff in here so honestly I would like to actually accept the arguments through the command line right so that would kind of make sense uh right so if rxc so usually the way I do that I use the shift pattern all right so can I copy paste the shifts from somewhere do they have shipped in here no I don't so the idea is essentially that I have shift um function here which accepts the pointer to rxc and triple point to arc V how about that is that powers I think it's pretty progress so um so I usually called it Arc shift right so this is Arc shift one of the things we want to do we want to assert in here that rxc is greater than zero right so then we can do essentially rxc minus and one of the things we have to do we have to come up with the results all right so and the result is essentially ARG V R right but it has to be like a yeah we need to do the double the referencing to actually get to the to the thing and maybe here I'm going to do something like this and in here I just the reference this specific thing I need a plus one I get to the next so the pointer and this and this is going to be the result so here I'm going to have a program right so this is the program uh args did they call it direct shift or just shoot okay so let's call it Arc ship in this pizza case so provide it like that and uh there we go so after that I can check um if Arc C is greater than zero right if it's actually less vertical than zero that means not enough arguments were provided and we can actually complain about that uh STD error right so error no architecture file was provided so first one is going to be architecture file um all right and we're gonna return one so after that we're gonna do Arch file path and this is going to be just RX shift rxc argue so we're sort of like a popping out the the stuff all right in if after that rxc is less again that means no data file was provided right so no data uh data file was provided so and here we just do um actually yeah let's call it data so this is a data file path so and in here instead of this thing we're just using uh Arch file path and I suppose in case of an error this image I think would return Boolean uh no I mean I'm sorry and uh in that case like the function already logs that it couldn't load the file so we don't really have to do anything we can just like you know put one in here and don't worry about anything so then we're parsing architecture so everything seems to be fine and the next thing we need to do I suppose let me actually comment out this entire part for now we want to load the metrics right so we want to do load um Matrix we had to provide the in right so we have to provide the in and that will give us the the training Matrix so in is essentially F open and it's gonna be data file path a written binary if in is equal to no we can say that we couldn't read the file all right error um could not read file um this data file path like so and we're going to just return with one today we're going to close this entire thing and one of the things I want to do I want to just print the metrics that we managed to read from the file hopefully we'll see we'll see so one of the things we'll probably also want to do I want to print the usage right just to tell the user how you're supposed to use this entire thing right so it's going to be the usage this is the problem right then you have to provide the um you know model Arc and then model matte right which is the Matrix right and um I'm going to say twice in here uh uh so now let's try to is this a gym yeah it is a gym so it is correct thing so let's try to build the internet I think uh so yeah we have to do Source uh opt uh array lib environment and then go so what is it complaining about it complains about magic um expected semic what the is this error are you freaking serious like is that because you in 64 is undefined what the is this like I mean okay if there isn't look okay I can I can just try this is the most unreasonable error message I've ever seen in my entire life is that the reason that was reason s holy can you restructure your parsing so you don't have to say such thing like what maybe maybe this is a problem with C like it's just like this is so bad like it's not helpful when your error message isn't helpful it's a bug this is straight up unhelpful [Music] well I mean at least it wasn't that bad that I couldn't figure out what exactly happening but it's bad like these kind of error messages are bad straight up because like semicol like what the are you even talking about it has nothing to do with that at least reorder your errors or just do something oh my God I don't know why things like that piss me off but it's just like I don't know uh I swear to God anyways I'm sorry uh Jim no architecture file was provided okay so let's provide the architecture for the adder uh all right no data file do we have an error Matt there we go so and the magic is not equal to that because it has to be I suppose a reversed right so let me try to do the following thing I wonder if there is like an easy way to reverse this thing like not manually um so can I do a reverse uh origin no it didn't really do that one of the things I can do I can probably split this into new lines all right and then just reverse and then concatenate everything back can your veeam do that can your beam do that it cannot do it can't I'm sorry uh and insert and there we go so suppose that's what it has to be um uh let me let me see I don't know what the compiler is supposed to do in that case if the nd5 is declared the determination if the what is supposed to say it's supposed to say identifier is not declared that's it why it feels like it resolves the type devs at parsing time that's what it feels like and why do you resolve the aliasis type devs at the person time is that because the language forces you that means the language is which actually confers my hypothesis that see so yeah why are we still using this language in 2023 why are we still forced to use this language in 2023 why there is no good alternatives to C now rust and Zig are not alternative to scene um anyway so [Music] okay so let's try to uh okay why did it remove this kind of thing uh this is [Music] The Matrix here is the training data chat this is the training data we recovered from a file isn't that so this is basically uh what we had to do the Indians me in the ass yet again the Indians okay but here is the thing about tea uh so we still need to split it into chai n2o right so we still have to do that uh so let's construct this thing like so it's kind of similar right so in terms of the rows it's going to be the same amount of rows as the original thing in terms of the columns actually it's going to be rather interesting so essentially we're gonna have an assertion we're going to have an assertion that amount of columns of this thing amount of cones is this thing is actually equal to the architecture data zero plus architecture data last one right so yeah because the first n columns is the inputs and the second n like M columns is the outputs and N is equal to the amount of inputs and the amount of the outputs right so which kind of implies that we also expect and count to be at least greater than zero so and in that case maybe it has to be even greater than one because you need to have inputs and outputs so but I'm not 100 sure about that specific case so that actually boils down to um can we have um and then with just input because I'm not quite sure like what's the implication of this stuff what's the implication of this stuff so yeah anyways um so here uh it'll be nice to have like a separate stuff right inputs we can call it uh ins size right so it's going to be size t means size and this is going to be outside which is Arch count minus one ounce size so in terms of columns uh columns is going to be ins size stride is going to be the same as the stripe original stripes and the S is basically Matrix at 0 0 t that's just a point I don't know so the outputs uh all right so the rows is the same the rows is the amount of samples The Columns is out as Z try it is the same let's try this the same and then we're going to do matte at C and uh so this is the offset the offset is INS size there we go so and let's actually see if we manage to separate those things correctly so I'm going to print to I and print to O uh right so let's see so did we manage to separate this correct it doesn't work uh is it because it's items yeah it's called items I see all right so semicolon good what else um yeah okay so it seems to be yeah so this is correct separation this is actually pretty cool uh all right so that means we have everything so we literally have everything and we're ready to go so let's start the window right let's start the window and uh let's continue copying this stuff from here and let's see uh all right so we just do the back propagation right but that requires an end and G right so let's actually construct those things right so uh we're going to be constructing those things like so uh-huh so we also have a learning rate which is usually one I think one is kind of dangerous thing to have but that's totally fine so that is totally fine all right I guess that's it right so let's try to compile this entire thing I'm not gonna run the gym for now right because it will start the UI and stuff so let's go to the compilation errors so Arch yeah so we already have Arch Arch is supposed to be items and Arch account right so that's what it's supposed to be um pencils what are the compilation errors you want to throw at this uh it's a count come on so when we're done happening array leap rendering so because we need to copy paste it uh from here all right so let's post it somewhere here all right um um all right just to make sure I checked your dot files and it's really CPU temperature wow finally somebody figured out that you can do that you you're probably the first person who managed to do that or at least you're the first person who claimed that you managed to do that it's just like people keep asking me what all of that stuff in in your in your in your bar but you can literally look it up it's just like all online it's just and it's all public all public you can just look it up and see it for yourself yes thank you so much I really appreciate you all right and ironically actually um all right so uh we finally managed to create a gym right so it doesn't really have a configuration about like how many iterations you want to have and stuff like that but that's maybe fine like a lot of the stuff maybe in the future we can move to architecture file or to config file or something like that uh the thing I don't like about the data file is that you need to separate you need a separate program to generate it all right I mean that maybe that's just fine maybe they're just fine okay so let's actually try to run gym and see if it actually performs well right if it's actually doing anything uh yeah is it learning well the the cost function is actually decreasing right so yeah it's slowly emerging I really like how this is like they start to light up when you when you train this is so cool so by the way another interesting thing I want you to do believe it or not is change the thickness of the lines depending on their value that's one thing I would like to do yo let's quickly try to do that uh right so I'm gonna just take a look at and then render ready uh right and uh so essentially where do we draw the line so here are the lines so if I take a look at Ray leap draw line is there anything with thickness oh okay so yeah okay so draw line X so extend it and it allows you to draw with the thickness okay that's pretty cool so I suppose so the thickness comes before the collar so this is going to be the thick so is it float it is float perfect so we can do float thick and then I'm gonna have it as one so this one is going to be DX so interestingly so here is the sigmoid value so we take the value of the weight and we squash it with the sigmoid right so we can basically use the same value we know that it's going to be from zero to one right it's going to be from zero to one so that means we can have the thickness from 0 to 10 and just multiply it by the volume and that will work automatically I think uh right so this one is actually it has to be here there we go so that should work I think so let's give it a try I think it's going to be pretty cool it doesn't work so too many things uh all right draw at busier busier oh ready you're gonna have a draw line with separate components but draw line x with Vector 2 and vector okay sure uh can I construct a vector a problem I don't know like so too start uh can I just do CX 1 c x c y one let me just end this one two can align ah literally unusable literally unusable I'm joking I think they're a little bit too thick okay are they gonna become thinner they kind of become thinner yeah I feel like they're a little bit too thick though they're kind of fine so we can see how they're sort of like so what are the strongest things in here that's kind of cool we can take a look at the uh okay so I think 10 is too much all right I think 10 is too much so what about five also I want to be able to print the a talk right so let's do a Epoch so this is I all right so maybe sqr the value and maybe one of the things I want to try is zor I think zor is going to be kind of interesting look at how thin it becomes like it became too thin yeah it become almost zero right it's just like this connection almost disappeared yeah basically which is probably not particularly good representation of this entire stuff or maybe it is so yeah that's why like people um yeah I know that this is wrong I know that this is wrong uh that's why I'm actually double thinking whether to include that or not um but that's interesting nonetheless that looks cool at least and that's what gives the views all right so who cares about correctness anyway so uh let me actually get rid of the thickness right so because I don't think it's particularly good idea uh right so but I'm Gonna Keep the possibility to do the thickness anyway is an end calculation stack to relieve Max FPS yes and that's why I was thinking about doing that in a separate thread at the beginning of the Stream but why I don't do that in a separate thread because it's unfinished and why are you unfinished code is unfinished ah okay all right so uh let me continue uh the finished code is unfinished um so what I want you to do what I want to do I want you to look sore right it's on the Zorb uh Arc so we have two inputs two and one right but for that we need to generate this kind of thing so yeah this is the very much inconvenient thing um print uh it will be kind of better so I suppose I have a feeling chat I have a strong feeling that the data has to be text for it I have a feeling the data has to be taxed for because this is like I I literally don't want to do that the thing I want to do with the zor Matrix is just say okay uh we're gonna have four over the uh four rows and how many columns are we gonna have we have two inputs and one and three of these things and then I want to say okay uh zero zero uh zero one one um one one and one zero and that's it I want to be dealing with the rest of this stuff [Music] um I don't know if you noticed but your unfinished code isn't finished yet how can you even stream this yeah that's a good question thank you so I feel like this is what I want to do if you know what I mean right so I want to do that because it makes it easier to generate like a smaller data right just generate a smaller data so I feel like binary format it might be useful for like storage purposes if you know what I mean it could be useful for storage purposes but for uh for other purposes yeah we should have two kind of formats we definitely should have two kinds of format like a binary one and a text one um all right so that's the thing that's the thing that we definitely have to help right so and for the forzier zor maybe I'm gonna just like quickly generate this or I think I think that's one thing I can do um yeah let's go ahead and do that Azora gen C and then you find and an implementation and then I'm going to just include and then the page um so I'm gonna just do it like that so Matt see Matt Outlook Rose 4 and the columns three right so and one of the things we can do in here is essentially map at T zero uh we can probably do it like so I'm going to size two [Music] um it's more of a like two plus J I would say that's the row we have in here and the column zero has to be equal to I so we can say that this is a sample where do we can even call it a row maybe we can even call it a row all right so this is I this is J and this is izor J after that let's actually print the results so this is a matrix print uh build.sh okay it's like what versus wasmia probably because one is for machines another one for humans okay so this is what we managed to generate kind of what if we could just parse this entire thing yeah what if the format was literally just like this right you could just dump that and just read that uh because it also stores the information about the dimensions and stuff like that but the person that is kind of an s so I'm not sure anyway so what we want to do right we want to actually do something like out have open uh so out file path right in binary Advanced Char out file path is going to be equal to what Azure Matrix right so and if out is equal to no I'll print f is the error and it could not open file s Plus plus and and save out team and then we just close out written as okay let's try to generate some short and then save keep forgetting it just reflexes um [Music] okay okay so looks good looks good to me uh all right so do we have a zor Arc so this is zorark and zor Matt so that means now we can take a gym and provide Azure architecture and absorb metrics and just see how it's going to train this entire thing there we go so it is slowly training this intestine never interesting how a recent I think becomes negative this thing becomes negative this is negative but those things are positive and it's just like yeah it's pretty cool so that's basically the thing so for the um for this thickness I think we could make it a tiny bit thicker right maybe maybe even three right so so we could at least see uh correct this kind of stuff so it's from the gym uh zor what is that architecture Matrix logo [Music] yeah so I think the lines are a little bit easier to see now on the screen I wonder if it always converges to like these things to be negative right yeah I think I'd become really really strong over time all right that's kind of cool um enjoy this kind of Poker is not gonna lie looks the same yeah it basically converges to the same thing right I suppose I suppose that's what it does it converges to the same thing uh right because maybe that's the optimal solution anyway right so it just will converge to the same thing in case of an editor right in case of Eden we should probably not rebuild everything I don't know why I'm doing that um yeah I should have actually made the weights uh thicker a little bit started from the start because it just looks better man that's so cool it's actually so freaking cool about it um so another cool thing uh would be to plot the cost function as well so we got some Beats from [Music] nitric's death thank you so much function beats with the message I bought programming socks and now 2x more productive thanks to your hook I actually don't have programming socks believe it or not that was a joke well in that clip I was just like joking so I don't really have programming socks but I do still recommend to buy them I still recommend buying them man this is so awesome and it becomes brighter so so I suppose the disabled things are basically the gray one because they're closer to zero right and it stopped so okay it finished rendering essentially right so I mean training so this is basically the final result to Fanboy outfit when uh when it stops being illegal in my country or when I actually get out of my country I don't know so um okay [Music] um so that's actually pretty cool and then maybe you could have like a button safe this neural network and it will just dump it in a binary or textual format it depends on like which one you want to use maybe there is some sort of like a standard format is there any standardized way of storing this kind of stuff maybe we could just support the standard things so we can just load them up yeah that's a very interesting question right why invented our own formats if we could just like use existing ones and that will allow our library to action maybe even evaluate existing models why not sounds like a good idea um I don't know but I'll have to think about that so one thing I definitely wanted to have right one thing I definitely want to have is plotting the cost function as it learns you know what I mean I think that's kind of important but we need to have some space for that right so because this entire thing is just like taken over by the you know decent stuff so which is not particularly convenient in my opinion so what I want to do I want to customize and then render Ray lib right and what I want to do in here essentially is specify at least like width and height right so I want to be able to specify the region within which it will render that specific neural network right so here I want to pass a rectangle and it will just draw that thing within that rectangle so a rectangle is usually like X and Y right X and Y but for now I'm gonna just start with uh just with some height right so this is going to be wood and width and height so Google search showed this an open source format for neural networks okay so let me check it out when we try to open it up open neural network okay so the fact that it's open doesn't really mean anything does anybody use it so there is a lot of open formats that nobody use right so is it actually used so that's the real question okay so there's a bunch of uh a bunch of logos of companies foreign just a website for for a library that explains the library and then it says and here is a bunch of companies and it just lists a bunch of companies but it never says that the companies actually use your library it's just that here is a bunch of companies it's just like a random companies were found in the internet like they have nothing to do with our library but it is because yeah because nobody's going to read that they will say oh this is how many companies use that but they will never read the title that here's a bunch of libraries or companies you know what I mean because I mean wait a second yeah I'll record you come into yet nowhere on this page they say that this company actually used this format just think about that nowhere on this page they say that this company used this format so this could be just a list of random logos of random companies the communities so again I know nothing about this format by the way I'm not trashing it I'm just like saying I'm not even an AI person so the thing I'm interested in is is it used I suppose it is used action um maybe in CSS selector yeah maybe maybe it's sentences selected all right but I mean something exists so I'm gonna give the link to that in the description right so um they have a pretty cool design and they have a pretty cool uh domain so that means they have money where did they get all of that money from I suppose I suppose from the sponsors so that means that somebody probably uses that so that's my conclusion this year so I'll look into that uh after after this stream all right so let's actually try to um control the width and height of the region that we're rendering right so let's quickly replace uh image width with W there we go and then uh imagery height with h I'm not sure if that's a good idea but we'll see all right so if I try to recompile if I try to recompile it will fail by the way I think I didn't need to compile these things right so because we already generated some data so in here we have to specify okay so we can say image width and image height right image with an image height pullers and okay so that seems to be working what if I divide it by half right what if I divided by half so what's going to happen okay so that actually rendered the entire thing in a smaller region which is processible to win it but that didn't change the sizes of the neurons and this is because the size of the neurons don't depend on the size of the region they're rendered in so what I'm thinking is that we should make them dependent right so we should make them independent so what is the size of the neuron so we draw the circle okay so there's a neuron radius so let's find this specific parameter so it's 25. let's make it dependent on the uh on this thing on the height for instance right so what is the height uh right so what is the height uh the height was 9 multiplied by eighteen right so it was 25. uh right so we have this parameter and uh this is zero zero three maybe even four so essentially what we can say a new round radius we can make it float um and I suppose it's going to be just uh image height zero zero four or something like that right so let's actually use the original size in here all right let's try to use the original size and let me see let me see okay so that looks reasonable now if I divide divided by 2 right divided by two is it going to be smaller uh no it is not small what the uh is that because I'm a stupid dumb dumb yes I am because you're supposed to use age we've got a sub from my favorite person on planet Earth um thank you so much for uh tier 2 subscription thank you thank you thank you with a message it's sojin cool sojin cool indeed by the way orange you the author of Focus right so Focus editor I think you are the author actually there's a lot of contributors but they seem to be the um you know the main contributor to that thing I don't remember how to find out uh boot LS thank you so much for uh twitch Prime subscription thank you thank you thank you um so it's actually really cool really cool editor and um I'm a contributor I did I did the Linux board okay in any case you seem to be like the person who contributed the most uh so if you guys interested in joy and what people actually do with Jai check out the focus it's a editor that is written completely in Jai and it's actually super cool uh so it doesn't work for me actually you know what uh for me it crashes and you know what it crashes with uh it crashes with you uh and it crashes on mu hash in a play in the places where it uses some SSE instructions or something like that so it feels like it uses some instructions that my CPU doesn't support and it I didn't look into that problem I just tried to run it and this is what I saw but that's kind of weird right so this is just something like I didn't report uh any bug because I was not sure if that's like my problem or something else right so a little bit later if I if I remember I will try to investigate and see what's up with that but that's uh that's rather interesting so in any case I'm gonna because it's just super cool I really want to try it try it out I'm gonna give the thing in the description as well texture right and uh some um some AI format what's signal used for it's basically a signal when that is sent when um you try to execute the legal instruction right so it could be a hardware I think old mode could be something else um it's not necessarily like a no instruction per se it could be some sort of a bug that made uh the instruction point of jump for instance in the middle of an instruction right so and that resulted in like just combination of bytes that is not a correct instruction uh right it could be either like a usage of actually instruction set that is not supported by my Hardware it could be my Hardware problem or it could be something within the application that made it jump to a wrong place or something like that it depends if you build it locally you get the same crash actually building locally is the only thing I tried I didn't try the official uh executable or anything like that right so yeah I can maybe I can maybe show you right so it's actually a cool claim people here so I think I have an old jar right now so I didn't test on the one that actually got released recently so we'll see so let me take a look at the version so here is the version um yeah so yeah it's far from the latest one unfortunately uh because okay so do we have first okay so I'm gonna just like use um you know first and see how it goes Set uh and degrade identify okay so my jar is too old uh I'll check it out later and if I find anything worth reporting I will report a bug about that right so yeah my jar is too old so it's already fixed and nightly by the way okay so let's actually continue what I was doing um right uh I forgot what I wanted yeah okay so let's actually see now if it um you know yeah okay so as you can see neurons are smaller now which is cool which is nice so but uh the width of the of the thing right the width of the thing of the uh weights still doesn't depend on the height so this is something that we'll probably also have to do all right so the width if I'm not mistaken alright so thickness is actually three right if we divide three by one what was that I already forgot um yeah so 9 18 right so that and three uh okay so this is zero zero four so thick uh we can do h [Music] so that's basically what we're doing here zero zero four yeah it's kind of the same right so zero zero four and zero zero four huh that's an interesting coincidence I think that's a very interesting coincidence all right so that looks better Isn't that cool right so now I can just like change the sizes in here right I can divide it by I can make it even smaller I think you can make it even smaller so at some point I think the lines may become invisible right and then for instance maybe I can multiply this entire thing by by two which will actually go outside of the window but it's going to be bigger so we can now control the size of the thing that we can render yeah so that's actually pretty cool all right and the entire like width and sizes are very much dependent on the height so that's how we operate but that's not enough right that's not enough another thing I want to be able to do is to specify the offset for the entire thing right so right now uh the offset is at zero okay so this is actually pretty cool so we control the offset with nnx and n and Y which makes it relatively easy to just do something like this right with X and Y um so let's actually rename these things to maybe r x r y meaning rectangle or region so and then we can say okay I've said that by R X or Y right so it's going to be X or Y something like this okay so let's go to the completion here so there will be some conclusion errors uh all right that we need to fix so this is another thing uh-huh what else uh so unused parameters so that's fine so and then here okay so here we have to specify zero for now at least so what I want to do all right for what I want to do I want to center it somehow right so let's say that the actual width is going to be image with divided by two and actual height is going to be image height divided by 2 as well the actual X in that case is going to be image width divided by 2 minus RW divided by 10 and 1. so we sort of like a centering decent happening which makes it super easy to just do RX or y r w r h and this is going to Center this entire thing we'll see we'll see yeah it's centered so that means we can just pick whatever region we want and we can say render the entire neural network within that region so which makes it super easy to just relocate it to different stuff and allocate some space for instance for the plotting of the cost function Isn't that cool right I think that's pretty cool uh right for instance I can say that uh I want this entire thing to start at zero right so that will align uh this entire thing to the left and it's aligned to the left essential so and we can plot the cost function somewhere here on the right or maybe we can maybe align it towards the right because maybe I want to have the plot function uh there so uh let me see how we can do that it's essentially our this minus actually image width right so it's image width minus RW and that will align it to the right right very cool yeah I know thank you thank you right so that's pretty porous we can actually do another cool thing but we can say that the height is actually going to be the whole height right so that will stretch the neural network up right because it's now like half of a height so we can control this kind of thing and we'll see how it's going to look like it's going to look differently and we can't see in this mystery which is kind of surprising yeah because this is not what we were supposed to be doing uh what we were supposed to be doing is setting the height like this in here okay so that makes sense right uh there we go so it's just stretch it like that which doesn't really look that great in my opinion if you ask me but that's one way to do that right uh anyway so I suppose I could just make um this thing I think half was all right I think half was all right to be able to see like how it goes um maybe not even half maybe two thirds how about two-thirds right so multiply by two but divide by three two thirds could be like a cool Middle Ground yeah that's that's a good middle ground in my opinion I think that's pretty promised uh all right so and uh where are we going to render the um um the cost function right so with the cost function what we need to do right so we need to have um we need to store the samples of the cost functions somewhere right so we need to periodically just check what's the current cost and we need to add it to some sort of array uh right so maybe I'm going to introduce like a dynamic array it's definitely going to be dynamic rate right so cost plot right and we're going to have items which are floats right so here we're going to have a count and here we have we're going to have a capacity right and essentially um periodically periodically if I is divided by 10 equal to 0. instead of printing that cost we're going to be appending that goes to the plot right so we can do the I append uh maybe we're going to have like a plot and we just literally add this entire thing to the plot and that's it right and then where when we are rendering this entire stuff um are we going to be taking that plot and we're going to be just like literally rendering it that's that's a basically uh we'll see how it goes we'll see how it goes okay so here is an interesting thing so another render really uh it cleans the entire background but since it's just a small sort of like a sub widget I think it should not be responsible for cleaning the entire background it should be done outside somewhere here right like so foreign so and uh probably I want to do something like a cost uh like a render maybe plot uh cost right and then here uh I could specify the plot right and I probably need to put it somewhere here right of course plot plot zero right so it's gonna be like that and uh here we'll have to specify uh the region within which we want to render this entire thing right so I suppose we can do a similar thing all right we can do s will need to re-initialize this stuff right so what I'm thinking is that in terms of width it's going to be half of the width in terms of heights let's keep the the same height but the difference here is that it's going to be aligned uh from the left right so on the left we're going to have a cost function on the right we're going to have uh the the neural network so maybe it would be even better to actually swap these things around and to be able to easily swap them around I think I'm gonna do something like this int RW or H or x r y there we go so that way I have this sort of components right that they can swap around and stuff like that and everything um okay so let's Implement a plot cost all right so let's see where we can put this entire stuff so this is gonna be just cost plot and this is gonna be just a bunch of integers so for now um just to see that it's working right I'm gonna just draw a rectangle right and draw like a red rectangle just to see where it's going to be located draw a rectangle so it accepts everything I want I want to see H red and let's try to run this entire thing so plot unused variable background color okay so background color is not particularly neat uh right because we moved this stuff outside so let's put it here uh plot is unused okay so that's that's cool so this is where we're going to have a plot right so this is where we have the neural network so and the left widget this is where we're going to have all of that so the pattern comes from the fact that we're taking two thirds of the height I think is this two-thirds this looks like two-thirds I guess I guess it is right so if you add up this padding and this padding it actually adds up to a third of the height of the screen so that kind of makes sense right who needs CSS chat right who needs CSS like it's actually way easier to do whatever you want without CSS because it doesn't stay on your way am I the only one am I crazy by the way I find it easier to come up with the very flexible layouts if I don't have this CSS craziness and I'm just allowed to place things uh like in absolute values right another loan okay that's cool right if you can if you just have variables and you place all of the elements in absolute terms you can quite easily come up with very flexible layouts like it's just like yeah centering is just you take half of the screen half of the size of the element and you subtract one thing from another and magically it's centered without any of this freaking with centered left right like why you take one half and subtract another half it's a simple arithmetical operations anyone can do that even desires I mean I've met actually very smart uh designers that know like geometry and Mathematics quite well so just this way still use tables and you can also emulate like simulate tables sometimes I feel maybe it's because I'm a c programmer and it's just like if you if you know how to use the hammer right everything looks like a nail I don't know but I find like Define things like that easier [Music] I would accept this called CSS but nothing ever worked yeah it's really difficult to do anything since anyways all right so how are we going to be floating this into a stiff okay we're going to be plating this simple stuff um so one of the things we can do we can find the maximum right so um because we want to be able to fit this entire thing somewhere right like in in width and height um so let's find the maximum float uh post plot um float Max so and it has to be the the minimum value right the minimum is there something FLT mean right so that's probably what we want to do uh so four CSS is difficult even for the brows yeah I can imagine that actually uh let's see what you're talking about so if Max is less than plot items I what we do is just say okay it's equal to this thing now and we just have to return next and go so okay uh we need to have the maximum value of cost plot Max is kind of meh to do that on each plot course but we're not trying to write the most optimal code ever right so I don't really care that much in my opinion all right and essentially now uh do we also want to have like a memo I think minimum is also very important right so uh we can do that in one go uh let's do min max all right so it's gonna be new this is going to be Max and right so let's do min a 14 Max Max at the team rights and meaning I'm gonna do the phone thing Min if it's greater I'm going to sell it and here we don't have to return anything so it means here you're gonna have min max and then cross plot Max plot min uh Max who needs multiple return values am I right um all right so Min and Max so that means we can already do quite a cool shite quite a cool shite and it's essentially yeah let's iterate through all of these things right so iterate through all the samples what by the way I just want to like compile this into everything yeah FLT Max and FLT Min are another thing but I don't remember I probably might have to include limits if I'm interested uh see float oh there is also float I'll see okay um yeah boy yeah boy okay that's cool okay all right pretty epic I'm not gonna lie not gonna like um [Music] um so zero less than plot count um so okay in terms of why it's rather easy to determine how it's going to look like right so essentially uh is essentially we have a plot items so this is I and we kind of subtract the minimum out of that and it gives us this sort of value all right and what we need to do we need to divide it by maximum minus the minimum right by the distance and what we get is actually a value from 0 to 1 right it's a value from zero to one so if we multiply it by the height we get the value somewhere on the height of the widgets right but it's not going to be offset properly so another thing we have to do we'll have to do r y plus and that gives us y uh precisely on the widget itself so they are the only thing we need to do we need to figure out X so the bigger the I the bigger the eye the bigger the X the bigger the I the bigger the X the bigger the I the bigger the X so that means it depends on I right what we can do we can take the width and I think it has to be converted to float and we want to divide it by the plot count right and then multiply by I that's freaking it so the next thing we can then try to do once we've got X and Y we can just plot the points right so it would be nice to connect them with lines but I'm going to just draw circles on you know on on the place of them right how we're going to draw this circle uh so I don't remember so it's a center so this is going to be X and Y and the radius is going to be dependent on RH we'll really learn that and let's actually make it as small as the width of the weight right so zero zero four essentially and the color let's actually pick color red because why not so I think red is fine and that should give us the plot cost is It Isn't that cool I think that's pretty cool something dangerous or X is not used yeah thank you that's very important okay are we good our Gucci are with tamaguchi huh that's actually all right the question is why is it growing huh what I'm thinking chat is that the height weight is it ah are the wise inverted wait a second I I need to check the chat this is very important draw a circle is that is this one of these libraries that put zero at left bottom all right so zero zero one hundred show me what you've got no okay so am I I might need it I think I'm gonna use it because initially why so initially it has to be rather big isn't it I'm pretty sure okay so let's maybe connect that with lines right so let's connect that with lines and see how is it going a draw line draw line [Music] so we're gonna put it in here but that only makes sense actually if uh one [Music] if y plus one is less so here is the thing I suppose we need to do something like minus one to make sure or maybe even I plus one right because we're talking about like um unsigned integers and stuff like that uh right so this is going to get um this is going to be next two this one is going to be plus one and this one plus one so X1 uh y1 X2 YT and uh the color is red maybe we can even do something like this the thickness is our H multiplied by zero zero four like so semicolon what else do you want uh expected for draw X line ah this freaking okay so Vector two maybe there's some Constructors all right uh yeah I need to yeah I can see why I need to invert to why now okay so that makes sense actually so let's go ahead and try to invert wine so but we can invert actually the one right so this value is from zero to one right so we can just do something like this uh easy peasy lemon squeezing all right so that should actually work now basically yo you'll be kind enough to nice to also provide some sort of a reference point I don't know because it's not clear where is the yeah it's kind of cool that it's just like a jumps all right so we also take the steps of like 10 but maybe this is not what we should do all right what if we like take each individual thing in here is it gonna be faster yo it's kind of interesting how it learns in jumps you know what I mean it learns the interns in these jumps right it's sort of like a energy levels right so the influence it's actually kind of cool right and it doesn't really improve that much overall anymore right okay so um let me let me see so maybe I could make it a bit thicker right this entire thing cost plot uh plot so in terms of thickness we can say so the bigger the value in here yeah so let's actually make it zero zero five can I make the window resizable that's a good question I kind of want to make it recyclable so that I can just resize and see how it changes and stuff like that so there is an init window right let me see if I can do anything about that I need window uh huh about the resize is window resized set window I suppose we can set window state right platform set a window configuration set using Flags Okay so it doesn't what kind of flags do I have yeah I can set window signs or resign his window is sized okay so I think I need to Google that array leap resizable window resizable windows so people discuss that on Reddit I found flag a resizable window mentioned over here okay good so 2016. I just edit new flex thank you race and five I really appreciate that set I suppose set Windows State can I get Windows state because I know What if I um what if I set the flags and I reset some other things okay I should just go ahead and try that let's set Windows state and what was the flag um yeah there are literally Flags so I'm not sure how good of an idea that is but we'll see mm-hmm no I can't resize this I still can't resize it doesn't change I don't know how to make it recyclable um web slow these Woodies do I have to do that before I create the window so that's very interesting question maybe that's what I have to do because the code in the source code can you applies nah no no no no no set window resizable it doesn't work I don't know why and I'm sure if I hear uh I basically implemented everything I wanted to implement right um almost almost so it would be kind of nice to maybe use zero as the minimum you know what I mean uh so I'm gonna just overwrite minimal to zero and let's see how it goes right I think yeah I think because that's yeah that's better I'm just a little bit afraid so how are we gonna handle the situations when it go goes below with zero it's actually super easy if less than zero actually if it's greater than zero it becomes zero that's it so essentially the if it ever goes below uh we're gonna leave it as it is but if it's higher uh we're gonna still snap it to zero so that's basically released um that's basically this set config Flex okay I'll take a look at that config for us right so that's much better so you can see how these entire things sort of like um getting smaller and smaller it will be also kind of cool to have the initial limit for X if you know what I mean right so we can do something similar for from for x so this is minimum for x and we divide this entire thing by count but essentially we have this sort of n or right if you know what I mean all right M and we can say all right so if n less than 100 that means it's going to be 100. right if it's bigger uh we're gonna let it be bigger right so that way uh we're gonna have a very interesting effect in here um yeah Isn't that cool we can even make it I don't know uh 1000. that's even cooler I think please tell me that it's cool look at that so [Music] um yeah I'm gonna do this has to be a thousands so we can see how the neural network is learning so this is its cost function we also can add some sort of a grid we can also add some sort of a grid so we can see how all of that so there's a lot of things you can improve in here you can keep improving and improving and yeah so this is something that I noticed with a lot of models when I was like experimenting with this kind of stuff that they jump very quickly at the beginning and then once they sort of figured out their configuration they're doing like a very small optimizations to this configuration you know what I mean it's kind of an interesting effect that if you've never done that you would ever expect so it sort of like goes through these energy levels right and then it finds the configuration then it smoothes out in something like that that's something interesting right like why is it doing that like why like what makes it do this kind of jumps this is very interesting right hmm um so okay and it just keeps improving and stuff like that it's really cool that we can also see that um so let me let me see so somebody suggested that we need to set config Flags so let me take a look at what that is serve config Flags uh all right set initial configuration for Sif view Flags okay I suppose do I just have to set that thing there in it window all right is that what I have to do okay that's cool all right so now how can I get the size of the window get window size so I can get window position but I can't get Windows size [Music] the jumps are mainly related to the learning step yeah maybe we can actually make half of the learning step right so in C if it's going to make any difference so this is a half of different step this the jumps are smoother anyway but there still exist so I made like a half of this step the original step but they still exists oh you have to get the width and height of the windows separately oh Jesus Christ the consistency of this API is a top notch but by the way I'm not this in this Library by the way right so I think this library is very cool let me get it out of the way this library is pretty cool so it's just like me being grumpy when I'm working right so when I'm working and doing an actual that actually works it gets my brain in a very specific state where I'm very critical about literally everything right so that's why it may feel because people see me only in that mode right so people see me only in that mode and they assume that I'm very grumpy very angry person in reality I'm not actually uh right so it's just like when I'm working and actually need to get something working I get in this very like state where where I'm critical of everything and it may look like I'm very grumpy and angry but it's just like it's a part of my process right uh it's a part of my process um [Music] okay so let me let me see uh get the window cute window weeks get screen width but does it give me a get current I suppose it render width right get window I suppose it has to be get render of it it must be content of it okay so I'm gonna assume that it's good to get a render widths I will assume that this function caches all these values so I can call it as many times as you want because I'm too lazy to catch it myself okay so yeah that's cool so as you can see it adapts now very adaptive thinking um all right we can even make a cost plot Maybe a ring right how is it called ring buffer so it basically removes the old things but it's actually very important you kind of want to see the whole path anyway I didn't think removing that stuff is a good idea actually yeah I don't think so so it's better to actually see like clearly everything is way better to see everything well we know everything um so that's pretty cool so we can now also try to test other neural network which is zor and it's way simpler but it will be able to show us still some process yep so is it gonna do another jump I'm pretty sure it's going to do another jump at some point it's going for a jump it's going for a jump it's gonna make it I'm pretty sure it notes it's okay it doesn't really uh it's kind of doing a jump hmm okay cool so and as far as I know by the way you also have a text don't you so we can render some like some additional information about what the is going on so we can replace I with a poke um and then I and just like print the actual Epic um is that how I pronounce that word I'm pretty sure so let me do something like maybe yeah it's kind of annoying damn h uge height there we go so that's what we have and uh in here we can do something like uh array lib draw text that's image draw text just draw text and it requires like the actual uh string so I suppose oh okay I put an accent on o because this is how we um we put accent in Russian language so in Russian language it's called epocha so we put accent on o um and that's like just what my brain used to do so I really project okay so let's actually have some sort of a buffer so this is going to be something like this and we can do a Sim printf uh ebook same in German okay so we're gonna put uh I suppose z u in here and um foreign so we probably have to specify the buffer right so we specify the buffer and the size of the buffer uh all right so what we're gonna put that uh suppose in terms of X it's going to be zero and in terms of Y uh let's let's also make it a zero so in terms of font it's going to be interesting I think it should depend on the size of the window right so uh we can say it's going to be maybe something like this right so in terms of the color let's make it white so and let's see how it's gonna go um so the fact that we can draw text is actually that's a very huge ass EPO so let's make it smaller maybe even this small yeah that's better that's actually very cool it's really funny how it's just like so we can see some another thing I would like to do is probably some sort of a grid if you know what I mean right some sort of agreed would have been actually super useful um yeah but they're already streaming for almost four hours but so all the necessary information is available in here we can even do uh something like out of the max so all right Max size two Max and we can put them here here then we can just do um yeah so as you can see it even says like how many are we gonna do and how quick is it moving so it's limited by the FPS as we already discussed it's limited by the fps to make it not limited by the FPS I would like to actually run the learning process in the separate thread so that will require uh you know doing piece rise and stuff like that but overall that's kind of cool and we can provide more information in here in fact uh we can say rate all right and here we can pick the rate maybe a rate and the maximum amount of epochs could be configured somehow [Music] um you can run multiple learning iterations per frame yeah true maybe that will be faster um so for example I know less than like 10 right and it would be also kind of nice to maybe do something like this so let's actually run 10. yeah that's a good idea so 10 learn integration that's actually way faster what the yeah that's a good idea thank you and we're done learning so it's pretty cool that was way faster so let's try the adder now yeah that learns even even faster when it iterates faster I think it's more spectacular in terms of like if you look at the right all right I think it's more spectacular it would be kind of cool to also handle like R and restart this entire thing without liquid compilation but I mean I can just restart the application like so that's so cool oh right so awesome I love it this is actually a very cool tool right this gym thingy it's actually really cool yo that's awesome what the top um yeah all right so now we have a gym uh so I'm gonna clean it up off screen a little bit right and then I'm gonna like post the cleaned version to on the source code on GitHub so we'll be able to read one then so yeah that's really cool so it would be kind of cool to actually do everything from that single application and then just dump the neural network and then you would use an m.h to sort of deploy and integrate the neural network that you trained into your application right so but yeah that's the result of today's stream like this is literally what we do within like today's stream thank you so much the creator of the array leap for such a beautiful Library I think their name their nickname is Ray sen5 thank you thank you so much it's actually really cool I kind of like this Library better than this deal honestly I think like I think it's better than this you know like it was super easy to build completely from scratch by the way all right so just like install it and use it and uh it does way more than SEO as far as I know it even allows you to Define your own shaders right so but if I remember correctly it doesn't really abstract shaders away so you you have to be aware of the back end it's currently using to come up with the correct shaders but maybe it does something for that I'm not quite sure uh so yeah cow the Highlight this is like yo so freaking cool and then they refine all right so I guess that's it for today thanks everyone who's watching me right now I really appreciate it have a good one and I see you all on next version I love you [Music] foreign
Info
Channel: Tsoding Daily
Views: 50,001
Rating: undefined out of 5
Keywords:
Id: Sz-lXj0Ha6E
Channel Id: undefined
Length: 211min 58sec (12718 seconds)
Published: Thu May 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.