What you need is Pointer Networks (https://arxiv.org/abs/1506.03134)
Here is a introduction quote from a post about it:
Pointer networks are a new neural architecture that learns pointers to positions in an input sequence. This is new because existing techniques need to have a fixed number of target classes, which isn't generally applicable— consider the Travelling Salesman Problem, in which the number of classes is equal to the number of inputs. An additional example would be sorting a variably sized sequence.
- https://finbarr.ca/pointer-networks/
Its an attention based model.
Essentially a pointer network is used to predict pointers back to the input, meaning your output layer isn't actually fixed, but variable.
A use case where I have used them is for translating raw text into SQL queries.
- Input: "HOW MANY CARS WERE SOLD IN US IN 1983"
- Output: SELECT COUNT(Car_id) FROM Car_table WHERE (Country='US' AND
Year=='1983')
The issue with raw text such as this is that it will only make sense w.r.t to a specific table (in this case car table with a set of variables around car sales, similar to your different boards for board games). Meaning, that if the question cant be the only input. So the input that actually goes into the pointer network is a combination of -
Input -
- Query
- Metadata of the table (column names)
- Token vocabulary for all categorical columns
- Keywords from SQL syntax (SELECT, WHERE etc..)
All of these are appended together.
The output layer then simply points back to specific indexes of the input. It points to Country and Year (from column names in metadata), it points to US and 1983 (from tokens in vocabulary of categorical columns), it points to SELECT, WHERE etc from the SQL syntax component of the input.
The sequence of these indexes in the appended index is then used as the output of your computation graph, and optimized using a training dataset that exists as WIKISQL dataset.
Your case is quite similar, you need to pass the inputs, metadata of the game, and the stuff you need as part of your output as an appended index. Then the pointer network simply makes selections from the input (points to them).