forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update bilstm integer array sorting example (apache#12929)
* Update the bilstm example to Gluon * Update formating * Update example/vae/VAE_example.ipynb Co-Authored-By: ThomasDelteil <[email protected]>
- Loading branch information
1 parent
0dad490
commit 4e13fce
Showing
8 changed files
with
616 additions
and
781 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/)) |
Oops, something went wrong.