Skip to content
Snippets Groups Projects

Vectorflow RUL prediction demo

Learning and predicting engine Remaining Useful Life (RUL) from sensor data with Vectorflow.

About Vectorflow

Vectorflow is a machine learning library for D programming language. It is very simple and straightforward compared to TensorFlow: the only dependency Vectorflow has is the D standard library. However, Vectorflow has no distributed computing support or any kind of GPU support.

Vectorflow GitHub

If you do not have D environment at hand you should follow the Setting up a D environment section in the Vectorflow readme. It is recommended to use the LDC2 compiler for the sake of runtime performance.

The neural network

You can observe the simplicity of Vectorflow by finding the declaration of the neural network, in app.d source file in the main function.

Running

Use dub to build an optimized release version of the demo

dub build -b release

The demo program is used for predicting the engine's remaining useful life (RUL) from the NASA dataset. You should supply the program two parameters when running:

./vectorflow_test --input-data PATH_TO_DATASET_DIRECTORY --output-file PREDICTED_RESULTS_OUTPUT

PATH_TO_DATASET_DIRECTORY should be the path to the directory containing train_FD001.txt and test_FD001.txt datasets. PREDICTED_RESULTS_OUTPUT should be the desired name of the output file for predicted RULs for test data.

The program will train the neural network for a few epochs. If the program was built with LDC2 compiler and in release mode, the training process should only take a few seconds. After training the net, predictions will be written to the output file. You can visualize the results if you have gnuplot installed:

gnuplot -p -e 'plot "output_results" with lines, "dataset_directory/RUL_FD001.txt" with lines'

Results

The above graph displays the predicted RUL compared with the actual values.

Results scatter

The diagram above displays points with predicted value as the x coordinate and real RUL as the y coordinate. In the ideal situation all the data points would lie on the x = y line.