google-deepmind / google-deepmind/pysc2

Categorical feature embedding implementation

Open
#116 4 comments 1 reaction 1 assignee Claimed by @OriolVinyals View on GitHub
Dominant language
Python
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

In the SC2 LE paper there's this sentence under input pre-processing:
> We embed all feature layers containing categorical values into a continuous space which is
equivalent to using a one-hot encoding in the channel dimension followed by a 1 × 1 convolution.

This raises two question on implementation detail. Let's assume we're dealing with a `64x64` minimap and we want to embed `visibility_map` (4 levels) and `player_relative` (5 levels) features.

1.) What Is embedding dimension? That is, what is the number of kernels used in 1x1 conv?
i.e. if it's `1` then our final (concatenated) output dimensions would be `64x64x2`.

2.) Is embedding done separately per each feature or with one pass-through for all? More specifically:
* 1) one-hot on channel -> concat on channel -> 1x1 conv on all features at the same time.
ex. one-hot to `64x64x4` and `64x64x5` -> concat to `64x64x9` -> 1x1(x2) conv to `64x64x2` output
* 2) one-hot on channel -> 1x1 conv separately per feature -> concat on channel
ex. one-hot to `64x64x4` and `64x64x5` -> 1x1(x1) conv to `64x64x1` and `64x64x1` -> concat to `64x64x2` output

The big difference between the two is that in first case all features influence output channels at the same time.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.