https://github.com/enhuiz/decoding-steps-embedding
Reinforcement learning for a toy task of RNN decoding steps embedding.
https://github.com/enhuiz/decoding-steps-embedding
Last synced: 3 months ago
JSON representation
Reinforcement learning for a toy task of RNN decoding steps embedding.
- Host: GitHub
- URL: https://github.com/enhuiz/decoding-steps-embedding
- Owner: enhuiz
- Created: 2020-03-28T02:50:45.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-28T02:51:26.000Z (about 5 years ago)
- Last Synced: 2025-01-07T18:29:12.382Z (5 months ago)
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RNN Decoding Steps Embedding
Reinforcement learning for a toy task of RNN decoding steps embedding.
## Task Description
**Input**: an integer L.
**Output**: a sequence of vectors with length L.## Network Design
```
For each decoding time step t:
a_t ~ Bernoulli(F_t(L; θ))
if a_t == 0 then
halt
```## Training Objective
$$ \theta = \arg\max\limits_\theta \mathbb{E}_{a_1^{L'}}[\mathcal{R}\log p(a_1^{L'}|L)] $$
Where $\mathcal{R}$ is the reward, which is determined by $L$ and $L'$. Here $\mathcal{R} = |L'- L|$ is selected.
## Run code
### Dependencies
- pytorch
- tqdm### Run
```
python3 main.py
```### Results
![]()