-
Notifications
You must be signed in to change notification settings - Fork 249
/
run_IJCAI_19_CFM_CNN_embedding.py
630 lines (437 loc) · 27.9 KB
/
run_IJCAI_19_CFM_CNN_embedding.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 20/06/2019
@author: Maurizio Ferrari Dacrema
"""
import os, argparse, traceback, shutil
import numpy as np
from Base.DataIO import DataIO
from CNN_on_embeddings.IJCAI.CFM_our_interface.FMWrapper import FM_Wrapper
from CNN_on_embeddings.IJCAI.CFM_our_interface.CFMWrapper import CFM_wrapper
from CNN_on_embeddings.IJCAI.CFM_our_interface.Dataset_wrapper import DatasetCFMReader
from Utils.assertions_on_data_for_experiments import assert_implicit_data, assert_disjoint_matrices
from Utils.ResultFolderLoader import ResultFolderLoader
from CNN_on_embeddings.run_CNN_embedding_evaluation_ablation import run_evaluation_ablation
from ParameterTuning.SearchAbstractClass import SearchInputRecommenderArgs
from ParameterTuning.SearchSingleCase import SearchSingleCase
from CNN_on_embeddings.read_CNN_embedding_evaluation_results import read_permutation_results
from functools import partial
import multiprocessing
from Recommender_import_list import *
from ParameterTuning.run_parameter_search import runParameterSearch_Collaborative
import tensorflow as tf
from CNN_on_embeddings.IJCAI.CFM_our_interface.CFM import _get_interaction_map
# prediction model
class CFM_assert:
def __init__(self, n_factors, map_mode = "full_map"):
self.map_mode = map_mode
self.embedding_x = tf.placeholder(tf.float64, shape=[None, 1, n_factors], name='embedding_x')
self.embedding_y = tf.placeholder(tf.float64, shape=[None, 1, n_factors], name='embedding_y')
self.relation = tf.matmul(tf.transpose(self.embedding_x, perm=[0, 2, 1]), self.embedding_y)
self.relation = _get_interaction_map(self.relation, map_mode)
def get_FM_hyperparameters_for_dataset(dataset_name):
if dataset_name == 'lastfm':
article_hyperparameters = {
'pretrain_flag': -1,
'hidden_factor': 64,
'epochs': 500,
'batch_size': 256,
'learning_rate': 0.01,
'lamda_bilinear': 0,
'keep': 0.8,
'optimizer_type': 'AdagradOptimizer',
'batch_norm': 0,
'permutation': None,
'verbose': 0,
'random_seed': 2016,
'temp_file_folder': None,
}
else:
raise ValueError("Invalid dataset name")
return article_hyperparameters
def pretrain_FMwrapper(URM_train_tuning_only,
URM_train_full,
evaluator_validation,
evaluator_test,
CFM_data_class_validation,
CFM_data_class_full,
result_folder_path:str,
# hidden_factors:int,
metric_to_optimize:str,
dataset_name):
# search best epoch
article_hyperparameters = get_FM_hyperparameters_for_dataset(dataset_name)
earlystopping_keywargs = {
"validation_every_n": 5,
"stop_on_validation": True,
"lower_validations_allowed": 5,
"evaluator_object": evaluator_validation,
"validation_metric": metric_to_optimize
}
parameterSearch = SearchSingleCase(FM_Wrapper,
evaluator_validation=evaluator_validation,
evaluator_test=evaluator_test)
recommender_input_args = SearchInputRecommenderArgs(CONSTRUCTOR_POSITIONAL_ARGS=[URM_train_tuning_only, CFM_data_class_validation],
FIT_KEYWORD_ARGS=earlystopping_keywargs)
recommender_input_args_last_test = SearchInputRecommenderArgs(CONSTRUCTOR_POSITIONAL_ARGS=[URM_train_full, CFM_data_class_full])
parameterSearch.search(recommender_input_args,
recommender_input_args_last_test=recommender_input_args_last_test,
fit_hyperparameters_values=article_hyperparameters,
output_folder_path=result_folder_path,
output_file_name_root=FM_Wrapper.RECOMMENDER_NAME,
save_model = "last",
resume_from_saved=True,
evaluate_on_test = "last")
def get_new_permutation(output_folder_path, permutation_index, embedding_size):
# If directory does not exist, create
if not os.path.exists(output_folder_path + "permutations/"):
os.makedirs(output_folder_path + "permutations/")
try:
permutation = np.load(output_folder_path + "permutations/permutation_{}.npy".format(permutation_index))
except FileNotFoundError:
permutation = np.arange(embedding_size)
np.random.shuffle(permutation)
np.save(output_folder_path + "permutations/permutation_{}".format(permutation_index), permutation)
assert not np.all(permutation == np.arange(embedding_size)), "Permutation not correct"
return permutation
def run_permutation_pretrained_FM(URM_train_full, CFM_data_class_full, pretrained_model_folder_path, result_folder_path, permutation_index, permutation):
result_folder_path_permutation = result_folder_path + "{}/{}_{}/".format("FM", "FM", permutation_index)
# Read the pretraining data and put the permutation in it
recommender_object = FM_Wrapper(URM_train_full, CFM_data_class_full)
file_name_input = recommender_object.RECOMMENDER_NAME + "_best_model_last"
file_name_output = recommender_object.RECOMMENDER_NAME
if os.path.exists(result_folder_path_permutation + file_name_output + "_metadata.zip"):
return
result_folder_path_temp = result_folder_path_permutation + "__temp_model/"
# If directory does not exist, create
if not os.path.exists(result_folder_path_temp):
os.makedirs(result_folder_path_temp)
recommender_object.load_model(pretrained_model_folder_path, file_name_input)
recommender_object.save_model(result_folder_path_temp, file_name_output)
# Alter saved object to force in the desired permutation
dataIO = DataIO(folder_path = result_folder_path_temp)
data_dict = dataIO.load_data(file_name = file_name_output)
data_dict["permutation"] = permutation
dataIO.save_data(file_name = file_name_output, data_dict_to_save = data_dict)
recommender_object = FM_Wrapper(URM_train_full, CFM_data_class_full)
recommender_object.load_model(result_folder_path_temp,
file_name=file_name_output)
results_dict, results_run_string = evaluator_test.evaluateRecommender(recommender_object)
shutil.rmtree(result_folder_path_temp, ignore_errors=True)
result_file = open(result_folder_path_permutation + file_name_output + ".txt", "w")
result_file.write(results_run_string)
result_file.close()
results_dict = {"result_on_last": results_dict}
dataIO = DataIO(folder_path = result_folder_path_permutation)
dataIO.save_data(file_name = file_name_output + "_metadata",
data_dict_to_save = results_dict)
def run_train_with_early_stopping(URM_train_tuning_only,
URM_train_full,
evaluator_validation,
evaluator_test,
CFM_data_class_validation,
CFM_data_class_full,
pretrained_FM_folder_path,
output_folder_path,
permutation_index,
map_mode,
metric_to_optimize):
output_folder_path_permutation = output_folder_path + "fit_ablation_{}/{}_{}/".format(map_mode, map_mode, permutation_index)
# If directory does not exist, create
if not os.path.exists(output_folder_path_permutation):
os.makedirs(output_folder_path_permutation)
if os.path.isfile(output_folder_path_permutation + CFM_wrapper.RECOMMENDER_NAME + "_metadata.zip"):
return
article_hyperparameters = {
'pretrain_flag': 1,
'pretrained_FM_folder_path': pretrained_FM_folder_path,
'hidden_factor': 64,
'epochs': 300,
'batch_size': 256,
'learning_rate': 0.01,
'lamda_bilinear': 0,
'keep': 0.8,
'optimizer_type': 'AdagradOptimizer',
'batch_norm': 0,
'verbose': False,
'regs': '[10,1]',
'attention_size': 32,
'attentive_pooling': False,
'net_channel': '[32,32,32,32,32,32]',
'num_field': 4,
'permutation': list(permutation),
'map_mode': map_mode
}
earlystopping_hyperparameters = {
"epochs_min": int(article_hyperparameters["epochs"]/2),
"validation_every_n": 5,
"stop_on_validation": True,
"lower_validations_allowed": 5,
"evaluator_object": evaluator_validation,
"validation_metric": metric_to_optimize
}
# Due to the extremely long evaluation time it is computationally too expensive to run earlystopping on all
# permutations (estimated >60 days on high end GPU)
# So, select the epochs only at permutation 0 independently for each of the three modes: "all_map", "main_diagonal", "off_diagonal"
# try to load selected number of epochs, if not present run earlystopping again
folder_permutation_0 = output_folder_path + "fit_ablation_{}/{}_{}/".format(map_mode, map_mode, 0)
if permutation_index == 0:
parameterSearch = SearchSingleCase(CFM_wrapper,
evaluator_validation=evaluator_validation,
evaluator_test=evaluator_test)
recommender_input_args = SearchInputRecommenderArgs(CONSTRUCTOR_POSITIONAL_ARGS=[URM_train_tuning_only, CFM_data_class_validation],
FIT_KEYWORD_ARGS=earlystopping_hyperparameters)
recommender_input_args_last_test = SearchInputRecommenderArgs(CONSTRUCTOR_POSITIONAL_ARGS=[URM_train_full, CFM_data_class_full])
parameterSearch.search(recommender_input_args,
recommender_input_args_last_test=recommender_input_args_last_test,
fit_hyperparameters_values=article_hyperparameters,
output_folder_path=output_folder_path_permutation,
output_file_name_root=CFM_wrapper.RECOMMENDER_NAME,
save_model = "last",
resume_from_saved=True,
evaluate_on_test = "last")
else:
dataIO = DataIO(folder_path = folder_permutation_0)
data_dict = dataIO.load_data(file_name = CFM_wrapper.RECOMMENDER_NAME + "_metadata.zip")
selected_epochs = data_dict["hyperparameters_best"]["epochs"]
article_hyperparameters["epochs"] = selected_epochs
parameterSearch = SearchSingleCase(CFM_wrapper,
evaluator_validation=evaluator_test,
evaluator_test=evaluator_test)
recommender_input_args_last_test = SearchInputRecommenderArgs(CONSTRUCTOR_POSITIONAL_ARGS=[URM_train_full, CFM_data_class_full])
parameterSearch.search(recommender_input_args_last_test,
recommender_input_args_last_test=None,
fit_hyperparameters_values=article_hyperparameters,
output_folder_path=output_folder_path_permutation,
output_file_name_root=CFM_wrapper.RECOMMENDER_NAME,
save_model = "best",
resume_from_saved=True,
evaluate_on_test = "best")
# Get the data in the correct format to be readable for the data parsing script
# Put the results in the "result_on_last" field of the metadata file
# Change the final model file name into the _best_model_last suffix
metadata_file_name = CFM_wrapper.RECOMMENDER_NAME + "_metadata.zip"
dataIO = DataIO(folder_path = output_folder_path_permutation)
search_metadata = dataIO.load_data(file_name = metadata_file_name)
search_metadata["result_on_last"] = search_metadata["result_on_test_best"]
dataIO.save_data(file_name = metadata_file_name, data_dict_to_save = search_metadata)
recommender_object = CFM_wrapper(URM_train_full, CFM_data_class_full)
recommender_object.load_model(output_folder_path_permutation,
file_name=CFM_wrapper.RECOMMENDER_NAME + "_best_model")
recommender_object.save_model(output_folder_path_permutation,
file_name=CFM_wrapper.RECOMMENDER_NAME + "_best_model_last")
if __name__ == '__main__':
ALGORITHM_NAME = "CFM"
CONFERENCE_NAME = "IJCAI"
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--dataset_name', help = "Dataset name", type = str, default = "lastfm")
parser.add_argument('-p', '--run_fit_ablation', help = "Run permutation and Study 1 experiments", type = bool, default = True)
parser.add_argument('-a', '--run_eval_ablation', help = "Run Study 2 experiments", type = bool, default = True)
parser.add_argument('-b', '--run_baselines', help = "Run hyperparameter tuning", type = bool, default = True)
parser.add_argument('-n', '--n_permutations', help = "Number of permutations", type = int, default = 20)
input_flags = parser.parse_args()
print(input_flags)
output_folder_path = "result_experiments/{}/{}/".format(ALGORITHM_NAME, input_flags.dataset_name)
dataset = DatasetCFMReader(output_folder_path + "data/", input_flags.dataset_name)
print ('Current dataset is: {}'.format(input_flags.dataset_name))
"""
WARNING: Due to how the data reader of the CFM original implementation works, the indices of the features
associated to each user are not those contained in the file but are allocated, based on them, at runtime.
This means that changes in the ordering of the file will produce different, although equivalent, data structures.
Because of this the data structures used during the validation phase are incompatible with those used during the test phase.
Since the validation phase is only necessary for the selection of the epochs and no part of the model is used for the
subsequent testing phase, this inconsistency has no impact on the results since the model will always be
trained and evaluated on consistent data.
"""
URM_train_tuning_only = dataset.URM_DICT["URM_train_tuning_only"].copy()
URM_validation_tuning_only = dataset.URM_DICT["URM_validation_tuning_only"].copy()
URM_train_full = dataset.URM_DICT["URM_train_full"].copy()
URM_test_full = dataset.URM_DICT["URM_test_full"].copy()
assert_implicit_data([URM_train_tuning_only, URM_train_full, URM_validation_tuning_only, URM_test_full])
assert_disjoint_matrices([URM_train_tuning_only, URM_validation_tuning_only])
assert_disjoint_matrices([URM_train_full, URM_test_full])
from Base.Evaluation.Evaluator import EvaluatorHoldout
cutoff_list_validation = [10]
cutoff_list_test = [5, 10, 20]
metric_to_optimize = "NDCG"
evaluator_validation = EvaluatorHoldout(URM_validation_tuning_only, cutoff_list=cutoff_list_validation)
evaluator_test = EvaluatorHoldout(URM_test_full, cutoff_list=cutoff_list_test)
################################################################################################################################################
###############################
############################### HYPERPARAMETER TUNING BASELINES
###############################
################################################################################################################################################
collaborative_algorithm_list = [
Random,
TopPop,
UserKNNCFRecommender,
ItemKNNCFRecommender,
P3alphaRecommender,
RP3betaRecommender,
PureSVDRecommender,
NMFRecommender,
MatrixFactorization_BPR_Cython,
MatrixFactorization_FunkSVD_Cython,
IALSRecommender,
SLIMElasticNetRecommender,
SLIM_BPR_Cython,
EASE_R_Recommender,
]
n_cases = 50
n_random_starts = 15
result_baselines_folder_path = output_folder_path + "baselines/"
hyperparameter_search_collaborative_partial = partial(runParameterSearch_Collaborative,
URM_train = URM_train_tuning_only,
URM_train_last_test = URM_train_full,
metric_to_optimize = metric_to_optimize,
evaluator_validation_earlystopping = evaluator_validation,
evaluator_validation = evaluator_validation,
evaluator_test = evaluator_test,
output_folder_path = result_baselines_folder_path,
parallelizeKNN = False,
allow_weighting = True,
n_cases = n_cases,
n_random_starts = n_random_starts,
resume_from_saved = True,
save_model = "last",
evaluate_on_test = "last")
if input_flags.run_baselines:
pool = multiprocessing.Pool(processes=3, maxtasksperchild=1)
pool.map(hyperparameter_search_collaborative_partial, collaborative_algorithm_list)
pool.close()
pool.join()
n_test_users = np.sum(np.ediff1d(URM_test_full.indptr)>=1)
file_name = "{}..//{}_{}_".format(result_baselines_folder_path, ALGORITHM_NAME, input_flags.dataset_name)
KNN_similarity_to_report_list = ["cosine", "dice", "jaccard", "asymmetric", "tversky"]
result_loader = ResultFolderLoader(result_baselines_folder_path,
base_algorithm_list = None,
other_algorithm_list = [CFM_wrapper],
KNN_similarity_list = KNN_similarity_to_report_list,
ICM_names_list = None,
UCM_names_list = None)
result_loader.generate_latex_results(file_name + "{}_latex_results.txt".format("article_metrics"),
metrics_list = ["HIT_RATE", "NDCG"],
cutoffs_list = cutoff_list_test,
table_title = None,
highlight_best = True)
result_loader.generate_latex_time_statistics(file_name + "{}_latex_results.txt".format("time"),
n_evaluation_users=n_test_users,
table_title = None)
################################################################################################################################################
###############################
############################### PRETRAINING FACTORIZATION MACHINE
###############################
################################################################################################################################################
pretrain_folder_path = output_folder_path + "pretrained_model_data/".format(input_flags.dataset_name)
pretrain_FMwrapper(URM_train_tuning_only = URM_train_tuning_only,
URM_train_full = URM_train_full,
evaluator_validation = evaluator_validation,
evaluator_test = evaluator_test,
CFM_data_class_validation = dataset.CFM_data_class_validation,
CFM_data_class_full = dataset.CFM_data_class_full,
result_folder_path = pretrain_folder_path,
metric_to_optimize = metric_to_optimize,
dataset_name = input_flags.dataset_name)
################################################################################################################################################
###############################
############################### Test code on fake object to verify the alterations to the interaction map do what they are supposed to
###############################
################################################################################################################################################
mu, sigma = 0, 0.1 # mean and standard deviation
n_factors = 64
embedding_X = np.random.normal(mu, sigma, (1, 1, n_factors))
embedding_Y = np.random.normal(mu, sigma, (1, 1, n_factors))
CFM_assert_object = CFM_assert(n_factors, map_mode ="full_map")
with tf.Session() as session:
result_all_map = session.run(CFM_assert_object.relation, feed_dict={
CFM_assert_object.embedding_x: embedding_X,
CFM_assert_object.embedding_y: embedding_Y
})
CFM_assert_object = CFM_assert(n_factors, map_mode ="main_diagonal")
with tf.Session() as session:
result_main_diag = session.run(CFM_assert_object.relation, feed_dict={
CFM_assert_object.embedding_x: embedding_X,
CFM_assert_object.embedding_y: embedding_Y
})
CFM_assert_object = CFM_assert(n_factors, map_mode ="off_diagonal")
with tf.Session() as session:
result_off_diag = session.run(CFM_assert_object.relation, feed_dict={
CFM_assert_object.embedding_x: embedding_X,
CFM_assert_object.embedding_y: embedding_Y
})
result_all_map = result_all_map.squeeze()
result_main_diag = result_main_diag.squeeze()
result_off_diag = result_off_diag.squeeze()
assert np.allclose(result_main_diag.diagonal(), result_all_map.diagonal()), "two operations have different diagonal"
assert np.allclose(result_main_diag, np.diag(result_main_diag.diagonal())), "result_main_diag has off diagonal elements"
assert not np.allclose(result_all_map, np.diag(result_all_map.diagonal())), "result_all_map has NO off diagonal elements"
assert np.allclose(result_all_map, result_main_diag + result_off_diag), "triangular composition non consistent"
###############################################################################################################################################
##############################
############################## PERMUTATION EXPERIMENT
##############################
############################## FIT ABLATION EXPERIMENT
##############################
###############################################################################################################################################
article_hyperparameters = get_FM_hyperparameters_for_dataset(input_flags.dataset_name)
embedding_size = article_hyperparameters["hidden_factor"]
if input_flags.run_fit_ablation:
for permutation_index in range(input_flags.n_permutations):
try:
# Get new permutation array
permutation = get_new_permutation(output_folder_path, permutation_index, embedding_size)
## Evaluate permutated pretraining model
run_permutation_pretrained_FM(URM_train_full = URM_train_full,
CFM_data_class_full = dataset.CFM_data_class_full,
pretrained_model_folder_path = pretrain_folder_path,
result_folder_path = output_folder_path,
permutation_index = permutation_index,
permutation = permutation)
### Fit model with the different interaction map modes
for map_mode in ["all_map", "main_diagonal", "off_diagonal"]:
run_train_with_early_stopping(URM_train_tuning_only = URM_train_tuning_only,
URM_train_full = URM_train_full,
evaluator_validation = evaluator_validation,
evaluator_test = evaluator_test,
CFM_data_class_validation = dataset.CFM_data_class_validation,
CFM_data_class_full = dataset.CFM_data_class_full,
pretrained_FM_folder_path = pretrain_folder_path + FM_Wrapper.RECOMMENDER_NAME + "_best_model_last",
output_folder_path = output_folder_path,
permutation_index = permutation_index,
map_mode = map_mode,
metric_to_optimize = metric_to_optimize)
except:
traceback.print_exc()
read_permutation_results(output_folder_path, input_flags.n_permutations, 10,
["NDCG", "HIT_RATE"],
file_result_name_root = "latex_fit_ablation_results",
convolution_model_name = CFM_wrapper.RECOMMENDER_NAME,
pretrained_model_name = 'FM',
pretrained_model_class = FM_Wrapper,
experiment_type = "fit_ablation")
################################################################################################################################################
###############################
############################### EVALUATION ABLATION EXPERIMENT
###############################
################################################################################################################################################
if input_flags.run_eval_ablation:
for permutation_index in range(input_flags.n_permutations):
# Run evaluation of the full map fitted model with the different interaction map modes
for map_mode in ["all_map", "main_diagonal", "off_diagonal"]:
input_folder_path = os.path.join(output_folder_path, "fit_ablation_{}/{}_{}/".format("all_map", "all_map", permutation_index))
result_folder_path = os.path.join(output_folder_path, "evaluation_ablation_{}/{}_{}/".format(map_mode, map_mode, permutation_index))
recommender_input_args_last_test = SearchInputRecommenderArgs(CONSTRUCTOR_POSITIONAL_ARGS=[URM_train_full, dataset.CFM_data_class_full])
run_evaluation_ablation(recommender_class = CFM_wrapper,
recommender_input_args = recommender_input_args_last_test,
evaluator_test = evaluator_test,
input_folder_path = input_folder_path,
result_folder_path = result_folder_path,
map_mode = map_mode)
read_permutation_results(output_folder_path, input_flags.n_permutations, 10,
["NDCG", "HIT_RATE"],
file_result_name_root = "latex_evaluation_ablation_results",
convolution_model_name = CFM_wrapper.RECOMMENDER_NAME,
pretrained_model_name = 'FM',
pretrained_model_class = FM_Wrapper,
experiment_type = "evaluation_ablation")