How to Train and Utilize ELF OpenGo for Advanced Go Strategies

Sep 22, 2020 | Data Science

ELF (Extensive, Lightweight, and Flexible) is a robust platform developed for game research, specifically tailored for strategic games like Go. In this blog, we will walk you through setting up, training, and using the ELF OpenGo bot, which has made significant waves in the Go community. Here’s how to get started!

Getting Started with ELF OpenGo

Before you dive into the world of Go strategies with ELF OpenGo, you need to ensure that your environment is correctly set up. ELF relies on specific software dependencies, so let’s cover that first.

Step 1: System Requirements

  • Operating System: Ubuntu 18.04
  • Python: Version 3.7
  • GCC: Version 7.3
  • CUDA: Version 10.0
  • CUDNN: Version 7.3
  • NCCL: Version 2.1.2

Only this specific environment is supported. Other setups might work but compatibility cannot be guaranteed.

Step 2: Installing Dependencies

Use the following commands to install the necessary dependencies:

sudo apt-get install cmake g++ gcc libboost-all-dev libzmq3-dev
conda install numpy zeromq pyzmq
# From the project root
git submodule sync  
git submodule update --init --recursive

You also need to install PyTorch (version 1.0.0 or later) as follows:

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

Building ELF

Once your environment is set up, navigate to the project root and execute the build command:

cd to the project root
make

Testing Your Installation

After building the project, you should run a test to ensure everything is functioning correctly:

cd to the project root
make test

Running ELF OpenGo

Now that ELF is installed and tested, it’s time to dive into using the bot.

Training a Go Bot

To train your Go model, follow these steps:

  1. Run: source scripts/devmode_set_pythonpath.sh.
  2. Change directory: cd scripts/self/games/go.
  3. Edit server_addrs.py to specify the server’s IP address (the machine that will train the neural network).
  4. Create a directory for the server model (default is myserver).
  5. Start the server with: ./start_server.sh
  6. Start clients with: ./start_client.sh.

Running Commands on the Go Bot

After training, use the following command to engage with the bot:

./gtp.sh pathtomodelfile.bin --verbose --gpu 0 --num_block 20 --dim 256 --mcts_puct 1.50 --batchsize 16 --mcts_rollout_per_batch 16 --mcts_threads 2 --mcts_rollout_per_thread 8192 --resign_thres 0.05 --mcts_virtual_loss 1

Understanding the Code: An Analogy

Imagine training your ELF OpenGo bot as similar to coaching a basketball team. Each of the commands, models, and parameters you tweak serves as specific training drills aimed at improving your players’ (the bot’s) performance.

Just as you would focus on different skills throughout basketball practice—shooting, passing, and defense—the bot analyzes distinct aspects, represented by the parameters like --mcts_rollout_per_thread (the bot’s mental workout time for a move).

By carefully orchestrating these drills (commands), you’re enhancing the overall strategy and performance of your Go bot.

Troubleshooting

If you encounter issues while setting up or running ELF OpenGo, consider these troubleshooting techniques:

  • Double-check your dependencies installation.
  • Ensure you have the correct version of all software.
  • Review your script edits for any typos or incorrect configurations.
  • Consult the logs produced during your testing for error messages.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox