maxpumperla / deep_learning_and_the_game_of_go

Code and other material for the book "Deep Learning and the Game of Go"
https://www.manning.com/books/deep-learning-and-the-game-of-go
987 stars 390 forks source link

How to train with a specific set of features/games #82

Open YamilVidal opened 3 years ago

YamilVidal commented 3 years ago

Hi all!! As I experiment with different hyperparameters, I would like to be able to train different networks with exactly the same feature-labels, so that any different in performance would be due to the hyperparameters and not the data itself.

Similarly, I have my own collection of historical go games, and would like to be able to train networks with those games instead of the KGS games.

As I'm relatively new to Python, the task of modifying the existing code (parallel_processor.py, generator.py, etc) is quite daunting. So before I give it a try myself I rather ask. Has anyone implemented something in this line, and would be willing to share it? Thanks a lot

macfergus commented 3 years ago

Hi Yamil, I have some examples in another repository that might help you.

https://github.com/macfergus/badukai

Here are some key files: https://github.com/macfergus/badukai/blob/master/build_index.py 👈 builds an index of your SGF collection https://github.com/macfergus/badukai/blob/master/train_from_sgf.py 👈 handles training over a collection that may be too large to fit in memory https://github.com/macfergus/badukai/blob/master/badukai/corpora/index.py 👈 module that handles iterating over a large game collection

The differences from the processor in the book are:

I wrote the badukai code after finishing the book, so it uses similar conventions to the book, but not identical. I hope this makes it easier to follow rather than harder 😅. Let me know if this helps!

YamilVidal commented 3 years ago

This is great! Thank you If I get stuck I'll let you know =)