forked from a061105/ExtremeMulticlass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
104 lines (79 loc) · 4.2 KB
/
Makefile
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
all: multiTrain multiTrainHash multiPred
#.PHONY: multiTrain multiTrainHash multiPred
multiTrain:
g++ -fopenmp -std=c++11 -O3 -o multiTrain multiTrain.cpp
multiTrainHash:
g++ -fopenmp -std=c++11 -O3 -o multiTrainHash multiTrain.cpp -DUSING_HASHVEC
multiPred:
g++ -fopenmp -std=c++11 -O3 -o multiPred multiPred.cpp
clean:
rm -f multiTrain
rm -f multiTrainHash
rm -f multiPred
#parameters
output_model=model
data_dir=/scratch/cluster/xrhuang/data
train_file=
heldout_file=
test_file=
misc=
.SECONDEXPANSION:
#multilabel datasets
LSHTCwiki_original: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 0.01" output_model="LSHTCwiki.model" misc="-d"
AmazonCat-13K: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 1e-3" output_model="AmazonCat-13K.model.l1e-3" misc="-d -e 10" speed_up_rate="-r 1"
WikipediaLarge-500K: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 1e-1" output_model="$@.model.l1e-1" misc="-d -e 3"
AmazonCat-13K.scale: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 1e-2" output_model="AmazonCat-13K.scale.model.l1e-2" misc="-d -e 3"
Bibtex: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 1" output_model="Bibtex.model.l1" misc="-d -e 20"
rcv1_regions: examples/$$@/
$(eval base := examples/$@/$@)
make train_without_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test split_up_rate="-q 3"
bibtex: examples/$$@/
$(eval base := examples/$@/$@)
make train_without_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test sample_option="-u" early_terminate="-e 10" speed_up_rate="-r 1" lambda="-l 1"
Eur-Lex: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 0.001" early_terminate="-e 10"
#multiclass datasets
sector: examples/$$@/
$(eval base := examples/$@/$@)
make train_without_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test
aloi.bin: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 0.01"
Dmoz: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test split_up_rate="-q 3"
LSHTC1: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test lambda="-l 0.01" split_up_rate="-q 3" early_terminate="-e 3"
imageNet: examples/$$@/
$(eval base := examples/$@/$@)
make train_with_hash train_file=$(base).train heldout_file=$(base).heldout test_file=$(base).test split_up_rate="-q 3"
train_without_hash: multiTrain multiPred $(train_file) $(heldout_file) $(test_file)
./multiTrain $(cost) $(lambda) $(solver) $(speed_up_rate) $(early_terminate) $(max_iter) $(split_up_rate) $(max_select) $(post_train_iter) $(sample_option) $(misc) -h $(heldout_file) $(train_file) $(output_model)
@echo "testing model before post solve"
./multiPred $(test_file) $(output_model)
ifneq ($(p), 0)
@echo "testing model after post solve"
./multiPred $(test_file) $(output_model).p
endif
train_with_hash: multiTrainHash multiPred $(train_file) $(heldout_file) $(test_file)
./multiTrainHash $(cost) $(lambda) $(solver) $(speed_up_rate) $(early_terminate) $(max_iter) $(split_up_rate) $(max_select) $(post_train_iter) $(sample_option) $(misc) -h $(heldout_file) $(train_file) $(output_model)
@echo "testing model before post solve"
./multiPred $(test_file) $(output_model)
ifneq ($(p), 0)
@echo "testing model after post solve"
./multiPred $(test_file) $(output_model).p
endif
examples/%:
make construct -C examples/ dataset=$(notdir $@)