-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
99 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
## Stand-Alone Stateful RNN Tests | ||
# Stand-Alone Stateful RNN Tests | ||
|
||
This is a set of tests that is not part of the frugally-deep unit tests. These test the functionality of the stateful property for RNNs (e.g., LSTMs, GRUs, and bidirectional variants). This requires multiple calls to `model.stateful_predict()` to test and that is why it is not covered by the standard unit tests which only verify test vectors for a single call to `model.predict()` or `model.stateful_predict()`. | ||
|
||
To execute this test, just run the following commands: | ||
|
||
```bash | ||
mkdir models | ||
g++ -I../../include -std=c++14 -O3 stateful_recurrent_tests.cpp -o stateful_recurrent_tests_cppts | ||
g++ -I../../include -std=c++14 -O3 stateful_recurrent_tests.cpp -o stateful_recurrent_tests_cpp | ||
python3 stateful_recurrent_tests.py | ||
``` | ||
|
||
This does the following: | ||
|
||
1. Runs a series of RNN models in Keras and stores the models and some test vectors in the `models` subdirectory. | ||
2. Runs the `../../keras_export/convert_model.py ` script to convert all of the generated Keras models. The resulting json files also are written to the `models` subdirectory. | ||
3. Compiles and runs `stateful_recurrent_tests.cpp` which loads each of the json model files and generates test vectors using frugrally-deep that correspond to those in step 1. | ||
3. Compiles and runs `stateful_recurrent_tests.cpp` which loads each of the json model files and generates test vectors using frugrally-deep that correspond to those in step 1. | ||
4. Compares the test vectors from Keras and frugally-deep to report PASS/FAIL on the tests. | ||
|
||
The main Python script also creates the models directory as needed and clears it at the start of its execution. |
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
Binary file not shown.