1
$\begingroup$

I am quite new to this neural network stuff, so please bear with me :)

TL;DR: I want to train a neural network to predict a scalar score from 32 binary features. Training data is expensive to come by, there is a tradeoff between precision and amount of training samples. Which scenario will likely give me a better result:

  • Training the network with 100 distinct samples of training data where the output (-1 to 1) is averaged from 100 runs of the same sample, and therefore fairly precise

  • Training the network with 1000 distinct samples of training data where the output (-1 to 1) is averaged from 10 runs of the same sample, and therefore less precise

  • Training the network with 10000 distinct samples of training data where the output is just binary (-1 or 1), and therefore very imprecise

  • Something else?

More context: I am creating an AI for an imperfect information 4-player card game with 32 cards. I already have implemented a MinMax-based tree search that solves the perfect information version of the game, i.e. this can deliver me the score that is reached at the end of the game, assuming perfect play of all players, for the case that the full card distribution is known to all players. In reality, of course, each player only knows their own hand of cards. For the purposes of the AI I get around this by repeating the perfect information game many times while randomly assigning the unknown cards.

I now want to train a neural network that predicts the win probability that is reached with a given hand of cards (of course, not knowing the cards of the other players). I imagine this would be a value between -1 and 1, where 0 means 50% win probability and 1 means 100% win probability. The input features would be 32 binary values, representing the hand of cards. I want to use my MinMax algorithm to generate the training data for the network.

In a perfect world, I would iterate trough 1 Million random hands of cards and determine a precise win probability for each of them by playing 1 Million randomized perfect information games based on that hand. The reality, however, is that my MinMax algorithm is fairly expensive, and I can't improve it much more. So the total amount of perfect information games I can go through is limited.

Now I am wondering: How do I maximize the effectiveness of my training data generation process? I guess the tradeoff is:

  • If I go through many perfect information iterations for each given hand, the win probability in my training data will be fairly close to the 'real' win probability, so very precise
  • If I go through fewer (or in extreme case, only 1) perfect information iterations for each given hand, the win probability in my training data will be less precise. However, statistically it should still all even out in the end. Plus, I will have a lot more training samples, covering a much wider range of situations.

In that context I am wondering which side of this spectrum - precision vs. amount - will give me the better tradeoff.

Side note: For my validation data set, of course I will have to determine a fairly precise win probability for at least some samples, where I will probably use more iterations per sample than for the training data.

$\endgroup$

2 Answers 2

2
$\begingroup$

super-interesting question!

My approach to the problem would be not to do any preprocessing on the data. This is, feed all the experiments to the network with the target being the 0/1 variable corresponding to lose/win. For example, if you have a dataset like

| hand of cards     | game output |
|-------------------|-------------|
| [1, 0, 0, ..., 1] | 1           |
| [1, 0, 0, ..., 1] | 0           |
| [1, 0, 0, ..., 1] | 1           |
| [0, 1, 1, ..., 1] | 1           |
| [0, 1, 1, ..., 1] | 1           |
| [0, 1, 1, ..., 1] | 1           |

instead of training the model with

| hand of cards     | winning prob |
|-------------------|--------------|
| [1, 0, 0, ..., 1] | 0.66         |
| [0, 1, 1, ..., 1] | 1            |

I would train the model with the first dataset, and try to predict the game output. This is, instead of using a regression model using a classification model. Of course, with this approach, your dataset will have entries with the same features and different targets, however, this is not a problem, since you can interpret the output of the classification model as the probability of winning or losing. From my experience, when I've dealt with similar problems, this approach is the one that gave the best results.

On the other hand, I would try an approach using decision trees, such as XGBoost or a simple RandomForest, since they use to work better with the kind of data you are dealing with.

$\endgroup$
3
  • $\begingroup$ Thanks for your thoughts, and for giving me some good keywords to google! I was just wondering, when I do this approach of training the network with the raw data, so only with the binary win/lose output, is there any additional value of running multiple iterations on the same hand? Intuitively, shouldn't it be better in this case to only run one sample per hand to cover a wider variety of situations with the same amount of training data? $\endgroup$
    – Jonarw
    Commented Jun 26, 2022 at 18:48
  • $\begingroup$ I've one doubt: how many different hands can you have? You said it's a 32 binary variable, but how many cards do you have in a hand? $\endgroup$
    – alexmolas
    Commented Jun 26, 2022 at 19:19
  • $\begingroup$ Oh I guess I did not really mention that... there are 8 cards in one hand (all the 32 cards are distributed over the 4 players). So there's about 10,5 Million different hands that you can have. So when just going through random hands, collisions are not inconceivable, but quite rare $\endgroup$
    – Jonarw
    Commented Jun 27, 2022 at 5:38
1
$\begingroup$

I would say that it's better to have more data, since noise in the data is reduced by the optimization algorithm when optimizing (and therefore cause no problem in the optimization phase), and you can start training your model with this noise fact in mind, and therefore take very heavy precaution on overfitting (checking the validation loss, using boosting or bagging etc etc)

Maybe if you have time you can also consider the "transfer learning" option, and therefore seek for trained model to fine tune on your data

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.