Install pytorch
and tensorboardX
first.
Clone this repo:
git clone https://github.com/HanjiangHu/ANC-LSTM-fault-detection.git
This repo has been well organized with dataset in dataset
folder and pretrained models in outputs
folder, where the experimental results could be easily reproduced or extended for further research.
The training set and validation set are randomly spilt and each sequential sample is formatted in json
with the inputs collected from the real-time system and the corresponding labels.
To train the ANC-LSTM model for the first time use the following command under the root
path of the repo.
python train.py --name ANC_LSTM
For the vanilla-LSTM model without ANC module for the comparison experiment,
python train.py --name vanilla_LSTM --att_dim 0
To ine-tune the pretrained model at XXX
iteration,
python train.py --name ANC_LSTM --continue_train --checkpoint_epoch XXX
For more details about the settings of training,
python train.py -h
To validate the pretrained ANC-LSTM or vanilla LSTM model at XXX
iteration on the validation set,
python validate.py --name ANC_LSTM --checkpoint_epoch XXX
python validate.py --name vanilla_LSTM --checkpoint_epoch XXX --att_dim 0
For the real-time implementation in C/C++, get the input vector from the system at the end of each control period first. Then use python.h
to use the functions in the validate.py
given the real-time input to infer the real-time sequential classification results with confidence.
Our paper will be available soon and welcome to our lab if you are interested in conducting more research with soft manipulator.