-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbatch_script.py
More file actions
64 lines (45 loc) · 1.77 KB
/
batch_script.py
File metadata and controls
64 lines (45 loc) · 1.77 KB
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
"""
Ce fichier sert à faire tourner l'algorithme de transfer learning sur tous les ensembles deux à deux. (pas trop optimisé).
"""
import main
PATH_TO_DATA = "../data/"
CATEGORIES = ['data_books','data_videos']
"""CATEGORIES = ["data_books",
"data_videos",
"data_electronics",
"data_clothes",
"data_movies",
"data_cds",
"data_cellphones",
"data_health",
"data_kindle",
"data_digitalmusic",
"data_musicinstruments",
"data_sport",
"data_toys",
"data_baby",
"data_apps",
"data_office",
"data_tools"]"""
for categorie1 in CATEGORIES:
ORIGIN_FOLDER_1 = PATH_TO_DATA + categorie1
print("\n################################")
print("## ##")
print("## LEARNING FROM DATASET 1 ## " + ORIGIN_FOLDER_1)
print("## ##")
print("################################")
TRAINING_SET_FOLDER_1 = PATH_TO_DATA + categorie1 + "_training_set"
TESTING_SET_FOLDER_1 = PATH_TO_DATA + categorie1 + "_testing_set"
model1 = main.createModelsAndLearn(TRAINING_SET_FOLDER_1,TESTING_SET_FOLDER_1)
main.testModels(model1, TESTING_SET_FOLDER_1)
for categorie2 in CATEGORIES:
ORIGIN_FOLDER_2 = PATH_TO_DATA + categorie2
TRAINING_SET_FOLDER_2 = PATH_TO_DATA + categorie2 + "_training_set"
TESTING_SET_FOLDER_2 = PATH_TO_DATA + categorie2 + "_testing_set"
print("\n################################")
print("## ##")
print("## TRANSFER LEARNING (1->2) ## " + ORIGIN_FOLDER_1 + " --> " + ORIGIN_FOLDER_2)
print("## ##")
print("################################")
#model2 = main.transferLearn(model1, TRAINING_SET_FOLDER_2) # <---- Difference here!!
main.testModels(model1, TESTING_SET_FOLDER_2)