Usage of DeepMutation++
Usage of DeepMutation++
Use cnn_mutation/src/generator.py
to generate FNN mutant.
python generator.py [-model_path FILE] [-operator INT] [-ratio FLOAT]
[-save_path DIR] [-num INT] [-data_type STRING]
[-threshold FLOAT] [-standard_deviation FLOAT]
optional arguments:
-model_path: original model path
-operator: mutation operator
-ratio: mutation ratio
-save_path: mutants save path
-num: mutants generation number
-data_type: mnist or cifar-10
-threshold: mutant accuracy > original mutant * threshold
-standard_deviation: Gaussian fuzzing standard deviation
Use rnn_mutation/src/runner.py
to generate RNN mutant.
python runner.py [-operator_type STRING] [-model_path FILE] [-save_path DIR]
[-operator INT] [-single_data_path FILE] [-layer_type STRING]
[-layer_name STRING] [-ratio FLOAT]
[-gate_type INT] [-precision_num INT] [-time_start_step INT]
[-standard_deviation FLOAT] [-time_stop_step INT]
[-csv_path FILE] [-num INT] [-acc_threshold FLOAT]
optional arguments:
-operator_type: static or dynamic
-model_path: original model path
-save_path: model save path (static)
-operator: operator select
-single_data_path: dynamic time step mutation data (dynamic)
-layer_type: lstm or gru
-layer_name: lstm layer name
-ratio: mutant ratio, default 0.01
-gate_type: gate type, default 0
LSTM gate type: GRU gate type:
0. input 0. update
1. forget 1. reset
2. cell candidate 2. cell candidate
3. output 3. all gates
4. all gates
-precision_num: precision remain number, default 0
-standard_deviation: for gaussian fuzzing, default 0.0
-time_stop_step: stop at which time step, default 0 (dynamic)
-time_start_step: re-start at which time step (for operator state reset), default 0 (dynamic)
-csv_path: dynamic testing results save path (static)
-num: index of mutants (static)
-acc_threshold: accuracy threshold
Call API sort_data
or use command line (default dataset MNIST) to generate reports.
API sort_data(ori_model_path, mutants_path, x, y, save_path)
"""
:param ori_model_path: path of the original model
:param mutants_path: path of the mutants folder
:param x: test data
:param y: label of x
:param save_path: report save path
"""
python sort_data.py [-model_path FILE] [-mutants_path FOLDER] [-model_path FILE]
Use rnn_mutation/src/sort_data.py
to generate reports.
python sort_segment.py [-csv_path FILE] [-save_path FILE] [-column INT]
optional arguments:
-csv_path: the scv file path which saves the results
-save_path: path of the report
-column: data is stored in which column