Permutation-Invariant Neural Networks for Reinforcement Learning
blog.otoro.net
blog.otoro.net
It seems like if done at scale could open up a whole new world of "dump data in get observations out"-type of networks.
Could this be used for something like a card game? Consider, how would you encode the cards in your hand in such a game? The cards in your hand form a set, their order does not matter, and the number of cards in your hand at any time varies in many games.
The examples on that page are neat, but they're also stupid and artificial. Why would anyone mangle their input like that? Are there any examples of this being useful that are less artificial?
One might have any number of cards in a given hand, with any number of varying properties (like for standard 52 card decks, suit and rank). To keep a fixed size feature vector as the input for a neural net, one approach is to have a representation that treats every distinct possible card as a single input feature in the vector, with value representing whether it is currently in a given player's hand or not (0 or 1).
This of course falls apart a bit when looking at card games where multiple copies of the same card can exist. If you just scale up the input feature values proportionally to the duplicate card count, you might assume a linear effect of those duplicate cards where a nonlinear effect exists. TDGammon's representation for Backgammon solves a similar issue, a similar way, for representing how many stones exist on a given point (if I recall correctly, some version of it cares about 0, 1, 2, or 3+ as distinct possibilities, represented effectively as different features per point). Still, as a first approximation, this does work for a decent swath of games (and abstracts the ordering of cards away).
It seems like this article's approach involves a good deal of having the neural net recognize symmetries like this automatically.
As I understand it all outputs are then added together / averaged into one vector. That should make the model ”hard” permutation invariant.
Any suggestions on how to learn about transformers? Or a few sentences to get me started on the right path?
I am not a specialist in NN and the article doesn’t even mention it, but shouldn’t input dropout and input corruption help with this?
> While it is possible to acquire a quasi-PI agent by training with randomly shuffled observations and hope the agent’s policy network has enough capacity to memorize all the patterns, we aim for a design that achieves true PI even if the agent is trained with fix-ordered observations.
That's what makes this cool and VERY human-like. Just because our visual system isn't set up to handle this particular type of reshuffling problem doesn't mean that we don't constantly have to handle the reshuffling of inputs to maintain a coherent view of reality.