|
@@ -265,7 +265,7 @@ void inline trainGPSRMean(NICE::Vector & GPMeanRightPart, const double & noise,
|
|
|
NICE::Matrix Kmn (indicesOfChosenExamples.size(), nrOfExamplesPerClass, 0.0);
|
|
|
int rowCnt(0);
|
|
|
//set every row
|
|
|
- for (int i = 0; i < indicesOfChosenExamples.size(); i++, rowCnt++ )
|
|
|
+ for (uint i = 0; i < indicesOfChosenExamples.size(); i++, rowCnt++ )
|
|
|
{
|
|
|
//set every element of this row
|
|
|
NICE::Vector col = kernelMatrix.getRow(indicesOfChosenExamples[i]);
|
|
@@ -278,9 +278,9 @@ void inline trainGPSRMean(NICE::Vector & GPMeanRightPart, const double & noise,
|
|
|
//we could speed this up if we would order the indices
|
|
|
NICE::Matrix Kmm (indicesOfChosenExamples.size(), indicesOfChosenExamples.size(), 0.0);
|
|
|
double tmp(0.0);
|
|
|
- for (int i = 0; i < indicesOfChosenExamples.size(); i++ )
|
|
|
+ for (uint i = 0; i < indicesOfChosenExamples.size(); i++ )
|
|
|
{
|
|
|
- for (int j = i; j < indicesOfChosenExamples.size(); j++ )
|
|
|
+ for (uint j = i; j < indicesOfChosenExamples.size(); j++ )
|
|
|
{
|
|
|
tmp = kernelMatrix(indicesOfChosenExamples[i], indicesOfChosenExamples[j]);
|
|
|
Kmm(i,j) = tmp;
|
|
@@ -346,7 +346,7 @@ void inline trainGPSRVar(NICE::Matrix & choleskyMatrix, const double & noise, co
|
|
|
NICE::Matrix Kmn (indicesOfChosenExamples.size(), nrOfExamplesPerClass, 0.0);
|
|
|
int rowCnt(0);
|
|
|
//set every row
|
|
|
- for (int i = 0; i < indicesOfChosenExamples.size(); i++, rowCnt++ )
|
|
|
+ for (uint i = 0; i < indicesOfChosenExamples.size(); i++, rowCnt++ )
|
|
|
{
|
|
|
//set every element of this row
|
|
|
NICE::Vector col = kernelMatrix.getRow(indicesOfChosenExamples[i]);
|
|
@@ -359,9 +359,9 @@ void inline trainGPSRVar(NICE::Matrix & choleskyMatrix, const double & noise, co
|
|
|
//we could speed this up if we would order the indices
|
|
|
NICE::Matrix Kmm (indicesOfChosenExamples.size(), indicesOfChosenExamples.size(), 0.0);
|
|
|
double tmp(0.0);
|
|
|
- for (int i = 0; i < indicesOfChosenExamples.size(); i++ )
|
|
|
+ for (uint i = 0; i < indicesOfChosenExamples.size(); i++ )
|
|
|
{
|
|
|
- for (int j = i; j < indicesOfChosenExamples.size(); j++ )
|
|
|
+ for (uint j = i; j < indicesOfChosenExamples.size(); j++ )
|
|
|
{
|
|
|
tmp = kernelMatrix(indicesOfChosenExamples[i], indicesOfChosenExamples[j]);
|
|
|
Kmm(i,j) = tmp;
|
|
@@ -779,7 +779,7 @@ void inline evaluateGPVarApprox(const NICE::Vector & kernelVector, const double
|
|
|
// uncertainty = k{**} - \k_*^T \cdot D^{-1} \cdot k_* where D is our nice approximation of K
|
|
|
|
|
|
NICE::Vector rightPart (kernelVector.size());
|
|
|
- for (int j = 0; j < kernelVector.size(); j++)
|
|
|
+ for (uint j = 0; j < kernelVector.size(); j++)
|
|
|
{
|
|
|
rightPart[j] = kernelVector[j] * matrixDInv[j];
|
|
|
}
|
|
@@ -1037,7 +1037,7 @@ void inline evaluateGPOptVar(const NICE::Vector & kernelVector, const double & k
|
|
|
// uncertainty = k{**} - \k_*^T \cdot D^{-1} \cdot k_* where D is our nice approximation of K
|
|
|
|
|
|
NICE::Vector rightPart (kernelVector.size());
|
|
|
- for (int j = 0; j < kernelVector.size(); j++)
|
|
|
+ for (uint j = 0; j < kernelVector.size(); j++)
|
|
|
{
|
|
|
rightPart[j] = kernelVector[j] * matrixDInv[j];
|
|
|
}
|
|
@@ -1392,8 +1392,8 @@ int main (int argc, char **argv)
|
|
|
kernelSigmaGPMean = sigmaGPMeanParas[cl];
|
|
|
kernelSigmaGPSRMean = sigmaGPSRMeanParas[cl];
|
|
|
kernelSigmaGPSRVar = sigmaGPSRVarParas[cl];
|
|
|
- kernelSigmaGPSRMean = sigmaGPFITCMeanParas[cl];
|
|
|
- kernelSigmaGPSRVar = sigmaGPFITCVarParas[cl];
|
|
|
+ kernelSigmaGPFITCMean = sigmaGPFITCMeanParas[cl];
|
|
|
+ kernelSigmaGPFITCVar = sigmaGPFITCVarParas[cl];
|
|
|
kernelSigmaGPOptMean = sigmaGPOptMeanParas[cl];
|
|
|
kernelSigmaGPOptVar = sigmaGPOptVarParas[cl];
|
|
|
kernelSigmaParzen = sigmaParzenParas[cl];
|
|
@@ -1447,10 +1447,11 @@ int main (int argc, char **argv)
|
|
|
if (GPVar)
|
|
|
trainGPVar(GPVarCholesky, noiseGPVarParas[cl], kernelMatrix, nrOfExamplesPerClass, cl, runsPerClassToAverageTraining );
|
|
|
|
|
|
+ int nrOfRegressors (0);
|
|
|
//train GP SR Mean
|
|
|
NICE::Vector GPSRMeanRightPart;
|
|
|
std::vector<int> indicesOfChosenExamplesGPSRMean;
|
|
|
- int nrOfRegressors = conf.gI( "GPSR", "nrOfRegressors", nrOfExamplesPerClass/2);
|
|
|
+ nrOfRegressors = conf.gI( "GPSR", "nrOfRegressors", nrOfExamplesPerClass/2);
|
|
|
nrOfRegressors = std::min( nrOfRegressors, nrOfExamplesPerClass );
|
|
|
if (GPSRMean)
|
|
|
trainGPSRMean(GPSRMeanRightPart, noiseGPSRMeanParas[cl], kernelMatrix, nrOfExamplesPerClass, cl, runsPerClassToAverageTraining, nrOfRegressors, indicesOfChosenExamplesGPSRMean );
|
|
@@ -1464,7 +1465,7 @@ int main (int argc, char **argv)
|
|
|
//train GP FITC Mean
|
|
|
NICE::Vector GPFITCMeanRightPart;
|
|
|
std::vector<int> indicesOfChosenExamplesGPFITCMean;
|
|
|
- int nrOfRegressors = conf.gI( "GPFITC", "nrOfRegressors", nrOfExamplesPerClass/5);
|
|
|
+ nrOfRegressors = conf.gI( "GPFITC", "nrOfRegressors", nrOfExamplesPerClass/5);
|
|
|
nrOfRegressors = std::min( nrOfRegressors, nrOfExamplesPerClass );
|
|
|
if (GPFITCMean)
|
|
|
trainGPFITCMean(GPFITCMeanRightPart, noiseGPFITCMeanParas[cl], kernelMatrix, nrOfExamplesPerClass, cl, runsPerClassToAverageTraining, nrOfRegressors, indicesOfChosenExamplesGPFITCMean );
|