https://github.com/liby99/learning-parity
Learning Parity with LSTM (which is not possible)
https://github.com/liby99/learning-parity
Last synced: 8 months ago
JSON representation
Learning Parity with LSTM (which is not possible)
- Host: GitHub
- URL: https://github.com/liby99/learning-parity
- Owner: Liby99
- Created: 2021-01-23T03:18:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-23T05:24:34.000Z (over 5 years ago)
- Last Synced: 2025-01-21T10:51:05.345Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Learning Parity with LSTM
This python package tries to learn to compute parity with LSTM. It takes
in a sequence of 0/1s, and produce a single 0/1 representing the parity
bit.
## How to use
1. Generate Training Dataset and Testing Dataset
```
python3 src/datagen.py -o data/train.pkl
python3 src/datagen.py -o data/test.pkl
```
2. Train a model
```
python3 src/train.py -i data/train.pkl -o model/model.pkl
```
3. Test the trained model
```
python3 src/test.py -m model/model.pkl -d data/test.pkl
```
## Expected output
The LSTM model cannot really learn the concept of parity and at the end
it will just randomly guess either 0 or 1, producing a 0.5 accuracy.