Halite bot and tools
Actual content of the submitted zip file is in https://github.com/cbovar/Halite/tree/master/Submission.
Halite server only compiles two files (HaliteHelper.cs and MyBot.cs) so I had to fit all the code in those files which is not a common practice in C#.
Networks were trained using ~300 games from erdman v17 for a few hours using CPU.
Three different networks were trained and used in the same bot:
The idea is to try to copy the strategy of another player.
This will train a single network, you can use TripleFluentNetTraining instead of FluentNetTraining to train a bot similar to cbovar V45
1) Get games historical data
2) Train a network
var convInputWith = 11; // Will extract 11x11 area
var net = FluentNet.Create(convInputWith, convInputWith, 3)
.Conv(3, 3, 16).Stride(2)
.Tanh()
.Conv(2, 2, 16)
.Tanh()
.FullyConn(100)
.Relu()
.FullyConn(5)
.Softmax(5).Build(); // 5 classes (1 for each direction)
var trainer = new AdamTrainer(singleNet) { BatchSize = 1024, LearningRate = 0.1, Beta1 = 0.9, Beta2 = 0.99, Eps = 1e-8 };
You can use ComparerRunner to make your bots fight each others.
By default, version V28 and V45 will fight each others. You can add your newly trained bot by modifying the following list:
// List of bots
var bots = new List<Func<IPlayer>>
{
{() => new ThreeNetBot{Prefix="../../../networks/V45/", Name = "V45"} },
{() => new SingleNetBot{Prefix="../../../networks/V28/", Name = "V28"} },
};
In order to easily debug bots, Halite.cpp has been ported to C#. Halite.cs