Creating chess engine, machine learning vs. traditional engine?Chess engine with APIJavascript based Chess...

Can I perform Umrah while on a Saudi Arabian visit e-visa

Is sleeping on the groud in cold weather better than on an air mattress?

What if a quote contains an error

Can I color text by using an image, so that the color isn't flat?

How long could a human survive completely without the immune system?

Iron-age tools, is there a way to extract heavy metals out of a creature?

Is there a magnetic attraction between two parallel electron beams?

Why do previous versions of Debian packages vanish in the package repositories? (highly relevant for version-controlled system configuration)

Would it be easier to colonise a living world or a dead world?

How to find an internship in OR/Optimization?

Canceling a color specification

Had there been instances of national states banning harmful imports before the mid-19th C Opium Wars?

How do lasers measure short distances (<1cm) when electronics are too slow for time-of-flight to work?

What is /dev/null and why can't I use hx on it?

Can I bring alcohol to Dubai?

Can something have more sugar per 100g than the percentage of sugar that's in it?

If LPG gas burners can reach temperatures above 1700 °C, then how do HCA and PAH not develop in extreme amounts during cooking?

Is the text of all UK treaties and laws public?

How to make "acts of patience" exciting?

How to construct the Moore spectrum?

How stable are PID loops really?

A sentient carnivorous species trying to preserve life. How could they find a new food source?

Can a Creature at 0 HP Take Damage?

Why are engines with carburetors hard to start in cold weather?



Creating chess engine, machine learning vs. traditional engine?


Chess engine with APIJavascript based Chess engineCoding chess engineCan anyone explain the motives of this chess engine?Make Arena send last move to chess engineAlternative approaches to chess engine programmingGood apps for engine vs engine matchesChess environments for reinforcement learningGuidance on a new idea for an engine design?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}
.everyonelovesstackoverflow{position:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;}








3















I am both an avid chess player and computer programmer. I would say that playing chess and programming are the two things I spend the most time doing. Naturally, I am wanting to create my own engine and, ultimately, Lichess bot.



In wake of AlphaZero's crushing performance against Stockfish last year, I am considering whether I should create this engine with machine learning (some type of neural network, possibly using Tensorflow) or traditional, hard coded heuristics.



I am less familiar with neural networks than other kinds of hard-coding. Still, it could be a good way for me to learn to work with neural networks.



Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.



So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?










share|improve this question































    3















    I am both an avid chess player and computer programmer. I would say that playing chess and programming are the two things I spend the most time doing. Naturally, I am wanting to create my own engine and, ultimately, Lichess bot.



    In wake of AlphaZero's crushing performance against Stockfish last year, I am considering whether I should create this engine with machine learning (some type of neural network, possibly using Tensorflow) or traditional, hard coded heuristics.



    I am less familiar with neural networks than other kinds of hard-coding. Still, it could be a good way for me to learn to work with neural networks.



    Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.



    So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?










    share|improve this question



























      3












      3








      3








      I am both an avid chess player and computer programmer. I would say that playing chess and programming are the two things I spend the most time doing. Naturally, I am wanting to create my own engine and, ultimately, Lichess bot.



      In wake of AlphaZero's crushing performance against Stockfish last year, I am considering whether I should create this engine with machine learning (some type of neural network, possibly using Tensorflow) or traditional, hard coded heuristics.



      I am less familiar with neural networks than other kinds of hard-coding. Still, it could be a good way for me to learn to work with neural networks.



      Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.



      So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?










      share|improve this question














      I am both an avid chess player and computer programmer. I would say that playing chess and programming are the two things I spend the most time doing. Naturally, I am wanting to create my own engine and, ultimately, Lichess bot.



      In wake of AlphaZero's crushing performance against Stockfish last year, I am considering whether I should create this engine with machine learning (some type of neural network, possibly using Tensorflow) or traditional, hard coded heuristics.



      I am less familiar with neural networks than other kinds of hard-coding. Still, it could be a good way for me to learn to work with neural networks.



      Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.



      So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?







      engines programming computer-chess






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 8 hours ago









      David ChopinDavid Chopin

      1267 bronze badges




      1267 bronze badges

























          3 Answers
          3






          active

          oldest

          votes


















          3
















          If you're trying to make the strongest engine possible, absolutely go for NN engines.



          Traditional engines are great - Stockfish is arguably still the strongest engine on the planet on consensus equal hardware - but they are hard to write. These engines didn't get where they were overnight; they took years and years of work. Stockfish for example has been steadily gaining elo for six years. If you start from scratch, you will not get anywhere near Stockfish strength quickly; in fact you are likely to stall several hundred elo from where Stockfish currently is. For comparison some of the strongest single-author engines right now are Ethereal, Laser, and Xiphos (I neglect Houdini & Fire since they aren't open source). These engines are all substantially weaker than Stockfish.



          Why are they so much weaker? Two reasons:




          1. At this level, developing an engine takes a lot of computational power. What you do is look through your code and identify an idea that could gain elo. An example idea is, "if we know this move is probably good, do not search branches that reverse that move" (if this doesn't make sense to you, it means there's going to be a high learning curve as well). You then write a patch that implements the idea, and test the modified engine against the previous version. At this level, it takes tens of thousands of games to get a large-enough sample size to tell if the patch is effective. Playing these games takes huge amounts of computational power. Stockfish has access to super hardware: as of time of writing, the Stockfish testing ground Fishtesting is running with 1038 cores. For comparison a typical desktop computer might have 4-8 cores.


          2. The other reason is that Stockfish is backed by many brains. As of time of writing, there are 8 patches written by 5 people being tested. If you look through the patch histories you'll find many more developers who've written patches. I don't know how many active Stockfish developers there are, but it's certainly >20.



          On the other hand, NN engines (relatively) easily reach a strength that's well above Ethereal/Laser/Xiphos. See for yourself in the latest Top Chess Engine Championship tournament. Ethereal/Laser/Xiphos are in League 1, which is credible enough, but the engines in the top division (Division P) are:




          • Stockfish (community-backed traditional engine, runs with Fishtesting)

          • Komodo (commercial traditional engine, has full-time developers)

          • Komodo MCTS (commercial semi-traditional engine, has full-time developers)

          • Houdini (commercial traditional engine, is a one-man effort, hasn't been updated for two years)

          • Leela Chess Zero (community-backed NN engine, runs with the analog of Fishtesting aka a ton of hardware)


          • AllieStein (2-man NN engine)

          • Stoofvlees (NN engine)

          • ScorpioNN (NN engine)


          The last three engines - AllieStein, Stoofvlees and ScorpioNN - are all small collaborations by people who, as far as I know, are not full-time developers. In fact in the recent history of computer chess there has only been one person who's ever competed successfully with Stockfish & Komodo alone (Robert Houdart, the author of Houdini).



          It's true that you probably won't have the hardware to compete with Lc0, but Lc0 takes this much computational power because it's a "zero" engine - it's supposed to play chess without any kind of human knowledge except for rules. You don't need to use the same methodology. You could use e.g. the Stein methodology that uses supervised learning. It's arguably even better than going "zero" - after all it's AllieStein playing in the superfinal, not Lc0.



          The upshot is: if your aim is to compete with the best engines in the world, you are far more likely to succeed with NN engines than traditional ones.






          share|improve this answer



































            4

















            So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?




            Don't choose a NN unless you have access to ridiculous(A few hundred Nvidia V100s). Training a NN to play chess takes so much hardware. See the people contributing to Lc0 to train over 200 million games. Since you will probably have trouble accessing the hardware (you could try to get some at Google Colabatory, but with only that, training will be very slow).




            Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.




            Python and Javascript are probably too slow for a strong chess engine. I haven't used Swift but it probably won't like platforms other than macOS, so it's probably better to use C or C++. You could also possibly use Rust, but that has many safety features that get annoying and you don't really need, which can get annoying. It's also going to be harder to get good performance out of it since certain low-level optimizations are hard to make. Of course, you can always write it in assembly but that's probably going to be too much work. see https://www.chessprogramming.org/Languages/






            share|improve this answer





















            • 1





              Awesome, thanks a ton for the info! I'll probably try to create an API that takes in an FEN position and outputs the calculated move. I figure this is the best way to integrate with Lichess bots.

              – David Chopin
              7 hours ago











            • There is github.com/careless25/lichess-bot

              – me'
              5 hours ago



















            0
















            I built a purely toy chess engine using: python chess it was really nice not having to code the rules of the game myself and just focus on the logic; however, the number of position I was able evaluate per second is very low. This might be a good starting point.






            share|improve this answer



























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "435"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });















              draft saved

              draft discarded
















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fchess.stackexchange.com%2fquestions%2f26489%2fcreating-chess-engine-machine-learning-vs-traditional-engine%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3
















              If you're trying to make the strongest engine possible, absolutely go for NN engines.



              Traditional engines are great - Stockfish is arguably still the strongest engine on the planet on consensus equal hardware - but they are hard to write. These engines didn't get where they were overnight; they took years and years of work. Stockfish for example has been steadily gaining elo for six years. If you start from scratch, you will not get anywhere near Stockfish strength quickly; in fact you are likely to stall several hundred elo from where Stockfish currently is. For comparison some of the strongest single-author engines right now are Ethereal, Laser, and Xiphos (I neglect Houdini & Fire since they aren't open source). These engines are all substantially weaker than Stockfish.



              Why are they so much weaker? Two reasons:




              1. At this level, developing an engine takes a lot of computational power. What you do is look through your code and identify an idea that could gain elo. An example idea is, "if we know this move is probably good, do not search branches that reverse that move" (if this doesn't make sense to you, it means there's going to be a high learning curve as well). You then write a patch that implements the idea, and test the modified engine against the previous version. At this level, it takes tens of thousands of games to get a large-enough sample size to tell if the patch is effective. Playing these games takes huge amounts of computational power. Stockfish has access to super hardware: as of time of writing, the Stockfish testing ground Fishtesting is running with 1038 cores. For comparison a typical desktop computer might have 4-8 cores.


              2. The other reason is that Stockfish is backed by many brains. As of time of writing, there are 8 patches written by 5 people being tested. If you look through the patch histories you'll find many more developers who've written patches. I don't know how many active Stockfish developers there are, but it's certainly >20.



              On the other hand, NN engines (relatively) easily reach a strength that's well above Ethereal/Laser/Xiphos. See for yourself in the latest Top Chess Engine Championship tournament. Ethereal/Laser/Xiphos are in League 1, which is credible enough, but the engines in the top division (Division P) are:




              • Stockfish (community-backed traditional engine, runs with Fishtesting)

              • Komodo (commercial traditional engine, has full-time developers)

              • Komodo MCTS (commercial semi-traditional engine, has full-time developers)

              • Houdini (commercial traditional engine, is a one-man effort, hasn't been updated for two years)

              • Leela Chess Zero (community-backed NN engine, runs with the analog of Fishtesting aka a ton of hardware)


              • AllieStein (2-man NN engine)

              • Stoofvlees (NN engine)

              • ScorpioNN (NN engine)


              The last three engines - AllieStein, Stoofvlees and ScorpioNN - are all small collaborations by people who, as far as I know, are not full-time developers. In fact in the recent history of computer chess there has only been one person who's ever competed successfully with Stockfish & Komodo alone (Robert Houdart, the author of Houdini).



              It's true that you probably won't have the hardware to compete with Lc0, but Lc0 takes this much computational power because it's a "zero" engine - it's supposed to play chess without any kind of human knowledge except for rules. You don't need to use the same methodology. You could use e.g. the Stein methodology that uses supervised learning. It's arguably even better than going "zero" - after all it's AllieStein playing in the superfinal, not Lc0.



              The upshot is: if your aim is to compete with the best engines in the world, you are far more likely to succeed with NN engines than traditional ones.






              share|improve this answer
































                3
















                If you're trying to make the strongest engine possible, absolutely go for NN engines.



                Traditional engines are great - Stockfish is arguably still the strongest engine on the planet on consensus equal hardware - but they are hard to write. These engines didn't get where they were overnight; they took years and years of work. Stockfish for example has been steadily gaining elo for six years. If you start from scratch, you will not get anywhere near Stockfish strength quickly; in fact you are likely to stall several hundred elo from where Stockfish currently is. For comparison some of the strongest single-author engines right now are Ethereal, Laser, and Xiphos (I neglect Houdini & Fire since they aren't open source). These engines are all substantially weaker than Stockfish.



                Why are they so much weaker? Two reasons:




                1. At this level, developing an engine takes a lot of computational power. What you do is look through your code and identify an idea that could gain elo. An example idea is, "if we know this move is probably good, do not search branches that reverse that move" (if this doesn't make sense to you, it means there's going to be a high learning curve as well). You then write a patch that implements the idea, and test the modified engine against the previous version. At this level, it takes tens of thousands of games to get a large-enough sample size to tell if the patch is effective. Playing these games takes huge amounts of computational power. Stockfish has access to super hardware: as of time of writing, the Stockfish testing ground Fishtesting is running with 1038 cores. For comparison a typical desktop computer might have 4-8 cores.


                2. The other reason is that Stockfish is backed by many brains. As of time of writing, there are 8 patches written by 5 people being tested. If you look through the patch histories you'll find many more developers who've written patches. I don't know how many active Stockfish developers there are, but it's certainly >20.



                On the other hand, NN engines (relatively) easily reach a strength that's well above Ethereal/Laser/Xiphos. See for yourself in the latest Top Chess Engine Championship tournament. Ethereal/Laser/Xiphos are in League 1, which is credible enough, but the engines in the top division (Division P) are:




                • Stockfish (community-backed traditional engine, runs with Fishtesting)

                • Komodo (commercial traditional engine, has full-time developers)

                • Komodo MCTS (commercial semi-traditional engine, has full-time developers)

                • Houdini (commercial traditional engine, is a one-man effort, hasn't been updated for two years)

                • Leela Chess Zero (community-backed NN engine, runs with the analog of Fishtesting aka a ton of hardware)


                • AllieStein (2-man NN engine)

                • Stoofvlees (NN engine)

                • ScorpioNN (NN engine)


                The last three engines - AllieStein, Stoofvlees and ScorpioNN - are all small collaborations by people who, as far as I know, are not full-time developers. In fact in the recent history of computer chess there has only been one person who's ever competed successfully with Stockfish & Komodo alone (Robert Houdart, the author of Houdini).



                It's true that you probably won't have the hardware to compete with Lc0, but Lc0 takes this much computational power because it's a "zero" engine - it's supposed to play chess without any kind of human knowledge except for rules. You don't need to use the same methodology. You could use e.g. the Stein methodology that uses supervised learning. It's arguably even better than going "zero" - after all it's AllieStein playing in the superfinal, not Lc0.



                The upshot is: if your aim is to compete with the best engines in the world, you are far more likely to succeed with NN engines than traditional ones.






                share|improve this answer






























                  3














                  3










                  3









                  If you're trying to make the strongest engine possible, absolutely go for NN engines.



                  Traditional engines are great - Stockfish is arguably still the strongest engine on the planet on consensus equal hardware - but they are hard to write. These engines didn't get where they were overnight; they took years and years of work. Stockfish for example has been steadily gaining elo for six years. If you start from scratch, you will not get anywhere near Stockfish strength quickly; in fact you are likely to stall several hundred elo from where Stockfish currently is. For comparison some of the strongest single-author engines right now are Ethereal, Laser, and Xiphos (I neglect Houdini & Fire since they aren't open source). These engines are all substantially weaker than Stockfish.



                  Why are they so much weaker? Two reasons:




                  1. At this level, developing an engine takes a lot of computational power. What you do is look through your code and identify an idea that could gain elo. An example idea is, "if we know this move is probably good, do not search branches that reverse that move" (if this doesn't make sense to you, it means there's going to be a high learning curve as well). You then write a patch that implements the idea, and test the modified engine against the previous version. At this level, it takes tens of thousands of games to get a large-enough sample size to tell if the patch is effective. Playing these games takes huge amounts of computational power. Stockfish has access to super hardware: as of time of writing, the Stockfish testing ground Fishtesting is running with 1038 cores. For comparison a typical desktop computer might have 4-8 cores.


                  2. The other reason is that Stockfish is backed by many brains. As of time of writing, there are 8 patches written by 5 people being tested. If you look through the patch histories you'll find many more developers who've written patches. I don't know how many active Stockfish developers there are, but it's certainly >20.



                  On the other hand, NN engines (relatively) easily reach a strength that's well above Ethereal/Laser/Xiphos. See for yourself in the latest Top Chess Engine Championship tournament. Ethereal/Laser/Xiphos are in League 1, which is credible enough, but the engines in the top division (Division P) are:




                  • Stockfish (community-backed traditional engine, runs with Fishtesting)

                  • Komodo (commercial traditional engine, has full-time developers)

                  • Komodo MCTS (commercial semi-traditional engine, has full-time developers)

                  • Houdini (commercial traditional engine, is a one-man effort, hasn't been updated for two years)

                  • Leela Chess Zero (community-backed NN engine, runs with the analog of Fishtesting aka a ton of hardware)


                  • AllieStein (2-man NN engine)

                  • Stoofvlees (NN engine)

                  • ScorpioNN (NN engine)


                  The last three engines - AllieStein, Stoofvlees and ScorpioNN - are all small collaborations by people who, as far as I know, are not full-time developers. In fact in the recent history of computer chess there has only been one person who's ever competed successfully with Stockfish & Komodo alone (Robert Houdart, the author of Houdini).



                  It's true that you probably won't have the hardware to compete with Lc0, but Lc0 takes this much computational power because it's a "zero" engine - it's supposed to play chess without any kind of human knowledge except for rules. You don't need to use the same methodology. You could use e.g. the Stein methodology that uses supervised learning. It's arguably even better than going "zero" - after all it's AllieStein playing in the superfinal, not Lc0.



                  The upshot is: if your aim is to compete with the best engines in the world, you are far more likely to succeed with NN engines than traditional ones.






                  share|improve this answer















                  If you're trying to make the strongest engine possible, absolutely go for NN engines.



                  Traditional engines are great - Stockfish is arguably still the strongest engine on the planet on consensus equal hardware - but they are hard to write. These engines didn't get where they were overnight; they took years and years of work. Stockfish for example has been steadily gaining elo for six years. If you start from scratch, you will not get anywhere near Stockfish strength quickly; in fact you are likely to stall several hundred elo from where Stockfish currently is. For comparison some of the strongest single-author engines right now are Ethereal, Laser, and Xiphos (I neglect Houdini & Fire since they aren't open source). These engines are all substantially weaker than Stockfish.



                  Why are they so much weaker? Two reasons:




                  1. At this level, developing an engine takes a lot of computational power. What you do is look through your code and identify an idea that could gain elo. An example idea is, "if we know this move is probably good, do not search branches that reverse that move" (if this doesn't make sense to you, it means there's going to be a high learning curve as well). You then write a patch that implements the idea, and test the modified engine against the previous version. At this level, it takes tens of thousands of games to get a large-enough sample size to tell if the patch is effective. Playing these games takes huge amounts of computational power. Stockfish has access to super hardware: as of time of writing, the Stockfish testing ground Fishtesting is running with 1038 cores. For comparison a typical desktop computer might have 4-8 cores.


                  2. The other reason is that Stockfish is backed by many brains. As of time of writing, there are 8 patches written by 5 people being tested. If you look through the patch histories you'll find many more developers who've written patches. I don't know how many active Stockfish developers there are, but it's certainly >20.



                  On the other hand, NN engines (relatively) easily reach a strength that's well above Ethereal/Laser/Xiphos. See for yourself in the latest Top Chess Engine Championship tournament. Ethereal/Laser/Xiphos are in League 1, which is credible enough, but the engines in the top division (Division P) are:




                  • Stockfish (community-backed traditional engine, runs with Fishtesting)

                  • Komodo (commercial traditional engine, has full-time developers)

                  • Komodo MCTS (commercial semi-traditional engine, has full-time developers)

                  • Houdini (commercial traditional engine, is a one-man effort, hasn't been updated for two years)

                  • Leela Chess Zero (community-backed NN engine, runs with the analog of Fishtesting aka a ton of hardware)


                  • AllieStein (2-man NN engine)

                  • Stoofvlees (NN engine)

                  • ScorpioNN (NN engine)


                  The last three engines - AllieStein, Stoofvlees and ScorpioNN - are all small collaborations by people who, as far as I know, are not full-time developers. In fact in the recent history of computer chess there has only been one person who's ever competed successfully with Stockfish & Komodo alone (Robert Houdart, the author of Houdini).



                  It's true that you probably won't have the hardware to compete with Lc0, but Lc0 takes this much computational power because it's a "zero" engine - it's supposed to play chess without any kind of human knowledge except for rules. You don't need to use the same methodology. You could use e.g. the Stein methodology that uses supervised learning. It's arguably even better than going "zero" - after all it's AllieStein playing in the superfinal, not Lc0.



                  The upshot is: if your aim is to compete with the best engines in the world, you are far more likely to succeed with NN engines than traditional ones.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 3 hours ago

























                  answered 5 hours ago









                  AllureAllure

                  3,3438 silver badges34 bronze badges




                  3,3438 silver badges34 bronze badges




























                      4

















                      So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?




                      Don't choose a NN unless you have access to ridiculous(A few hundred Nvidia V100s). Training a NN to play chess takes so much hardware. See the people contributing to Lc0 to train over 200 million games. Since you will probably have trouble accessing the hardware (you could try to get some at Google Colabatory, but with only that, training will be very slow).




                      Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.




                      Python and Javascript are probably too slow for a strong chess engine. I haven't used Swift but it probably won't like platforms other than macOS, so it's probably better to use C or C++. You could also possibly use Rust, but that has many safety features that get annoying and you don't really need, which can get annoying. It's also going to be harder to get good performance out of it since certain low-level optimizations are hard to make. Of course, you can always write it in assembly but that's probably going to be too much work. see https://www.chessprogramming.org/Languages/






                      share|improve this answer





















                      • 1





                        Awesome, thanks a ton for the info! I'll probably try to create an API that takes in an FEN position and outputs the calculated move. I figure this is the best way to integrate with Lichess bots.

                        – David Chopin
                        7 hours ago











                      • There is github.com/careless25/lichess-bot

                        – me'
                        5 hours ago
















                      4

















                      So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?




                      Don't choose a NN unless you have access to ridiculous(A few hundred Nvidia V100s). Training a NN to play chess takes so much hardware. See the people contributing to Lc0 to train over 200 million games. Since you will probably have trouble accessing the hardware (you could try to get some at Google Colabatory, but with only that, training will be very slow).




                      Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.




                      Python and Javascript are probably too slow for a strong chess engine. I haven't used Swift but it probably won't like platforms other than macOS, so it's probably better to use C or C++. You could also possibly use Rust, but that has many safety features that get annoying and you don't really need, which can get annoying. It's also going to be harder to get good performance out of it since certain low-level optimizations are hard to make. Of course, you can always write it in assembly but that's probably going to be too much work. see https://www.chessprogramming.org/Languages/






                      share|improve this answer





















                      • 1





                        Awesome, thanks a ton for the info! I'll probably try to create an API that takes in an FEN position and outputs the calculated move. I figure this is the best way to integrate with Lichess bots.

                        – David Chopin
                        7 hours ago











                      • There is github.com/careless25/lichess-bot

                        – me'
                        5 hours ago














                      4














                      4










                      4










                      So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?




                      Don't choose a NN unless you have access to ridiculous(A few hundred Nvidia V100s). Training a NN to play chess takes so much hardware. See the people contributing to Lc0 to train over 200 million games. Since you will probably have trouble accessing the hardware (you could try to get some at Google Colabatory, but with only that, training will be very slow).




                      Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.




                      Python and Javascript are probably too slow for a strong chess engine. I haven't used Swift but it probably won't like platforms other than macOS, so it's probably better to use C or C++. You could also possibly use Rust, but that has many safety features that get annoying and you don't really need, which can get annoying. It's also going to be harder to get good performance out of it since certain low-level optimizations are hard to make. Of course, you can always write it in assembly but that's probably going to be too much work. see https://www.chessprogramming.org/Languages/






                      share|improve this answer














                      So, in terms of creating the strongest chess engine possible, should I go neural network or hard-coded?




                      Don't choose a NN unless you have access to ridiculous(A few hundred Nvidia V100s). Training a NN to play chess takes so much hardware. See the people contributing to Lc0 to train over 200 million games. Since you will probably have trouble accessing the hardware (you could try to get some at Google Colabatory, but with only that, training will be very slow).




                      Another thing I am considering is whether it is important which language I use to code the engine. I know many chess engines use C++, which I have never used before. I have used other C-based languages which do many of the same things, with mostly varying syntax. I am most familiar with Swift and Javascript, but am also familiar with Python and feel that it could do the trick for me.




                      Python and Javascript are probably too slow for a strong chess engine. I haven't used Swift but it probably won't like platforms other than macOS, so it's probably better to use C or C++. You could also possibly use Rust, but that has many safety features that get annoying and you don't really need, which can get annoying. It's also going to be harder to get good performance out of it since certain low-level optimizations are hard to make. Of course, you can always write it in assembly but that's probably going to be too much work. see https://www.chessprogramming.org/Languages/







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered 7 hours ago









                      me'me'

                      1904 bronze badges




                      1904 bronze badges











                      • 1





                        Awesome, thanks a ton for the info! I'll probably try to create an API that takes in an FEN position and outputs the calculated move. I figure this is the best way to integrate with Lichess bots.

                        – David Chopin
                        7 hours ago











                      • There is github.com/careless25/lichess-bot

                        – me'
                        5 hours ago














                      • 1





                        Awesome, thanks a ton for the info! I'll probably try to create an API that takes in an FEN position and outputs the calculated move. I figure this is the best way to integrate with Lichess bots.

                        – David Chopin
                        7 hours ago











                      • There is github.com/careless25/lichess-bot

                        – me'
                        5 hours ago








                      1




                      1





                      Awesome, thanks a ton for the info! I'll probably try to create an API that takes in an FEN position and outputs the calculated move. I figure this is the best way to integrate with Lichess bots.

                      – David Chopin
                      7 hours ago





                      Awesome, thanks a ton for the info! I'll probably try to create an API that takes in an FEN position and outputs the calculated move. I figure this is the best way to integrate with Lichess bots.

                      – David Chopin
                      7 hours ago













                      There is github.com/careless25/lichess-bot

                      – me'
                      5 hours ago





                      There is github.com/careless25/lichess-bot

                      – me'
                      5 hours ago











                      0
















                      I built a purely toy chess engine using: python chess it was really nice not having to code the rules of the game myself and just focus on the logic; however, the number of position I was able evaluate per second is very low. This might be a good starting point.






                      share|improve this answer






























                        0
















                        I built a purely toy chess engine using: python chess it was really nice not having to code the rules of the game myself and just focus on the logic; however, the number of position I was able evaluate per second is very low. This might be a good starting point.






                        share|improve this answer




























                          0














                          0










                          0









                          I built a purely toy chess engine using: python chess it was really nice not having to code the rules of the game myself and just focus on the logic; however, the number of position I was able evaluate per second is very low. This might be a good starting point.






                          share|improve this answer













                          I built a purely toy chess engine using: python chess it was really nice not having to code the rules of the game myself and just focus on the logic; however, the number of position I was able evaluate per second is very low. This might be a good starting point.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 27 mins ago









                          AkavallAkavall

                          3,5571 gold badge13 silver badges24 bronze badges




                          3,5571 gold badge13 silver badges24 bronze badges


































                              draft saved

                              draft discarded



















































                              Thanks for contributing an answer to Chess Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fchess.stackexchange.com%2fquestions%2f26489%2fcreating-chess-engine-machine-learning-vs-traditional-engine%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                              Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                              Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m