Nick Tech
Nick Tech
  • Видео 19
  • Просмотров 30 345
C++ GUI Tutorial: Zooming into Fractals with SFML
Learn how to create a C++ app with a graphical interface for zooming into the Mandelbrot Set using SFML.
👨‍💻 CODE: github.com/Skripkon/MandelbrotSet
0:00 Intro
0:29 Class MandelbrotSet
1:40 Set up SFML library
2:26 Graphical interface
5:41 Run()
6:31 HandleEvent()
11:32 Outro
#cpp #cplusplus #programming #guiapp #coding #math #fractals #fractal #mathematics
Просмотров: 1 153

Видео

Math and Programming Behind Fractals
Просмотров 7793 месяца назад
What are fractals, where are they applied, and how to create one using C (or any other language). Timelines: 0:00 Intro 0:07 What are fractals 0:30 Practical applications of fractals 0:58 What is the Mandelbrot set (math) 3:58 Programming the Mandelbrot set in C 8:42 How to implement zooming #fractals #maths #cpp #cplusplus #programming #mathematics #coding #fractalanimation #fractal #math
Monte Carlo Simulation (math + programming)
Просмотров 2,6 тыс.3 месяца назад
Learn about the Monte Carlo method and how to apply it to various applications such as poker, calculating Pi, and predicting stock prices. Explore the mathematical concepts behind Monte Carlo simulations and gain insights into programming techniques for practical implementation. Timelines: 0:00 Intro 0:10 What is Monte Carlo simulation? 0:48 Monte Carlo simulation in Poker 1:40 Calculating Pi u...
JavaScript is weird
Просмотров 1,9 тыс.3 месяца назад
Watch strange behavior in JavaScript for 110 seconds straight. #javascript #javascripttutorial #programming #coding
How to Run a PyTorch Model in the Browser
Просмотров 5143 месяца назад
Learn how to run a PyTorch model in the browser (serverless app) and how to deploy it for free on GitHub Pages. ⚔️ Play against a chess engine: setday.github.io/chess-engine-online/ 👨‍💻 Website repo: github.com/setday/chess-engine-online ♟️ How to build a chess engine: ruclips.net/video/-WDRaRUjRMg/видео.htmlsi=MrWtWaKStjTX6OgW Timelines: 0:00 Intro 0:38 Convert a model 1:28 Load a model in JS ...
How to Create a Chess Engine with PyTorch (Python)
Просмотров 5 тыс.3 месяца назад
🐍 Learn how to parse chess data, and train a neural network using PyTorch. ⚔️ Watch as I play a game against the trained model. 👨‍💻 CODE: github.com/Skripkon/chess-engine 1️⃣ First part: ruclips.net/video/v3jMr0Ppd9Y/видео.htmlsi=OGMIDFiX7asV1-Mg Timelines: 00:00 Intro 00:34 why PyTorch? 00:58 parsing data 01:52 preprocessing data 04:20 class ChessDataset 05:04 class ChessModel 07:37 training l...
How to Create a Chess Engine with TensorFlow (Python)
Просмотров 6 тыс.3 месяца назад
🐍 Learn how to find a dataset, parse it, and train a neural network using TensorFlow. ⚔️ Watch as I play a game against the trained model. 👨‍💻 CODE: github.com/Skripkon/chess-engine ♫ Want to explore more TensorFlow projects? Check out how to generate music: ruclips.net/video/cuRjPSmheCg/видео.htmlsi=zRKXLl-YDUM-pvV2 Timelines: 00:00 Intro 00:20 Dataset and preprocessing 02:51 Training the neur...
Host Python Web Apps FOR FREE (Flask, Django, FastAPI)
Просмотров 1,5 тыс.7 месяцев назад
Do you have a Django, Flask, FastAPI ot other web app? Then this video is for you. I'll show you how to deploy your app for free! 👨‍💻 CODE: github.com/Skripkon/RESO 👨🏻‍💻 Timelines: 00:00 Intro 00:20 Render.com 01:11 Docker 02:00 Test website 02:23 Music example #deployment #fastapi #flask #django #python #pythontutorial #pythoncode #coding #webdevelopment #css #html #javascript #hosting #webdev
Modern Web Development with Python
Просмотров 1,4 тыс.8 месяцев назад
This is the first video on FastAPI. You will learn about a modern approach to web development and how to build your first app! Follow my channel to see more! #python #flask #django #fastapi #pythontutorial #programming #webdevelopment Timeline: 00:00 web frameworks 01:11 FastAPI 01:46 lib overview 02:52 code 06:03 outro
School Math Behind One Machine Learning Task
Просмотров 1,1 тыс.9 месяцев назад
How to tackle a classification task using a linear model when dealing with circular data? Find the answer in this video. Timelines: 00:00 intro 00:28 school math 01:27 circle to rectangle #machinelearning #datascience #mathematics #math #programming #linearregression #supportvectormachine
How to generate 🎹 music with ChatGPT 3.5
Просмотров 4549 месяцев назад
In this video I'll show you how to generate piano music using ChatGPT and Python. 👨‍💻 Code: github.com/Skripkon/gpt-piano-composer Timelines: 00:00 intro 00:08 plan 00:25 MIDI 00:47 prompt 01:06 coding 02:50 warning 03:17 example 1 03:51 example 2 04:07 EXAMPLE 3 !!!! #python #pythontutorial #pythonforbeginners #chatgpt #chatgpt3 #gpt #gpt3 #music21 #programming #aimusic #aimusicgenerator
AI creates music? Let's build one.
Просмотров 7309 месяцев назад
👨‍💻CODE: github.com/Skripkon/piano-music-composer In this video I'll show you how to build an LSTM based model to generate piano music. 00:00 intro 00:08 plan 00:31 libs 00:46 collecting data 01:19 preprocessing 04:48 LSTM model 06:01 generating a song 08:08 example 1 08:37 example 2 08:57 EXAMPLE 3 09:22 example 4 10:11 example 5 11:16 example 6 #deeplearning #ai #aimusic #aimusicgenerator #py...
LSTM for beginners - Python Tutorial (Tensorflow, Keras)
Просмотров 1,5 тыс.9 месяцев назад
Code: github.com/Skripkon/time-series-forecasting-with-lstm In this video I’ll show how to use an LSTM for solving a Time Series Forecasting Problem. Timelines: 00:00 intro 00:15 what it can do 00:50 code 01:16 read_csv() 01:48 preprocessing 02:48 training the model 04:27 predictions 04:50 visualization 05:03 future predictions 05:43 outro #python #keras #tensorflow #machinelearning #pythonforb...
Piano Music Generator in Python (CODE INCLUDED)
Просмотров 1 тыс.10 месяцев назад
Piano Music Generator in Python (CODE INCLUDED)
Advanced features in Music21
Просмотров 25810 месяцев назад
Advanced features in Music21
Introduction to Music21
Просмотров 29410 месяцев назад
Introduction to Music21
Time Series Forecasting with CatBoost - Python Tutorial
Просмотров 1,7 тыс.10 месяцев назад
Time Series Forecasting with CatBoost - Python Tutorial

Комментарии

  • @bozgi
    @bozgi 23 дня назад

    unfathomably underrated video

  • @arrow_function
    @arrow_function 24 дня назад

    `typeof null // 'object'` is not an errror. It is an object with no structure. Read the specification 🥰

  • @evildonuts9995
    @evildonuts9995 Месяц назад

    The problem is the sample size of your dataset, its wayyy too small. It learns the openings and part of the middlegame almost by heart but then generalizes very poorly once its out of book. A general rule of thumb is 1m positions per hidden layer node, and thats just for nnue and not a policy net as you are trying to train. The community around Leela Chess Zero should be able to help you with those kind of chess bots :)

  • @lukke7148
    @lukke7148 Месяц назад

    Interesting! I am also making my own chess engine at the moment and am shocked to see what is similar and different in our approaches. I believe I have some stuff that might make your model better. First off, the 13th channel in your input data might really confuse the model considering it only contains data about where pieces can move TO, not WHICH piece can do that and from where. Instead, you should have the 13th channel completely filled with 1s or 0s based on what side it is playing (since right now it has to also predict if it is playing black or white). Not directly telling the model which side it is playing IS THE REASON why it was previously prone to making many illegal moves since it could not train well (I did the same mistake of having 12 channels also). Sure, it might still want to make illegal moves sometimes, but instead of doing a legal check for each input board position, you can check if the predicted move is legal, and if it is not, choose the next best-predicted move. I saw you made a comment about a 14th dimension, and even though I can buy your reasoning, I do not believe this is the most effective strategy considering the model will have to make many extra predictions along the way when many FROM squares are filled and many TO squares are filled. Also during training, opening moves are irrelevant considering many of them are interchangeable. Your model will be punished by choosing one opening over another, which is not fair. I was shocked to see that even though my model never trained on opening moves, it could still predict near-perfect theory when getting better at the game as a whole. It also reached better precision after training without opening moves because it was not unfairly punished. Another big tip is using batch normalization after each convolutional layer. It might make the training process much slower, but each part of the training gets much more efficient, resulting in a much higher precision after the same amount of epochs. For example, my model took about 7000 games of training to reach 2% accuracy without batch normalization and after implementation, it was reached already after 500 games.

    • @_NickTech
      @_NickTech Месяц назад

      Hey! I love your tips, especially the one about openings-it's truly shocking! You're right-legal check is indeed algorithmically inefficient in my implementation. And telling the model which side it's playing sounds so logical! However, I still think it should have an extra channel indicating which pieces it can move (this should be tested in an experiment). Though I agree, telling WHERE it can move them is really ambiguous. By the way, accuracy doesn't seem like a reasonable metric here (I understand it's easier to compute). I would suggest Top-3 or Top-5 Accuracy, since sometimes there can be up to even 10 decent moves

    • @lukke7148
      @lukke7148 Месяц назад

      @@_NickTech Yes, you could absolutely be right about the extra channel, but maybe one could create some system to embed more information inside it instead of using only 1s and 0s? For example some kind of embedding to make it possible for the model to understand exactly which piece can move to some specific square. It would be really interesting to see how these kinds of inputs change the outcome of the model, especially if it is a solution you come up with by yourself! And yes, you are completely right about the accuracy, it is a super good tip and something I will implement now! Looking forward to the reinforcement 😉

  • @david-oruna
    @david-oruna 2 месяца назад

    I'm currently also making a chess engine but with js, and now that I've seen that is possible to use neural networks I think I might change to python haha

    • @magix6638
      @magix6638 Месяц назад

      I think js has some AI packages

    • @david-oruna
      @david-oruna Месяц назад

      @@magix6638 I ended up using a compiled stockfish to js, chessboard.js and chess.js, it is a much straightforward approach

  • @fyve2806
    @fyve2806 2 месяца назад

    For I now, I still don't how to get all the codes from GitHub to the code writing software (maybe I'll use the default one on Windows).

  • @Vedranation
    @Vedranation 2 месяца назад

    What you can do to improve it is follow DeepMind's approach. You trained your supervised model and its pretty decent, It could probably beat any 900 elo player. What you wanna do now is take the model and chuck it into reinforcement learning to roughen up the endgame edges. I believe early game is strong because early game is consistent in training data, but no 2 end games are the same so it's lacking in training material there. I feel reinforcement learning here would greatly improve it.

  • @Vedranation
    @Vedranation 2 месяца назад

    thats crazyyyy!

  • @rollercoasterhd
    @rollercoasterhd 2 месяца назад

    Great Video! But may I suggest, that you could use a fragment (pixel) shader to increase the rendering speed of the fractal?

  • @Carlo-zs5lw
    @Carlo-zs5lw 2 месяца назад

    Very interesting video man, detailed explanation👍 do you code in processing as well?

    • @_NickTech
      @_NickTech 2 месяца назад

      Thanks for the kind words! 😊 I haven’t coded in Processing before

  • @_NickTech
    @_NickTech 2 месяца назад

    I had to render the video with some loss in quality and sound due to my editing tool crashing. I hope it's still bearable. Sorry about that! It will be better in the next videos 👨‍💻 CODE: github.com/Skripkon/MandelbrotSet

  • @_NickTech
    @_NickTech 3 месяца назад

    code: github.com/Skripkon/MandelbrotSet First part: ruclips.net/video/KPTZsSQ8DcE/видео.htmlsi=8M89zovnQ9cgbMOy Second part: ruclips.net/video/aSPB0Ftv-2A/видео.htmlsi=A-d-AmbGbqLcViwK

  • @below8
    @below8 3 месяца назад

    Super video! Amazing. Waiting for the next video of zooming areas logic!

  • @absolute-narwhal
    @absolute-narwhal 3 месяца назад

    this is super underrated bro, well done

    • @_NickTech
      @_NickTech 3 месяца назад

      Thanks! I appreciate it!

  • @juliansantos1900
    @juliansantos1900 3 месяца назад

    the issue of zooming in is being very close to the binary floating point limitation

    • @_NickTech
      @_NickTech 3 месяца назад

      You got it right! Though no one forbids using arbitrary-precision arithmetic

  • @AyoubBenYedder-c4x
    @AyoubBenYedder-c4x 3 месяца назад

    Very informative and entertaining, i enjoyed it very much!

    • @_NickTech
      @_NickTech 3 месяца назад

      Glad to hear it! Thank you for watching!

  • @_NickTech
    @_NickTech 3 месяца назад

    second part (zooming): ruclips.net/video/aSPB0Ftv-2A/видео.html

  • @Neo-137
    @Neo-137 3 месяца назад

    i didnt get the action space part as ı understand your action space is the number of unique moves in the dataset, and ı think it leads to the model cant choose any other move that is not in the data set. The move index in the action space depends on the data as well. you can use alpha zeros action representation 56 queen moves (8 direction 7 max length) 8 knight moves and 9 underpromotion(3 pieces 3 direction) for 8*8 board in the and u have 73*8*8 matrix after flattening 4672 length action space.

    • @_NickTech
      @_NickTech 3 месяца назад

      Hey, you got it correctly! However, when the dataset is quite large, the probability that there won't be a needed move is really low (unless you start playing 'exotic' chess). You can plot a graph of the number of unique moves versus the number of parsed games. The convergence to the asymptote is good. But sure, you can create an action space that includes all possible moves

  • @ВадимПоляков-т4ш
    @ВадимПоляков-т4ш 3 месяца назад

    Бля, ахуенный монтаж. Шикарное видео!! Продолжай!!

  • @MrCustomabstract
    @MrCustomabstract 3 месяца назад

    Comment for algo

  • @minh3485
    @minh3485 3 месяца назад

    Great video, I would love to see more simulation C++ contents in the future.

  • @Tocharianne
    @Tocharianne 3 месяца назад

    Nice, concise video. Thank you for not having unnecessary background music.

    • @_NickTech
      @_NickTech 3 месяца назад

      Thank you for watching.

  • @teamfoxear
    @teamfoxear 3 месяца назад

    weak model I train with 10k games but still cant play decent moves.

  • @wyndmill
    @wyndmill 3 месяца назад

    javascript is a totally normal language that makes perfect sense

  • @techworld3255
    @techworld3255 3 месяца назад

    We have Fireship at home Fireship at home:

  • @bjni
    @bjni 3 месяца назад

    yeah im good I will stick to golang

  • @AmirparsaDD
    @AmirparsaDD 3 месяца назад

    this video format makes me remember how humans invented [fire] and decided to [ship] it to prodution

  • @ahmoin
    @ahmoin 3 месяца назад

    0:10 you're supposed to use the strict equality operator according to google typescript style guide "Always use triple equals (===) and not equals (!==). The double equality operators cause error prone type coercions that are hard to understand and slower to implement for JavaScript Virtual Machines."

    • @_NickTech
      @_NickTech 3 месяца назад

      Then the result will obviously be false (due to the type check), and the example will be obscure. By the way, it's a matter of coding style, though === is preferred by the majority (and for good reason)

    • @ahmoin
      @ahmoin 3 месяца назад

      @@_NickTech yes i said === is preferred by googles typescript style guide

  • @SeresHotes25
    @SeresHotes25 3 месяца назад

    I like your content! I don't understand why there're so many hate comments :(

    • @_NickTech
      @_NickTech 3 месяца назад

      I appreciate your kind words, thank you!

  • @hamzagohar2048
    @hamzagohar2048 3 месяца назад

    I like the video but i think you should work on your accent a bit its too thick

    • @_NickTech
      @_NickTech 3 месяца назад

      Thank you for your support! I'm actively working on improving my speech. Hopefully, it'll be easier to follow me in the future

    • @bee_irl
      @bee_irl 3 месяца назад

      i didn't mind the accent, i could understand everything and it's not annoying to me:) you know what _is_ annoying? javascr

    • @nothappyz
      @nothappyz 3 месяца назад

      ​@@_NickTech please don't change your accent just for these people. Accents are normal they're just mad you don't have an american accent like it's the only one there

    • @jdudbdjxb7687
      @jdudbdjxb7687 3 месяца назад

      I mean I see what you mean but it's not hard to understand Even as an American, I can make out everything

  • @zoki5388
    @zoki5388 3 месяца назад

    as someone who is beginner with python but I would like to play around with object detection in video game, which libraries you would recommend me to look at?

    • @_NickTech
      @_NickTech 3 месяца назад

      Hey, OpenCV, TensorFlow, PyTorch, YOLO, Detectron2 are good options. OpenCV is known for its simplicity and ease of use, so I would recommend to start with it

  • @_NickTech
    @_NickTech 3 месяца назад

    What do you like (or hate) the most about JavaScript? BTW, this video didn't mean to discourage you from learning it 😅

    • @alwinsebastian7499
      @alwinsebastian7499 3 месяца назад

      i love javascript because it put food on the table. and i dont really hate it.may be a little, for being weird.

  • @YihyunML
    @YihyunML 3 месяца назад

    In future save the tensor data to a file and read it in chunks for training so you can train on a larger dataset without memory issues

    • @_NickTech
      @_NickTech 3 месяца назад

      Sure! Thank you for advising

  • @robertomartins8085
    @robertomartins8085 3 месяца назад

    That is an awesome video! I have two main questions: 1. Why did you shuffle the dataset, since the games itself might be considered as a series of moves through time (though one game has nothing to do with the other). 2. Why did you choose CNN, I understand that you could frame the input as an image, but it would be fun to see the difference to a regular MLP. Also I've played against your bot and it seems to be very solid (congrats) it also made the same blunder as it did when playing against you (giving away the rook with a check) - since the bot is actually learning from moves (and there are 10^120) and most games have early and midgames but not so many late games, it may seem that the use of a evaluation calculation might be needed (hence Reinforcement Learning)

    • @_NickTech
      @_NickTech 3 месяца назад

      Hey, thanks for your comment! 😊 The dataset includes sequential moves where each move depends on previous states. Shuffling helps prevent the model from learning sequential dependencies that do not generalize well to new games. Otherwise, it might only learn specific openings, for example. Shuffling ensures that the model sees a variety of positions in each batch, which is beneficial for learning. Using an MLP for this task is interesting, but I doubt it would catch any patterns as effectively as a CNN. CNNs seem logical to me for this kind of data. And yes, you are right: evaluation calculation is not only needed but essential! For the CNN model, there is no difference between a blunder and a brilliant move. Only evaluation can solve that problem. Regarding endgames, there is one obvious issue: there are so many possible positions. Openings are relatively standard: develop pieces, control the center, and castle your king. Middlegames are trickier, but endgames are extraordinarily varied! There are no clear patterns in them

  • @ponmuthu..4796
    @ponmuthu..4796 3 месяца назад

    try using re-enforcement learning

    • @_NickTech
      @_NickTech 3 месяца назад

      it's on my TODO list, though I've been told that convergence will be poor. We'll see

    • @ponmuthu..4796
      @ponmuthu..4796 3 месяца назад

      @@_NickTech why pytorch one is considerably better even with same architecture can you explain? How much ram ,vram does it used,also have you use multiprocessing

    • @_NickTech
      @_NickTech 3 месяца назад

      You mean in comparison with the TF model from my other video? If so, the architecture is different: I changed the input (there were 12 channels; I added one more). If you apply that change to the TF model, then you will get a similar result. Though PyTorch has a more efficient memory management system (for example, it uses a dynamic computation graph rather than a static one like in TF), which allowed me to train a model using more data. I didn't use multiprocessing, though you can easily add it to the data loading by specifying *num_workers*: data_loader = DataLoader(dataset, batch_size, num_workers=4) About RAM: 16-30 GB were in use, depending on how many samples you keep in your dataset.

    • @ponmuthu..4796
      @ponmuthu..4796 3 месяца назад

      @@_NickTech may I create a interface for that(I can use the frontend from by University project with improvements)

    • @_NickTech
      @_NickTech 3 месяца назад

      @@ponmuthu..4796 My friend has already created an interface for it, which I'll cover in the next video: setday.github.io/chess-engine-online/ his github repo: github.com/setday/chess-engine-online But you can create it as well for the sake of practicing :)

  • @ponmuthu..4796
    @ponmuthu..4796 3 месяца назад

    really decent bot, it is better than my pure nural network bot,my bot gives evaluation value to a position as output than negamax

    • @_NickTech
      @_NickTech 3 месяца назад

      Thanks for watching!

  • @tarlkudrick1174
    @tarlkudrick1174 3 месяца назад

    I was hoping you'd show how to build a neural net from scratch. That is, instead of using a pre-made library, start with nothing beyond numpy and pandas, and go from there. My problem with python is that other people have already done most of the work, so all a person really needs to do is download someone else's pre-made set of solutions and learn how to use that solution's commands. I guess what I'd really like to see is how to build a neural net in Assembly or something 🙂

    • @_NickTech
      @_NickTech 3 месяца назад

      Hey, "TensorFlow" is in the title and on the thumbnail 😁. That's a great idea, thank you! I want to do it, though not in assembly, I'm afraid. But in C/C++ with the usage of GSL for linear algebra, I guess

  • @nmxnunezz8214
    @nmxnunezz8214 3 месяца назад

    i have been trying to do this exact same thing for the last month. I took the exact same approach without that 13th dimension and never got good results, its impressive how such a little thing can have such a huge impact. Thanks a lot, great video

    • @_NickTech
      @_NickTech 3 месяца назад

      You can also add a 14th dimension for even better results. The 13th channel shows where you can move pieces, but it doesn't show from which squares you can move them. I've already tried it; the results will be better, though blunders are inevitable, of course. Here is how you can modify the board_to_matrix function to include the 14th dimension (auxiliary_func.py, from line 22): for move in legal_moves: to_square = move.to_square from_square = move.from_square row_to, col_to = divmod(to_square, 8) row_from, col_from = divmod(from_square, 8) matrix[12, row_to, col_to] = 1 matrix[13, row_from, col_from] = 1 And thanks a lot for your comment! I'm glad you liked the video!

    • @nmxnunezz8214
      @nmxnunezz8214 3 месяца назад

      ​@@_NickTech I implemented your idea and something wasnt working so i decided to use your exact same architecture and it worked perfectly fine. Could you please explain how you decided to take that exact architecture? thanks! This was my architecture before: class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.a1 = nn.Conv2d(5, 16, kernel_size=3, padding=1) self.a2 = nn.Conv2d(16, 16, kernel_size=3, padding=1) self.a3 = nn.Conv2d(16, 32, kernel_size=3, stride=2) self.b1 = nn.Conv2d(32, 32, kernel_size=3, padding=1) self.b2 = nn.Conv2d(32, 32, kernel_size=3, padding=1) self.b3 = nn.Conv2d(32, 64, kernel_size=3, stride=2) self.c1 = nn.Conv2d(64, 64, kernel_size=2, padding=1) self.c2 = nn.Conv2d(64, 64, kernel_size=2, padding=1) self.c3 = nn.Conv2d(64, 128, kernel_size=2, stride=2) self.d1 = nn.Conv2d(128, 128, kernel_size=1) self.d2 = nn.Conv2d(128, 128, kernel_size=1) self.d3 = nn.Conv2d(128, 128, kernel_size=1) self.last = nn.Linear(128, 1) def forward(self, x): x = F.relu(self.a1(x)) x = F.relu(self.a2(x)) x = F.relu(self.a3(x)) # 4x4 x = F.relu(self.b1(x)) x = F.relu(self.b2(x)) x = F.relu(self.b3(x)) # 2x2 x = F.relu(self.c1(x)) x = F.relu(self.c2(x)) x = F.relu(self.c3(x)) # 1x128 x = F.relu(self.d1(x)) x = F.relu(self.d2(x)) x = F.relu(self.d3(x)) x = x.view(-1, 128) x = self.last(x) # value output return F.tanh(x)

    • @_NickTech
      @_NickTech 3 месяца назад

      @nmxnunezz8214 hey, I see two major issues: 1. Why nn.Linear(128, 1) at the end? Are you solving a regression task? And why scale the output to the range [-1, 1] with F.tanh(x)? This should be a classification task, not regression. The last layer should be nn.Linear(128, number_of_unique_moves). Then apply softmax to get probabilities. 2. Do you only have 5 channels? Why so few? I inferred this from nn.Conv2d(5, ... ).

  • @ДмитрийВренгер
    @ДмитрийВренгер 3 месяца назад

    Есть какое-то логическое обоснование тому, почему при одинаковых слоях и параметрах модели так по-разному отрабатывают? Или вся разница как раз в 13м канале? Спасибо за видео

    • @_NickTech
      @_NickTech 3 месяца назад

      Yes! You're absolutely right! The 13th channel did all the work here. (I don't remember the precise numbers, but when I trained the TF model with the 13th channel, the convergence and performance were about the same). It's actually logical because this 13th channel indicates some rules of chess, and the correlation with the target is obviously high. I should've mentioned this in the video 😬 Thank you for your comment!

    • @ДмитрийВренгер
      @ДмитрийВренгер 3 месяца назад

      @@_NickTech Thanks for the response. Good luck with your future videos!

  • @_NickTech
    @_NickTech 3 месяца назад

    Play against this engine here: setday.github.io/chess-engine-online/

  • @Alanhallow
    @Alanhallow 3 месяца назад

    Why python, why not any other faster languages?

    • @_NickTech
      @_NickTech 3 месяца назад

      In ML and DL, people usually use Python, unless it's for HFT. Speed was not my primary concern in this project, so coding with Python was much faster and easier. That's it. Typically, drafts are written in Python first and only rewritten in C/C++ if necessary

  • @Andrew_J123
    @Andrew_J123 3 месяца назад

    nice vid!

  • @trevoreguitar
    @trevoreguitar 3 месяца назад

    Hey! ML Engineer here- this was interesting to watch! I have a couple comments for what I partially understand as it relates to chess engines. The biggest issue really isn't within the size of your training dataset. The classification method of your model to determine next moves is a fun application but it suffers (as you saw in the video) from a lack of rules & general understanding of the game. It's incapable of looking ahead, and is attempting? to play a move within some similar pattern in the board representation. This fails due to 1) The absurd size and amount of discrepancies within purely "positional" chess, where "similar to" doesn't really produce good results. The reason chess engines have an evaluation bar "scoring" the moves, is because it is the most effective way to let them "think", as it pertains to the exact position on the board, given a future sequence of moves. An idea (although again, out of my wheelhouse) would be to take every legal move from each position, use some scoring means (there's a really impressive video on youtube about someone creating an engine in C in under 1024 tokens which can conceptualize this task far better than I can), and then performing a regression with the score of the move (you can still use a neural network), using the same board+move pattern. You can even extend this to include all legal moves. If you want it to play "more" like a human than you can probably bias the score within the later segments of the game towards whoever won. You can also batch your training processes & fix the hidden layer sizing to allow more data in. In the final decision of "next-move" (using all legal moves to avoid the error you ran into + the score on each) you could then use your model to adjust the evaluation (of a prebuilt scoring engine), or attempt to drop the initial scoring engine in favor of JUST the neural network's regression-output. I can't say the pure NN method will produce good results though, as chess is a game that requires looking ahead as it evaluates the "current" position.

    • @_NickTech
      @_NickTech 3 месяца назад

      Hey, thank you for such a detailed comment! You are totally right - without knowledge of the game and predicting only the next move, any pure NN method is doomed. I love the idea of solving a regression task with scoring. But to get a score for each move, would you need to use Stockfish or another engine? If so, it seems strange to me: using one engine to build another, esp. which will perform much worse

    • @trevoreguitar
      @trevoreguitar 3 месяца назад

      @@_NickTech I mean it all depends on how you frame it, to me the "scoring" methodology is just as important to the process of Machine Learning as is applying the model type. You can also build any of these "scoring engines" from scratch, with the basic ones using pure addition/subtraction and a recursive loop w/ a depth limit. In the instance of a classification model, it's not scoring but you can create a category of the legal moves being "good", "decent", "bad" to better apply the concept of choose-from-all-legal-moves. A pure NN approach is interesting but yeah it will always be awful considering that it's just sort being fed a garbage-in garbage-out without any means to score each individual move given the board state. If, however, you wanted to do a no-think-ahead engine you could consider the following - generally, a move is "losing" closer to the end of the game. So using the move counter of the game, and that knowledge, you could apply a more-negative score to moves made nearing the end of the game on the side that loses, and inverse for the side that wins. Then just flat apply some metric to the earlier moves to balance the distribution. And then in the instance of a draw, score the moves by the game length to achieve the draw, with a more even-random distribution. There are a million things to try, but ultimately there's a reason that every top engine is "score + neural net" and no flat-neural net classifier has done well (even the 2016 alpha zero taught itself how to score)

    • @_NickTech
      @_NickTech 3 месяца назад

      ​@@trevoreguitar I see what you mean. Thank you for your insights. By the way, an interesting fact: Stockfish neither use scoring nor neural nets when there are <= 7 pieces on the board. Stockfish solves the game perfectly using endgame databases

  • @hariharan-wx9oq
    @hariharan-wx9oq 3 месяца назад

    really cool project!! Thanks man!!

    • @_NickTech
      @_NickTech 3 месяца назад

      Glad you like it! Thanks for kind words!

  • @boukefmohamed3191
    @boukefmohamed3191 3 месяца назад

    Most RUclipsrs use the minimax algorithm, but using neural networks for chess is truly special. You are a legend! I would love to see a video on how we can contribute to an open-source engine like Stockfish.

    • @_NickTech
      @_NickTech 3 месяца назад

      Stockfish can already easily defeat any human, as far as I know 😄 And then there's AlphaZero as well... 😱 Still, it's a nice idea, thank you!

  • @ozymandias8523
    @ozymandias8523 3 месяца назад

    Im gonna come back after I learn python, this is like alchemy to me rn

    • @_NickTech
      @_NickTech 3 месяца назад

      Best of luck to you in learning Python! When you come back, feel free to ask any questions!

  • @aaravasawa
    @aaravasawa 3 месяца назад

    Make this video go viral

  • @aaravasawa
    @aaravasawa 3 месяца назад

    Good one mate

    • @_NickTech
      @_NickTech 3 месяца назад

      Thanks! I appreciate your kind comment!

  • @septspb
    @septspb 3 месяца назад

    Yeahhhh, new video finally!👍 Thnx a lot!

    • @_NickTech
      @_NickTech 3 месяца назад

      Thanks for watching! More content is on the way, so stay tuned! 😊

  • @domergamer2257
    @domergamer2257 3 месяца назад

    Hi Nick! I have no idea about this, but I have a doubt... Is your training model restricted by your RAM memory? Can't it be done in many stages? Is it possible to Plug in two computers in series and get the computation quicker? BTW sweet video! Watched till the end. Keep it coming 🎉❤

    • @_NickTech
      @_NickTech 3 месяца назад

      Hey! Thanks for your support, I appreciate it! ❤ About RAM - yeah, it's a common problem with neural networks, esp. CNNs, because of the size of tensors X and Y. But you can manage it in stages. Just remember, the last layer's size has to match the vocabulary (total number of legal moves in the dataset). This layer must stay fixed-you can't change the NN structure after training. So, start by creating a big array of unique targets (as long as it fits in memory). Once you've fixed the size and set up mappings like int_to_move & move_to_int, you can split X into segments (X_1, X_2, ..., X_n) and train the model iteratively with each segment. It should work fine, but it'll take hours, days, weeks, months... Using multiple computers: Yep, it's possible (called "distributed and parallel training"). TensorFlow and Keras support this approach, though I haven't tried it myself yet (

    • @domergamer2257
      @domergamer2257 3 месяца назад

      @@_NickTech Cool! Thanks for the explanation. I would love to see this project turned into a series...