Skip to content
Permalink
Browse files

refactored for tf1.0, and added inverse weighted pooling

  • Loading branch information
Kyubyong committed Feb 22, 2017
1 parent d02d717 commit a580ea36ce9792eb58789ce2fe63b810bd24fdbf
Showing with 40,816 additions and 40,802 deletions.
  1. +1 −1 .gitignore
  2. +7 −3 README.md
  3. +3 −3 eval.py
  4. +40,788 −40,788 results.CSV
  5. +17 −7 train.py
@@ -1,6 +1,6 @@
etc/
asset/
data/*
!data/word_vocab.pkl
*.pyc
_*
*~*
@@ -42,16 +42,20 @@ In this project, we examine how well neural networks can predict the current or
### if you want to use the pretrained model,

* Download [the output files](https://drive.google.com/open?id=0B0ZXk88koS2KemFWdFNoSnBfNDg) of STEP 3 and STEP 4, then extract them to `data/` folder.
* Download [the pre-trained model files](https://drive.google.com/open?id=0B0ZXk88koS2KR2E3eTlIUHpzM2s), then extract them to `asset/train` folder.
* Download [the pre-trained model files](https://drive.google.com/open?id=0B0ZXk88koS2KNHBuM09kSXFJNzA), then extract them to `asset/train` folder.
* Run `eval.py`.

## Updates
* In the fourth week of Feb., 2017, we refactored the source file for TensorFlow 1.0.
* In addition, we changed the last global-average pooling to inverse-weighted pooling. As a result, the #KSR improved from 0.39 to 0.42. Check this.

## Results

The training took 4-5 days on my single GPU (gtx 1060). As can be seen below, our model is lower than iPhone in KSR by 8 percent points. Details are available in `results.csv`.
The training took ~~4-5~~ 2-3 days on my single GPU (gtx 1060). As can be seen below, our model is lower than iPhone in KSR by ~~8~~ 5 percent points. Details are available in `results.csv`.

| #FK | #RK: Ours | #RK: iPhone 7 |
|--- |--- |--- |--- |--- |
| 40,787 | 24,727 (=0.39 ksr) | 21,535 (=0.47 ksr)|
| 40,787 | ~~24,727 (=0.39 ksr)~~ <br>->23,753 (=0.42 ksr) | 21,535 (=0.47 ksr)|

## Conclusions
* Unfortunately, our simple model failed to show better performance than the iPhone predictive engine.
@@ -53,10 +53,10 @@ def main():
chars, targets = [], [] # targets: the word that the char composes
for word in "".join(para).split():
chars.append(" ")
targets.append(word.strip("_"))
targets.append(word)
for char in word:
chars.append(char)
targets.append(word.strip("_"))
targets.append(word)

prefix = ""
preds = set()
@@ -89,7 +89,7 @@ def main():
stop_counting = True
preds.add(pred)

results.append( "{},{},{},{},{},{},{}".format(num_char, num_para, char, target, oov, predword, rk) )
results.append(u"{},{},{},{},{},{},{}".format(num_char, num_para, char, target, oov, predword, rk) )
num_char += 1

num_para += 1

0 comments on commit a580ea3

Please sign in to comment.
You can’t perform that action at this time.