Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Add evalutaion scripts for TextNAS (#2220)
Browse files Browse the repository at this point in the history
* Add evalutaion scripts for TextNAS.

* Remove duplicated run_sst2.sh and run_sst5.sh.

* Minor fixes.

* Bug fix.

* Adjust the running paramters.

* Adopted to nni interface.

Co-authored-by: Yaming Yang <[email protected]>
  • Loading branch information
pkuyym and Yaming Yang authored Mar 30, 2020
1 parent 7215fdd commit c261146
Show file tree
Hide file tree
Showing 3 changed files with 579 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/nas/textnas/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ def init_trainable_embedding(embedding_path, word_id_dict, embed_dim=300):
embedding = np.random.random([len(word_id_dict), embed_dim]).astype(np.float32) / 2.0 - 0.25
embedding[0] = np.zeros(embed_dim) # PAD
embedding[1] = (np.random.rand(embed_dim) - 0.5) / 2 # UNK
for word, idx in word_id_dict.items():
for word in sorted(word_id_dict.keys()):
idx = word_id_dict[word]
if idx == 0 or idx == 1:
continue
if word in word_embed_model["mapping"]:
Expand Down
Loading

0 comments on commit c261146

Please sign in to comment.