88from statistics import mean ,stdev
99
1010all_data = dict ()
11- with open ('papni_sequances .pickle' ,'rb' )as handle :
11+ with open ('papni_sequences .pickle' ,'rb' )as handle :
1212all_data = pickle .load (handle )
1313
1414
@@ -59,21 +59,21 @@ def evaluate_model(learned_model, test_data):
5959return [rpni_model .size ,papni_model .size ,rpni_error ,papni_error ]
6060
6161
62- def get_sequances_from_active_sevpa (model ):
62+ def get_sequences_from_active_sevpa (model ):
6363from aalpy import SUL ,run_KV ,RandomWordEqOracle ,SevpaAlphabet
6464
6565class CustomSUL (SUL ):
6666def __init__ (self ,automatonSUL ):
6767super (CustomSUL ,self ).__init__ ()
6868self .sul = automatonSUL
69- self .sequances = []
69+ self .sequences = []
7070
7171def pre (self ):
7272self .tc = []
7373self .sul .pre ()
7474
7575def post (self ):
76- self .sequances .append (self .tc )
76+ self .sequences .append (self .tc )
7777self .sul .post ()
7878
7979def step (self ,letter ):
@@ -91,7 +91,7 @@ def step(self, letter):
9191# eq_oracle = BreadthFirstExplorationEqOracle(vpa_alphabet.get_merged_alphabet(), sul, 7)
9292_ = run_KV (alphabet ,sul ,eq_oracle ,automaton_type = 'vpa' ,print_level = 3 )
9393
94- return convert_i_o_traces_for_RPNI (sul .sequances )
94+ return convert_i_o_traces_for_RPNI (sul .sequences )
9595
9696
9797def split_data_to_learning_and_testing (data ,learning_to_test_ratio = 0.5 ):
@@ -104,20 +104,20 @@ def split_data_to_learning_and_testing(data, learning_to_test_ratio=0.5):
104104# sorted(data, key=lambda x: len(x[0]))
105105shuffle (data )
106106
107- learning_sequances , test_sequances = [], []
107+ learning_sequences , test_sequences = [], []
108108
109109l_pos ,l_neg = 0 ,0
110110for seq ,label in data :
111111if label and l_pos <= num_learning_positive_seq :
112- learning_sequances .append ((seq ,label ))
112+ learning_sequences .append ((seq ,label ))
113113l_pos += 1
114114elif not label and l_neg <= num_learning_negative_seq :
115- learning_sequances .append ((seq ,label ))
115+ learning_sequences .append ((seq ,label ))
116116l_neg += 1
117117else :
118- test_sequances .append ((seq ,label ))
118+ test_sequences .append ((seq ,label ))
119119
120- return learning_sequances , test_sequances
120+ return learning_sequences , test_sequences
121121
122122
123123def run_experiment (experiment_id ,
@@ -128,7 +128,7 @@ def run_experiment(experiment_id,
128128learning_to_test_ratio = 0.5 ):
129129if random_data_generation :
130130data = generate_input_output_data_from_vpa (ground_truth_model ,
131- num_sequances = num_of_learning_seq ,
131+ num_sequences = num_of_learning_seq ,
132132max_seq_len = max_learning_seq_len ,
133133 )
134134else :
@@ -150,7 +150,7 @@ def run_experiment(experiment_id,
150150# wm_negative += 1
151151# print(wm_negative)
152152
153- # data =get_sequances_from_active_sevpa (ground_truth_model)
153+ # data =get_sequences_from_active_sevpa (ground_truth_model)
154154
155155vpa_alphabet = ground_truth_model .get_input_alphabet ()
156156