This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MXNET-836] RNN Example for Scala (#11753)
* initial fix for RNN * add CI test * add encoding format * scala style fix * update readme * test char RNN works * ignore the test due to memory leaks
- Loading branch information
1 parent
332a664
commit 38f80af
Showing
8 changed files
with
399 additions
and
286 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
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
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
48 changes: 48 additions & 0 deletions
48
scala-package/examples/src/main/scala/org/apache/mxnetexamples/rnn/README.md
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# RNN Example for MXNet Scala | ||
This folder contains the following examples writing in new Scala type-safe API: | ||
- [x] LSTM Bucketing | ||
- [x] CharRNN Inference : Generate similar text based on the model | ||
- [x] CharRNN Training: Training the language model using RNN | ||
|
||
These example is only for Illustration and not modeled to achieve the best accuracy. | ||
|
||
## Setup | ||
### Download the Network Definition, Weights and Training Data | ||
`obama.zip` contains the training inputs (Obama's speech) for CharCNN examples and `sherlockholmes` contains the data for LSTM Bucketing | ||
```bash | ||
https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/RNN/obama.zip | ||
https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/RNN/sherlockholmes.train.txt | ||
https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/RNN/sherlockholmes.valid.txt | ||
``` | ||
### Unzip the file | ||
```bash | ||
unzip obama.zip | ||
``` | ||
### Arguement Configuration | ||
Then you need to define the arguments that you would like to pass in the model: | ||
|
||
#### LSTM Bucketing | ||
```bash | ||
--data-train | ||
<path>/sherlockholmes.train.txt | ||
--data-val | ||
<path>/sherlockholmes.valid.txt | ||
--cpus | ||
<num_cpus> | ||
--gpus | ||
<num_gpu> | ||
``` | ||
#### TrainCharRnn | ||
```bash | ||
--data-path | ||
<path>/obama.txt | ||
--save-model-path | ||
<path>/ | ||
``` | ||
#### TestCharRnn | ||
```bash | ||
--data-path | ||
<path>/obama.txt | ||
--model-prefix | ||
<path>/obama | ||
``` |
Oops, something went wrong.