diff --git a/MLPP/DualSVC/DualSVC.cpp b/MLPP/DualSVC/DualSVC.cpp index 6c6d65f..09a8b52 100644 --- a/MLPP/DualSVC/DualSVC.cpp +++ b/MLPP/DualSVC/DualSVC.cpp @@ -21,7 +21,7 @@ namespace MLPP{ y_hat.resize(n); bias = Utilities::biasInitialization(); alpha = Utilities::weightInitialization(n); // One alpha for all training examples, as per the lagrangian multipliers. - K = createK(); // For now this is unused. When non-linear kernels are added, the K will be manipulated. + K = kernelFunction(inputSet, inputSet, kernel); // For now this is unused. When non-linear kernels are added, the K will be manipulated. } std::vector DualSVC::modelSetTest(std::vector> X){ @@ -225,14 +225,14 @@ namespace MLPP{ } } - double DualSVC::kernelFunction(std::vector u, std::vector v){ + double DualSVC::kernelFunction(std::vector u, std::vector v, std::string kernel){ LinAlg alg; if(kernel == "Linear"){ return alg.dot(u, v); - } + } // warning: non-void function does not return a value in all control paths [-Wreturn-type] } - std::vector> DualSVC::createK(){ + std::vector> DualSVC::kernelFunction(std::vector> A, std::vector> B, std::string kernel){ LinAlg alg; if(kernel == "Linear"){ return alg.matmult(inputSet, alg.transpose(inputSet)); diff --git a/MLPP/DualSVC/DualSVC.hpp b/MLPP/DualSVC/DualSVC.hpp index 025c7f5..d3a34dd 100644 --- a/MLPP/DualSVC/DualSVC.hpp +++ b/MLPP/DualSVC/DualSVC.hpp @@ -43,8 +43,8 @@ namespace MLPP { void alphaProjection(); - double kernelFunction(std::vector u, std::vector v); - std::vector> createK(); + double kernelFunction(std::vector v, std::vector u, std::string kernel); + std::vector> kernelFunction(std::vector> U, std::vector> V, std::string kernel); std::vector> inputSet; std::vector outputSet; diff --git a/SharedLib/MLPP.so b/SharedLib/MLPP.so index 532088e..d1fa048 100755 Binary files a/SharedLib/MLPP.so and b/SharedLib/MLPP.so differ diff --git a/a.out b/a.out index 2a5b9b4..9f3a42a 100755 Binary files a/a.out and b/a.out differ diff --git a/buildSO.sh b/buildSO.sh index 4de0d15..d8f6c99 100755 --- a/buildSO.sh +++ b/buildSO.sh @@ -1,6 +1,6 @@ -g++ -I MLPP -c MLPP/Stat/Stat.cpp MLPP/LinAlg/LinAlg.cpp MLPP/Regularization/Reg.cpp MLPP/Activation/Activation.cpp MLPP/Utilities/Utilities.cpp MLPP/Data/Data.cpp MLPP/Cost/Cost.cpp MLPP/ANN/ANN.cpp MLPP/HiddenLayer/HiddenLayer.cpp MLPP/OutputLayer/OutputLayer.cpp MLPP/MLP/MLP.cpp MLPP/LinReg/LinReg.cpp MLPP/LogReg/LogReg.cpp MLPP/UniLinReg/UniLinReg.cpp MLPP/CLogLogReg/CLogLogReg.cpp MLPP/ExpReg/ExpReg.cpp MLPP/ProbitReg/ProbitReg.cpp MLPP/SoftmaxReg/SoftmaxReg.cpp MLPP/TanhReg/TanhReg.cpp MLPP/SoftmaxNet/SoftmaxNet.cpp MLPP/Convolutions/Convolutions.cpp MLPP/AutoEncoder/AutoEncoder.cpp MLPP/MultinomialNB/MultinomialNB.cpp MLPP/BernoulliNB/BernoulliNB.cpp MLPP/GaussianNB/GaussianNB.cpp MLPP/KMeans/KMeans.cpp MLPP/kNN/kNN.cpp MLPP/PCA/PCA.cpp MLPP/OutlierFinder/OutlierFinder.cpp MLPP/MultiOutputLayer/MultiOutputLayer.cpp MLPP/MANN/MANN.cpp --std=c++17 -pthread +g++ -I MLPP -c main.cpp MLPP/Stat/Stat.cpp MLPP/LinAlg/LinAlg.cpp MLPP/Regularization/Reg.cpp MLPP/Activation/Activation.cpp MLPP/Utilities/Utilities.cpp MLPP/Data/Data.cpp MLPP/Cost/Cost.cpp MLPP/ANN/ANN.cpp MLPP/HiddenLayer/HiddenLayer.cpp MLPP/OutputLayer/OutputLayer.cpp MLPP/MLP/MLP.cpp MLPP/LinReg/LinReg.cpp MLPP/LogReg/LogReg.cpp MLPP/UniLinReg/UniLinReg.cpp MLPP/CLogLogReg/CLogLogReg.cpp MLPP/ExpReg/ExpReg.cpp MLPP/ProbitReg/ProbitReg.cpp MLPP/SoftmaxReg/SoftmaxReg.cpp MLPP/TanhReg/TanhReg.cpp MLPP/SoftmaxNet/SoftmaxNet.cpp MLPP/Convolutions/Convolutions.cpp MLPP/AutoEncoder/AutoEncoder.cpp MLPP/MultinomialNB/MultinomialNB.cpp MLPP/BernoulliNB/BernoulliNB.cpp MLPP/GaussianNB/GaussianNB.cpp MLPP/KMeans/KMeans.cpp MLPP/kNN/kNN.cpp MLPP/PCA/PCA.cpp MLPP/OutlierFinder/OutlierFinder.cpp MLPP/MANN/MANN.cpp MLPP/MultiOutputLayer/MultiOutputLayer.cpp MLPP/SVC/SVC.cpp MLPP/NumericalAnalysis/NumericalAnalysis.cpp MLPP/DualSVC/DualSVC.cpp --std=c++17 -g++ -shared -o MLPP.so Reg.o LinAlg.o Stat.o Activation.o LinReg.o Utilities.o Cost.o LogReg.o ProbitReg.o ExpReg.o CLogLogReg.o SoftmaxReg.o TanhReg.o kNN.o KMeans.o UniLinReg.o SoftmaxNet.o MLP.o AutoEncoder.o HiddenLayer.o OutputLayer.o ANN.o BernoulliNB.o GaussianNB.o MultinomialNB.o Convolutions.o OutlierFinder.o Data.o MultiOutputLayer.o MANN.o +g++ -shared -o MLPP.so Reg.o LinAlg.o Stat.o Activation.o LinReg.o Utilities.o Cost.o LogReg.o ProbitReg.o ExpReg.o CLogLogReg.o SoftmaxReg.o TanhReg.o kNN.o KMeans.o UniLinReg.o SoftmaxNet.o MLP.o AutoEncoder.o HiddenLayer.o OutputLayer.o ANN.o BernoulliNB.o GaussianNB.o MultinomialNB.o Convolutions.o OutlierFinder.o Data.o MultiOutputLayer.o MANN.o SVC.o NumericalAnalysis.o DualSVC.o mv MLPP.so SharedLib