Repository navigation
Model
Charlie Ringer edited this page Apr 28, 2017
·
11 revisions
The model is where a network is train in understand which game state are good and which are bad. To use is fairly straight forward. Create an empty model (using the default settings or your own). Then train it by setting a number of games per training episode, a number of episode and a function which creates an new AIState.
Model model = new Model("DefaultSettings.xml");
model.train(games_per_episode, episodes, () => new CustomAIState());Then, using the outputted .model file create an Model with that file and pass it to the various AIAgents that require it.
| Name | Description |
|---|---|
| Model() | Constructs an empty model using the default settings. |
| Model(string file) | If a settings file is passed in (anything that ends in .xml) it constructs an empty model using the supplied settings. If a .model file is passed in it it constructs a model using the weights in the file and the default settings |
| Model(string modelfile, string settingsFile) | Constructs a model using the supplied settings and model file |
| Return Type | Name | Description |
|---|---|---|
| int | train(int gamesPerEpisode, int episodes, StateCreator sc) |
|
When training is complete a .model file will created (named with the same time and date as it's creation). These .model files contain all of the weights that were trained and is then to reconstruct the network when it comes time to use the network to evaluate states during run time.