Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Update bilstm integer array sorting example #12929

Merged
merged 3 commits into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions example/bi-lstm-sort/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
This is an example of using bidirection lstm to sort an array.
# Bidirectionnal LSTM to sort an array.

Run the training script by doing the following:
This is an example of using bidirectionmal lstm to sort an array. Please refer to the notebook.

```
python lstm_sort.py --start-range 100 --end-range 1000 --cpu
```
You can provide the start-range and end-range for the numbers and whether to train on the cpu or not.
By default the script tries to train on the GPU. The default start-range is 100 and end-range is 1000.
We train a bidirectionnal LSTM to sort an array of integer.

At last, test model by doing the following:
For example:

```
python infer_sort.py 234 189 785 763 231
```
`500 30 999 10 130` should give us `10 30 130 500 999`

This should output the sorted seq like the following:
```
189
231
234
763
785
```
![](https://cdn-images-1.medium.com/max/1200/1*6QnPUSv_t9BY9Fv8_aLb-Q.png)


([Diagram source](http://colah.github.io/posts/2015-09-NN-Types-FP/))
Loading