- spot
- pytorch
- tensorboard
- graphviz
install the graphviz with the following command.
apt install graphviz
The following command will start training with the best hyper-parameters and will evaluate the FSM obtained from the above training process.
python -u train.py --tag=0 --data_dir=data_ori_split10_neg3 --k_g=5 --K=10 --val_k=0 --lr=1e-2 --neighbor_init=1 --faithfula1=2 --faithfula2=0.8 --generate_neg=1 --sample_unlabel=1 --generate_test_neg=0 --generate_valid_neg=1 --no_valid=0 --save_best=1 --w_loss_pos=128 --num_models=1024 --gpu=1 --seed=1 --postprocess1=1 --postprocess2=1 --postprocess3=1
The following command will evaluate the FSM obtained from the above training process:
python cmp_2fsa.py --tag=0 --test_case=100
convert the obtained FSM to graph:
python convert_fsa_to_dot.py --tag=0
This is the main script for training neural network and interpreting FSM from neural network.
The arguments are as follows.
--tag
An integer used as ID for every experiment. The output FSMs of experiment with --tag=0
will be saved in model/0/
.
--data_dir
The path to the dataset.
--samples
An integer determines the number of epoch in the training process. With --samples=n
and a dataset with
--k_g
It is
--batch_size
Batch size for training neural network.
--lr
Learning rate for training neural network.
--K
Number of pieces of data. We divide the data into 10 pieces, so set it to 10.
--val_k
The pieces of data to be used as test set.
--faithfula1
It is
--faithfula2
It is
--generate_neg
Set to
--neighbor_init
Set to
--postprocess2
post-process, Set to
--postprocess2
post-process, Set to
--postprocess3
post-process, Set to
This is the main script for evaluating FSM.
The arguments are as follows.
--tag
An integer used as ID for every experiment.
--data_dir
The path to the dataset.
--test_case
Number of samples for evaluating.
--val_k
The pieces of data to be used as test set.
The folder data_ori_split10_neg3
contains all data used in our evaluation.
data_ori_split10_neg3/*/gt_fsm.txt
are the ground truth FSMs.
data_ori_split10_neg3/*/input.txt
are the original traces.
data_ori_split10_neg3/*/input.json
are the original traces in JSON format that our model can use as input. They are divided into data_ori_split10_neg3/*/input_[0-9].json
.
data_ori_split10_neg3/*/input_train_valk[0-9].json
are the union of all traces except valk.
Please consider citing the following paper if you find our codes helpful. Thank you!