forked from decile-team/jensen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
135 lines (113 loc) · 5.34 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
project("Jensen")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fopenmp")
set(CMAKE_EXE_LINKER_FLAGS "-s")
endif()
# build libjensen.a
add_library(jensen
# optimization/contFunctions
src/optimization/contFunctions/ContinuousFunctions.cc
src/optimization/contFunctions/L2LogisticLoss.cc
src/optimization/contFunctions/L2SmoothSVMLoss.cc
src/optimization/contFunctions/L2SmoothSVRLoss.cc
src/optimization/contFunctions/L2LeastSquaresLoss.cc
src/optimization/contFunctions/L2ProbitLoss.cc
src/optimization/contFunctions/L2HuberSVMLoss.cc
src/optimization/contFunctions/L2HingeSVMLoss.cc
src/optimization/contFunctions/L2HingeSVRLoss.cc
src/optimization/contFunctions/L1LogisticLoss.cc
src/optimization/contFunctions/L1SmoothSVMLoss.cc
src/optimization/contFunctions/L1LeastSquaresLoss.cc
src/optimization/contFunctions/L1ProbitLoss.cc
src/optimization/contFunctions/L1HuberSVMLoss.cc
# optimization/contAlgorithms
src/optimization/contAlgorithms/gd.cc
src/optimization/contAlgorithms/gdLineSearch.cc
src/optimization/contAlgorithms/gdBarzilaiBorwein.cc
src/optimization/contAlgorithms/gdNesterov.cc
src/optimization/contAlgorithms/cg.cc
src/optimization/contAlgorithms/lbfgsMin.cc
src/optimization/contAlgorithms/lbfgsMinOwl.cc
src/optimization/contAlgorithms/tron.cc
src/optimization/contAlgorithms/sgd.cc
src/optimization/contAlgorithms/sgdDecayingLearningRate.cc
src/optimization/contAlgorithms/sgdLineSearch.cc
src/optimization/contAlgorithms/sgdAdagrad.cc
src/optimization/contAlgorithms/sgdRegularizedDualAveragingAdagrad.cc
src/optimization/contAlgorithms/sgdRegularizedDualAveraging.cc
src/optimization/contAlgorithms/sgdStochasticAverageGradient.cc
# specialized optimization/contAlgorithms
src/optimization/contAlgorithms/specialized/L1LRPrimal.cc
src/optimization/contAlgorithms/specialized/SVCDual.cc
src/optimization/contAlgorithms/specialized/SVRDual.cc
# classifiers
src/machinelearning/Classifiers.cc
src/machinelearning/logisticRegression/L1LogisticRegression.cc
src/machinelearning/logisticRegression/L2LogisticRegression.cc
src/machinelearning/SVM/L1SmoothSVM.cc
src/machinelearning/SVM/L2SmoothSVM.cc
src/machinelearning/SVM/L2HingeSVM.cc
# data representation
src/representation/Matrix.cc
src/representation/Set.cc
src/representation/VectorOperations.cc
src/representation/MatrixOperations.cc
src/representation/SparseFeature.cc
src/representation/DenseFeature.cc
src/representation/FileIO.cc
#utils
src/utils/arguments.cc
src/utils/error.cc
)
######################################### TESTS ########################################
add_executable(TestJmlr test/TestJmlr.cc)
target_link_libraries(TestJmlr jensen)
add_executable(TestL2LogisticLoss test/TestL2LogisticLoss.cc)
target_link_libraries(TestL2LogisticLoss jensen)
add_executable(TestL2LogisticLossArgs test/TestL2LogisticLossArgs.cc)
target_link_libraries(TestL2LogisticLossArgs jensen)
add_executable(TestL1LogisticLoss test/TestL1LogisticLoss.cc)
target_link_libraries(TestL1LogisticLoss jensen)
add_executable(TestL2LeastSquaresLoss test/TestL2LeastSquaresLoss.cc)
target_link_libraries(TestL2LeastSquaresLoss jensen)
add_executable(TestL1LeastSquaresLoss test/TestL1LeastSquaresLoss.cc)
target_link_libraries(TestL1LeastSquaresLoss jensen)
add_executable(TestL2HuberSVMLoss test/TestL2HuberSVMLoss.cc)
target_link_libraries(TestL2HuberSVMLoss jensen)
add_executable(TestL1HuberSVMLoss test/TestL1HuberSVMLoss.cc)
target_link_libraries(TestL1HuberSVMLoss jensen)
add_executable(TestL2ProbitLoss test/TestL2ProbitLoss.cc)
target_link_libraries(TestL2ProbitLoss jensen)
add_executable(TestL1ProbitLoss test/TestL1ProbitLoss.cc)
target_link_libraries(TestL1ProbitLoss jensen)
add_executable(TestL2SmoothSVMLoss test/TestL2SmoothSVMLoss.cc)
target_link_libraries(TestL2SmoothSVMLoss jensen)
add_executable(TestL2SmoothSVRLoss test/TestL2SmoothSVRLoss.cc)
target_link_libraries(TestL2SmoothSVRLoss jensen)
add_executable(TestL1SmoothSVMLoss test/TestL1SmoothSVMLoss.cc)
target_link_libraries(TestL1SmoothSVMLoss jensen)
add_executable(TestL2HingeSVMLoss test/TestL2HingeSVMLoss.cc)
target_link_libraries(TestL2HingeSVMLoss jensen)
add_executable(TestL2HingeSVRLoss test/TestL2HingeSVRLoss.cc)
target_link_libraries(TestL2HingeSVRLoss jensen)
add_executable(ClassificationExample examples/ClassificationExample.cc)
target_link_libraries(ClassificationExample jensen)
add_executable(ClassificationLibSVMExample examples/ClassificationLibSVMExample.cc)
target_link_libraries(ClassificationLibSVMExample jensen)
add_executable(ClassificationCrossValExample examples/ClassificationCrossValExample.cc)
target_link_libraries(ClassificationCrossValExample jensen)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jensen: The Convex Optimization and Machine Learning ToolKit")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
IF(WIN32 AND NOT UNIX)
SET(CPACK_NSIS_MODIFY_PATH ON)
ELSE(WIN32 AND NOT UNIX)
SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)