Skip to content

Commit

Permalink
Update bilstm integer array sorting example (apache#12929)
Browse files Browse the repository at this point in the history
* Update the bilstm example to Gluon

* Update formating

* Update example/vae/VAE_example.ipynb

Co-Authored-By: ThomasDelteil <[email protected]>
  • Loading branch information
ThomasDelteil authored and Jose Luis Contreras committed Nov 13, 2018
1 parent 246e61a commit e5c80b9
Show file tree
Hide file tree
Showing 8 changed files with 616 additions and 781 deletions.
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

0 comments on commit e5c80b9

Please sign in to comment.