A sample program to run a bidirectional LSTM with TensorFlow.
This demo trains a bidirectional LSTM on the Sonar dataset (sonar.csv) and reports classification accuracy. It is intended as a minimal, runnable reference for building bidirectional LSTM models with TensorFlow and Keras.
- Python 3 (tested on Python 3.9.13)
- Dependencies:
tensorflow,pandas,scikit-learn,matplotlib
Install them with:
pip install -r requirements.txt
Run the script from a console or IDE:
python3 test-fhe.py
- The dataset used for analysis is
sonar.csv. - A sample run is captured in
out.txtand the accuracy plot inFigure_1.png.
auto4mat.py is an optional helper that upgrades Python syntax and formats the code (using pyupgrade, black, isort) and regenerates requirements.txt (using pipreqs):
pip install pyupgrade black isort pipreqs
python3 auto4mat.py
If you use this software, please cite it using the metadata in CITATION.cff.
Distributed under the GNU General Public License v3.0. See LICENSE.