📄 mssricc.cc
字号:
isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("row", numIteration); } if (numColCluster < numCol){ computeColQuality4Compressed1WayNormalized(); reassignCC(isReversed); computeColClusterSize(); computeAcompressed(isReversed); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("col", numIteration); } rowSmoothingFactor *= myCRS->getAnnealingFactor(); colSmoothingFactor *= myCCS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA)); checkDumpLevel4BatchUpdate("end");}void MssrIcc::doBatchUpdate4VariationI(){ checkDumpLevel4BatchUpdate("begin"); int numIteration = 0; double oldObjValue; computeRowClusterSize(); computeColClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); do { numIteration++; myCRS->setSmoothingFactor(smoothingType, rowSmoothingFactor); myCCS->setSmoothingFactor(smoothingType, colSmoothingFactor); oldObjValue = objValue; computeRowQuality4Compressed1WayNormalized();//----------- reassignRC(); computeRowClusterSize();// computeObjectiveFunction4Normalized(); // Since Acompressed is not a real centroid, we should not use this. computeObjectiveFunction4Normalized(Acompressed); checkDumpLevel4BatchUpdate("row", numIteration);//----------- computeColQuality4Compressed1WayNormalized(); reassignCC(); computeColClusterSize();// computeObjectiveFunction4Normalized(); // Since Acompressed is not a real centroid, we should not use this. computeObjectiveFunction4Normalized(Acompressed); checkDumpLevel4BatchUpdate("col", numIteration);//----------- computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); // Since Acompressed is a real centroid, we can use both functions.// computeObjectiveFunction4Normalized(Acompressed); checkDumpLevel4BatchUpdate("both", numIteration);//------------ rowSmoothingFactor *= myCRS->getAnnealingFactor(); colSmoothingFactor *= myCCS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA)); checkDumpLevel4BatchUpdate("end");}void MssrIcc::doBatchUpdate4VariationII(){ checkDumpLevel4BatchUpdate("begin"); int numIteration = 0; double oldObjValue; double tempRowSmoothingFactor = rowSmoothingFactor, tempColSmoothingFactor = colSmoothingFactor; computeRowClusterSize(); computeColClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); myCRS->setSmoothingFactor(smoothingType, rowSmoothingFactor); myCCS->setSmoothingFactor(smoothingType, colSmoothingFactor); do { numIteration++; myCRS->setSmoothingFactor(smoothingType, rowSmoothingFactor); oldObjValue = objValue; computeRowQuality4Compressed1WayNormalized();//----------- reassignRC(); computeRowClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("row", numIteration); tempRowSmoothingFactor *= myCRS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA));//----------- numIteration = 0; tempRowSmoothingFactor = rowSmoothingFactor; myCRS->setSmoothingFactor(smoothingType, tempRowSmoothingFactor); do { numIteration++; myCCS->setSmoothingFactor(smoothingType, tempColSmoothingFactor); oldObjValue = objValue; computeColQuality4Compressed1WayNormalized(); reassignCC(); computeColClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("col", numIteration); tempColSmoothingFactor *= myCCS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (colBatchUpdateThreshold * squaredFNormA)); colSmoothingFactor = tempColSmoothingFactor; checkDumpLevel4BatchUpdate("end");}/*// It doesn't guarantee the monotonic decrease of objective function values.void MssrIcc::doBatchUpdate4VariationIII(){ checkDumpLevel4BatchUpdate("begin"); int numIteration = 0, numRowIteration = 0, numColIteration = 0; int *beforeRowCL = new int[numRow]; int *afterRowCL = new int[numRow]; double oldObjValue; double tempRowSmoothingFactor = rowSmoothingFactor, tempColSmoothingFactor = colSmoothingFactor; computeRowClusterSize(); computeColClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); do { numIteration++; for (int r = 0; r < numRow; r++) beforeRowCL[r] = rowCL[r]; myCRS->setSmoothingFactor(smoothingType, tempRowSmoothingFactor); myCCS->setSmoothingFactor(smoothingType, tempColSmoothingFactor); do { numRowIteration++; myCRS->setSmoothingFactor(smoothingType, tempRowSmoothingFactor); oldObjValue = objValue; computeRowQuality4Compressed1WayNormalized();//----------- reassignRC(); computeRowClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("row", numRowIteration); tempRowSmoothingFactor *= myCRS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA));//----------- for (int r = 0; r < numRow; r++){ afterRowCL[r] = rowCL[r]; rowCL[r] = beforeRowCL[r]; } computeRowClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); for (int r = 0; r < numRow; r++) rowCL[r] = afterRowCL[r]; computeRowClusterSize(); tempRowSmoothingFactor = rowSmoothingFactor; myCRS->setSmoothingFactor(smoothingType, tempRowSmoothingFactor);//----------- do { numColIteration++; myCCS->setSmoothingFactor(smoothingType, tempColSmoothingFactor); oldObjValue = objValue; computeColQuality4Compressed1WayNormalized(); reassignCC(); computeColClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(Acompressed); checkDumpLevel4BatchUpdate("col", numColIteration); tempColSmoothingFactor *= myCCS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (colBatchUpdateThreshold * squaredFNormA));//----------- oldObjValue = objValue; computeRowClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); oldObjValue = objValue; computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("both", numIteration);//----------- } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA)); colSmoothingFactor = tempColSmoogthingFactor; delete [] beforeRowCL; delete [] afterRowCL; checkDumpLevel4BatchUpdate("end");}*/void MssrIcc::doBatchUpdate4VariationIII(){ checkDumpLevel4BatchUpdate("begin"); int numIteration = 0; double oldObjValue; computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); do { numIteration++; myCRS->setSmoothingFactor(smoothingType, rowSmoothingFactor); myCCS->setSmoothingFactor(smoothingType, colSmoothingFactor); oldObjValue = objValue; if (randNumGenerator.GetUniform() > SELECTION_PROBABILITY){ computeRowQuality4Compressed1WayNormalized(); reassignRC(); computeRowClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("row", numIteration); } else { computeColQuality4Compressed1WayNormalized(); reassignCC(); computeColClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("col", numIteration); } rowSmoothingFactor *= myCRS->getAnnealingFactor(); colSmoothingFactor *= myCCS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA)); checkDumpLevel4BatchUpdate("end");}void MssrIcc::doBatchUpdate4VariationIV(){ checkDumpLevel4BatchUpdate("begin"); int numIteration = 0; double oldObjValue; computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); do { numIteration++; myCRS->setSmoothingFactor(smoothingType, rowSmoothingFactor); myCCS->setSmoothingFactor(smoothingType, colSmoothingFactor); if (randNumGenerator.GetUniform() > SELECTION_PROBABILITY){ do { oldObjValue = objValue; computeRowQuality4Compressed1WayNormalized(); reassignRC(); computeRowClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("row", numIteration); } while ((oldObjValue - objValue) > (MULTIPLE_FACTOR * rowBatchUpdateThreshold * squaredFNormA)); } else { do { oldObjValue = objValue; computeColQuality4Compressed1WayNormalized(); reassignCC(); computeColClusterSize(); computeAcompressed(); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("col", numIteration); } while ((oldObjValue - objValue) > (MULTIPLE_FACTOR * colBatchUpdateThreshold * squaredFNormA)); } rowSmoothingFactor *= myCRS->getAnnealingFactor(); colSmoothingFactor *= myCCS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA)); checkDumpLevel4BatchUpdate("end");}void MssrIcc::doBatchUpdate4VariationI(bool *isReversed){ checkDumpLevel4BatchUpdate("begin"); int numIteration = 0; double oldObjValue; computeRowClusterSize(); computeColClusterSize(); computeAcompressed(isReversed); isNormalizedCompressed = false; normalizeCompressedMatrix(); do { numIteration++; myCRS->setSmoothingFactor(smoothingType, rowSmoothingFactor); myCCS->setSmoothingFactor(smoothingType, colSmoothingFactor); oldObjValue = objValue; computeRowQuality4Compressed1WayNormalized();//----------- reassignRC(isReversed); computeRowClusterSize();// computeObjectiveFunction4Normalized(); // Since Acompressed is not a real centroid, we should not use this. computeObjectiveFunction4Normalized(Acompressed, isReversed); checkDumpLevel4BatchUpdate("row", numIteration);//----------- computeColQuality4Compressed1WayNormalized(); reassignCC(isReversed); computeColClusterSize();// computeObjectiveFunction4Normalized(); // Since Acompressed is not a real centroid, we should not use this. computeObjectiveFunction4Normalized(Acompressed, isReversed); checkDumpLevel4BatchUpdate("col", numIteration);//----------- computeAcompressed(isReversed); isNormalizedCompressed = false; normalizeCompressedMatrix();// computeObjectiveFunction4Normalized(); // Since Acompressed is a real centroid, we can use both functions. computeObjectiveFunction4Normalized(Acompressed, isReversed); checkDumpLevel4BatchUpdate("both", numIteration);//------------ rowSmoothingFactor *= myCRS->getAnnealingFactor(); colSmoothingFactor *= myCCS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA)); checkDumpLevel4BatchUpdate("end");}void MssrIcc::doBatchUpdate4VariationII(bool *isReversed){ checkDumpLevel4BatchUpdate("begin"); int numIteration = 0; double oldObjValue; double tempRowSmoothingFactor = rowSmoothingFactor, tempColSmoothingFactor = colSmoothingFactor; computeRowClusterSize(); computeColClusterSize(); computeAcompressed(isReversed); isNormalizedCompressed = false; normalizeCompressedMatrix(); myCRS->setSmoothingFactor(smoothingType, tempRowSmoothingFactor); myCCS->setSmoothingFactor(smoothingType, tempColSmoothingFactor); do { numIteration++; myCRS->setSmoothingFactor(smoothingType, tempRowSmoothingFactor); oldObjValue = objValue; computeRowQuality4Compressed1WayNormalized();//----------- reassignRC(isReversed); computeRowClusterSize(); computeAcompressed(isReversed); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("row", numIteration); tempRowSmoothingFactor *= myCRS->getAnnealingFactor(); } while ((oldObjValue - objValue) > (rowBatchUpdateThreshold * squaredFNormA));//----------- numIteration = 0; tempRowSmoothingFactor = myCRS->getSmoothingFactor(); myCRS->setSmoothingFactor(smoothingType, tempRowSmoothingFactor); do { numIteration++; myCCS->setSmoothingFactor(smoothingType, tempColSmoothingFactor); oldObjValue = objValue; computeColQuality4Compressed1WayNormalized(); reassignCC(isReversed); computeColClusterSize(); computeAcompressed(isReversed); isNormalizedCompressed = false; normalizeCompressedMatrix(); computeObjectiveFunction4Normalized(); checkDumpLevel4BatchUpdate("col", numIteration);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -