SNAP Library 6.0, Developer Reference
2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
!!!!! MYUNGHWAN, CHECK! More...
#include <kronecker.h>
Public Member Functions | |
TKroneckerLL () | |
TKroneckerLL (const PNGraph &GraphPt, const TFltV &ParamV, const double &PermPSwapNd=0.2) | |
TKroneckerLL (const PNGraph &GraphPt, const TKronMtx &ParamMtx, const double &PermPSwapNd=0.2) | |
TKroneckerLL (const PNGraph &GraphPt, const TKronMtx &ParamMtx, const TIntV &NodeIdPermV, const double &PermPSwapNd=0.2) | |
int | GetNodes () const |
int | GetKronIters () const |
PNGraph | GetGraph () const |
void | SetGraph (const PNGraph &GraphPt) |
const TKronMtx & | GetProbMtx () const |
const TKronMtx & | GetLLMtx () const |
int | GetParams () const |
int | GetDim () const |
void | SetDebug (const bool Debug) |
const TFltV & | GetLLHist () const |
const TVec< TKronMtx > & | GetParamHist () const |
bool | IsObsNode (const int &NId) const |
bool | IsObsEdge (const int &NId1, const int &NId2) const |
bool | IsLatentNode (const int &NId) const |
bool | IsLatentEdge (const int &NId1, const int &NId2) const |
void | SetPerm (const char &PermId) |
void | SetOrderPerm () |
void | SetRndPerm () |
void | SetDegPerm () |
void | SetBestDegPerm () |
!!!!! MYUNGHWAN, CHECK! More... | |
void | SetPerm (const TIntV &NodePermV) |
void | SetIPerm (const TIntV &Perm) |
!!!!! MYUNGHWAN, CHECK! More... | |
const TIntV & | GetPermV () const |
void | AppendIsoNodes () |
void | RestoreGraph (const bool RestoreNodes=true) |
!!!!! MYUNGHWAN, CHECK! More... | |
double | GetFullGraphLL () const |
double | GetFullRowLL (int RowId) const |
double | GetFullColLL (int ColId) const |
double | GetEmptyGraphLL () const |
double | GetApxEmptyGraphLL () const |
void | InitLL (const TFltV &ParamV) |
void | InitLL (const TKronMtx &ParamMtx) |
void | InitLL (const PNGraph &GraphPt, const TKronMtx &ParamMtx) |
double | CalcGraphLL () |
double | CalcApxGraphLL () |
double | GetLL () const |
double | GetAbsErr () const |
double | NodeLLDelta (const int &NId) const |
double | SwapNodesLL (const int &NId1, const int &NId2) |
bool | SampleNextPerm (int &NId1, int &NId2) |
double | GetEmptyGraphDLL (const int &ParamId) const |
double | GetApxEmptyGraphDLL (const int &ParamId) const |
const TFltV & | CalcGraphDLL () |
const TFltV & | CalcFullApxGraphDLL () |
const TFltV & | CalcApxGraphDLL () |
double | NodeDLLDelta (const int ParamId, const int &NId) const |
void | UpdateGraphDLL (const int &SwapNId1, const int &SwapNId2) |
const TFltV & | GetDLL () const |
double | GetDLL (const int &ParamId) const |
void | SampleGradient (const int &WarmUp, const int &NSamples, double &AvgLL, TFltV &GradV) |
double | GradDescent (const int &NIter, const double &LrnRate, double MnStep, double MxStep, const int &WarmUp, const int &NSamples) |
double | GradDescent2 (const int &NIter, const double &LrnRate, double MnStep, double MxStep, const int &WarmUp, const int &NSamples) |
void | SetRandomEdges (const int &NEdges, const bool isDir=true) |
!!!!! MYUNGHWAN, CHECK! More... | |
void | MetroGibbsSampleSetup (const int &WarmUp) |
void | MetroGibbsSampleNext (const int &WarmUp, const bool DLLUpdate=false) |
void | RunEStep (const int &GibbsWarmUp, const int &WarmUp, const int &NSamples, TFltV &LLV, TVec< TFltV > &DLLV) |
double | RunMStep (const TFltV &LLV, const TVec< TFltV > &DLLV, const int &GradIter, const double &LrnRate, double MnStep, double MxStep) |
void | RunKronEM (const int &EMIter, const int &GradIter, double LrnRate, double MnStep, double MxStep, const int &GibbsWarmUp, const int &WarmUp, const int &NSamples, const TKronEMType &Type=kronNodeMiss, const int &NMissing=-1) |
TFltV | TestSamplePerm (const TStr &OutFNm, const int &WarmUp, const int &NSamples, const TKronMtx &TrueMtx, const bool &DoPlot=true) |
TFltQu | TestKronDescent (const bool &DoExact, const bool &TruePerm, double LearnRate, const int &WarmUp, const int &NSamples, const TKronMtx &TrueParam) |
void | GradDescentConvergence (const TStr &OutFNm, const TStr &Desc1, const bool &SamplePerm, const int &NIters, double LearnRate, const int &WarmUp, const int &NSamples, const int &AvgKGraphs, const TKronMtx &TrueParam) |
Static Public Member Functions | |
static PKroneckerLL | New () |
static PKroneckerLL | New (const PNGraph &GraphPt, const TKronMtx &ParamMtx, const double &PermPSwapNd=0.1) |
static PKroneckerLL | New (const PNGraph &GraphPt, const TKronMtx &ParamMtx, const TIntV &NodeIdPermV, const double &PermPSwapNd=0.2) |
static double | CalcChainR2 (const TVec< TFltV > &ChainLLV) |
static void | ChainGelmapRubinPlot (const TVec< TFltV > &ChainLLV, const TStr &OutFNm, const TStr &Desc) |
static void | TestBicCriterion (const TStr &OutFNm, const TStr &Desc1, const PNGraph &G, const int &GradIters, double LearnRate, const int &WarmUp, const int &NSamples, const int &TrueN0) |
static void | TestGradDescent (const int &KronIters, const int &KiloSamples, const TStr &Permutation) |
Friends | |
class | TPt< TKroneckerLL > |
!!!!! MYUNGHWAN, CHECK!
Definition at line 116 of file kronecker.h.
|
inline |
Definition at line 150 of file kronecker.h.
Referenced by New().
TKroneckerLL::TKroneckerLL | ( | const PNGraph & | GraphPt, |
const TFltV & | ParamV, | ||
const double & | PermPSwapNd = 0.2 |
||
) |
Definition at line 783 of file kronecker.cpp.
References InitLL().
TKroneckerLL::TKroneckerLL | ( | const PNGraph & | GraphPt, |
const TKronMtx & | ParamMtx, | ||
const double & | PermPSwapNd = 0.2 |
||
) |
Definition at line 787 of file kronecker.cpp.
References InitLL().
TKroneckerLL::TKroneckerLL | ( | const PNGraph & | GraphPt, |
const TKronMtx & | ParamMtx, | ||
const TIntV & | NodeIdPermV, | ||
const double & | PermPSwapNd = 0.2 |
||
) |
Definition at line 791 of file kronecker.cpp.
References InitLL(), NodePerm, and SetIPerm().
void TKroneckerLL::AppendIsoNodes | ( | ) |
Definition at line 914 of file kronecker.cpp.
References TNGraph::AddNode(), TKronMtx::GetDim(), TNGraph::GetNodes(), Graph, KronIters, Nodes, and ProbMtx.
Referenced by RunKronEM().
const TFltV & TKroneckerLL::CalcApxGraphDLL | ( | ) |
Definition at line 1194 of file kronecker.cpp.
References GetApxEmptyGraphDLL(), TKronMtx::GetApxNoEdgeDLL(), TKronMtx::GetEdgeDLL(), TNGraph::GetNI(), TNGraph::TNodeI::GetOutDeg(), TNGraph::TNodeI::GetOutNId(), GradV, Graph, KronIters, TKronMtx::Len(), LLMtx, NodePerm, and Nodes.
Referenced by GradDescentConvergence(), RunEStep(), RunMStep(), SampleGradient(), TestGradDescent(), TestKronDescent(), and TestSamplePerm().
double TKroneckerLL::CalcApxGraphLL | ( | ) |
Definition at line 1037 of file kronecker.cpp.
References GetApxEmptyGraphLL(), TKronMtx::GetApxNoEdgeLL(), TKronMtx::GetEdgeLL(), TNGraph::GetNI(), TNGraph::TNodeI::GetOutDeg(), TNGraph::TNodeI::GetOutNId(), Graph, KronIters, LLMtx, LogLike, NodePerm, and Nodes.
Referenced by GradDescentConvergence(), MetroGibbsSampleSetup(), RunEStep(), RunMStep(), SampleGradient(), TestGradDescent(), TestKronDescent(), and TestSamplePerm().
Definition at line 1895 of file kronecker.cpp.
References IAssert, TVec< TVal, TSizeTy >::Len(), McMcGetAvgAvg(), McMcGetAvgJ(), and TMath::Sqr().
Referenced by ChainGelmapRubinPlot().
const TFltV & TKroneckerLL::CalcFullApxGraphDLL | ( | ) |
Definition at line 1176 of file kronecker.cpp.
References TKronMtx::GetApxNoEdgeDLL(), TKronMtx::GetEdgeDLL(), GradV, Graph, TNGraph::IsEdge(), KronIters, TKronMtx::Len(), LLMtx, NodePerm, and Nodes.
const TFltV & TKroneckerLL::CalcGraphDLL | ( | ) |
Definition at line 1158 of file kronecker.cpp.
References TKronMtx::GetEdgeDLL(), TKronMtx::GetNoEdgeDLL(), GradV, Graph, TNGraph::IsEdge(), KronIters, TKronMtx::Len(), LLMtx, NodePerm, and Nodes.
Referenced by TestKronDescent().
double TKroneckerLL::CalcGraphLL | ( | ) |
Definition at line 1022 of file kronecker.cpp.
References TKronMtx::GetEdgeLL(), GetEmptyGraphLL(), TNGraph::GetNI(), TKronMtx::GetNoEdgeLL(), TNGraph::TNodeI::GetOutDeg(), TNGraph::TNodeI::GetOutNId(), Graph, KronIters, LLMtx, LogLike, NodePerm, and Nodes.
Referenced by TestKronDescent().
|
static |
Definition at line 1924 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), CalcChainR2(), TStr::CStr(), TStr::Fmt(), TVec< TVal, TSizeTy >::GetSubValV(), TVec< TVal, TSizeTy >::Len(), TMath::Mn(), and TGnuPlot::PlotValV().
|
inline |
Definition at line 205 of file kronecker.h.
References TNGraph::GetEdges(), and TKronMtx::GetMtxSum().
double TKroneckerLL::GetApxEmptyGraphDLL | ( | const int & | ParamId | ) | const |
Definition at line 1147 of file kronecker.cpp.
References TKronMtx::At(), KronIters, TKronMtx::Len(), ProbMtx, and TMath::Sqr().
Referenced by CalcApxGraphDLL().
double TKroneckerLL::GetApxEmptyGraphLL | ( | ) | const |
Definition at line 987 of file kronecker.cpp.
References TKronMtx::At(), KronIters, TKronMtx::Len(), ProbMtx, and TMath::Sqr().
Referenced by CalcApxGraphLL().
|
inline |
Definition at line 165 of file kronecker.h.
References TKronMtx::GetDim().
|
inline |
|
inline |
Definition at line 219 of file kronecker.h.
double TKroneckerLL::GetEmptyGraphDLL | ( | const int & | ParamId | ) | const |
Definition at line 1136 of file kronecker.cpp.
References TKronMtx::GetNoEdgeDLL(), KronIters, LLMtx, NodePerm, and Nodes.
double TKroneckerLL::GetEmptyGraphLL | ( | ) | const |
Definition at line 976 of file kronecker.cpp.
References TKronMtx::GetNodes(), TKronMtx::GetNoEdgeLL(), KronIters, and LLMtx.
Referenced by CalcGraphLL().
double TKroneckerLL::GetFullColLL | ( | int | ColId | ) | const |
Definition at line 966 of file kronecker.cpp.
References TKronMtx::GetColSum(), TKronMtx::GetDim(), KronIters, and LLMtx.
double TKroneckerLL::GetFullGraphLL | ( | ) | const |
Definition at line 943 of file kronecker.cpp.
References TKronMtx::GetDim(), TKronMtx::GetMtxSum(), KronIters, LLMtx, and TMath::Power().
double TKroneckerLL::GetFullRowLL | ( | int | RowId | ) | const |
Definition at line 956 of file kronecker.cpp.
References TKronMtx::GetDim(), TKronMtx::GetRowSum(), KronIters, and LLMtx.
|
inline |
|
inline |
Definition at line 159 of file kronecker.h.
References KronIters.
Referenced by TestBicCriterion().
|
inline |
Definition at line 204 of file kronecker.h.
References LogLike.
Referenced by SampleGradient(), and TestSamplePerm().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 164 of file kronecker.h.
References TKronMtx::Len().
Referenced by GradDescent(), GradDescent2(), GradDescentConvergence(), RunMStep(), TestKronDescent(), and TestSamplePerm().
|
inline |
|
inline |
double TKroneckerLL::GradDescent | ( | const int & | NIter, |
const double & | LrnRate, | ||
double | MnStep, | ||
double | MxStep, | ||
const int & | WarmUp, | ||
const int & | NSamples | ||
) |
!!!!! MYUNGHWAN, CHECK!
!!!!! MYUNGHWAN, CHECK!
Definition at line 1299 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TKronMtx::At(), DebugMode, TKronMtx::Dump(), TVec< TVal, TSizeTy >::Gen(), TKronMtx::GetEdges(), TNGraph::GetEdges(), TKronMtx::GetLLMtx(), TKronMtx::GetMtxSum(), TKronMtx::GetNodes(), TNGraph::GetNodes(), GetParams(), Graph, KronIters, LLMtx, LLV, MtxV, ProbMtx, and SampleGradient().
Referenced by TestBicCriterion().
double TKroneckerLL::GradDescent2 | ( | const int & | NIter, |
const double & | LrnRate, | ||
double | MnStep, | ||
double | MxStep, | ||
const int & | WarmUp, | ||
const int & | NSamples | ||
) |
Definition at line 1355 of file kronecker.cpp.
References TKronMtx::At(), TKronMtx::Dump(), TKronMtx::GetEdges(), TNGraph::GetEdges(), TKronMtx::GetLLMtx(), TKronMtx::GetMtxSum(), TKronMtx::GetNodes(), TNGraph::GetNodes(), GetParams(), Graph, KronIters, LLMtx, ProbMtx, and SampleGradient().
void TKroneckerLL::GradDescentConvergence | ( | const TStr & | OutFNm, |
const TStr & | Desc1, | ||
const bool & | SamplePerm, | ||
const int & | NIters, | ||
double | LearnRate, | ||
const int & | WarmUp, | ||
const int & | NSamples, | ||
const int & | AvgKGraphs, | ||
const TKronMtx & | TrueParam | ||
) |
Definition at line 2017 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TKronMtx::At(), CalcApxGraphDLL(), CalcApxGraphLL(), TVec< TVal, TSizeTy >::Clr(), TStr::CStr(), TKronMtx::Dump(), TKronMtx::Empty(), TStr::Empty(), TStr::Fmt(), TKronMtx::GenFastKronecker(), TSnap::GetAnfEffDiam(), TKronMtx::GetAvgAbsErr(), TKronMtx::GetEdges(), TNGraph::GetEdges(), TKronMtx::GetLLMtx(), TKronMtx::GetMtxSum(), TKronMtx::GetNodes(), TNGraph::GetNodes(), GetParams(), TExeTm::GetSecs(), TSnap::GetSngVals(), TExeTm::GetTmStr(), GradV, Graph, InitLL(), KronIters, LLMtx, LogLike, PlotTrueAndEst(), ProbMtx, TVec< TVal, TSizeTy >::PutAll(), SampleGradient(), SetDegPerm(), SetOrderPerm(), and TVec< TVal, TSizeTy >::Sort().
void TKroneckerLL::InitLL | ( | const TFltV & | ParamV | ) |
Definition at line 996 of file kronecker.cpp.
Referenced by GradDescentConvergence(), TestSamplePerm(), and TKroneckerLL().
void TKroneckerLL::InitLL | ( | const TKronMtx & | ParamMtx | ) |
Definition at line 1000 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Gen(), TKronMtx::GetLLMtx(), GradV, IAssert, TKronMtx::IsProbMtx(), TVec< TVal, TSizeTy >::Len(), LLMtx, LogLike, TKronMtx::NInf, ProbMtx, and TVec< TVal, TSizeTy >::PutAll().
Definition at line 1010 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Gen(), TKronMtx::GetLLMtx(), GradV, IAssert, TKronMtx::IsProbMtx(), TVec< TVal, TSizeTy >::Len(), LLMtx, LogLike, TKronMtx::NInf, ProbMtx, TVec< TVal, TSizeTy >::PutAll(), and SetGraph().
|
inline |
Definition at line 175 of file kronecker.h.
References IsObsEdge().
|
inline |
Definition at line 174 of file kronecker.h.
References IsObsNode().
|
inline |
Definition at line 173 of file kronecker.h.
References IAssert.
Referenced by IsLatentEdge(), and SetRandomEdges().
|
inline |
Definition at line 172 of file kronecker.h.
References IAssert.
Referenced by IsLatentNode().
void TKroneckerLL::MetroGibbsSampleNext | ( | const int & | WarmUp, |
const bool | DLLUpdate = false |
||
) |
Definition at line 1503 of file kronecker.cpp.
References TNGraph::DelEdge(), TVec< TVal, TSizeTy >::DelLast(), GEdgeV, TKronMtx::GetApxNoEdgeDLL(), TKronMtx::GetApxNoEdgeLL(), TKronMtx::GetEdgeDLL(), TKronMtx::GetEdgeLL(), TRnd::GetUniDevInt(), GradV, Graph, IAssertR, KronIters, TVec< TVal, TSizeTy >::Last(), LEdgeV, TKronMtx::Len(), TVec< TVal, TSizeTy >::Len(), LLMtx, LogLike, LSelfEdge, SampleNextPerm(), SetRandomEdges(), UpdateGraphDLL(), TTriple< TVal1, TVal2, TVal3 >::Val1, TTriple< TVal1, TVal2, TVal3 >::Val2, and TTriple< TVal1, TVal2, TVal3 >::Val3.
Referenced by RunEStep(), and RunMStep().
void TKroneckerLL::MetroGibbsSampleSetup | ( | const int & | WarmUp | ) |
Definition at line 1476 of file kronecker.cpp.
References CalcApxGraphLL(), EMType, TKronMtx::GetDim(), TKronMtx::GetMtxSum(), kronEdgeMiss, kronFutureLink, KronIters, MissEdges, Nodes, ProbMtx, RealNodes, RestoreGraph(), SampleNextPerm(), and SetRandomEdges().
Referenced by RunEStep().
|
inlinestatic |
Definition at line 154 of file kronecker.h.
References TKroneckerLL().
|
static |
Definition at line 797 of file kronecker.cpp.
References TKroneckerLL().
|
static |
Definition at line 801 of file kronecker.cpp.
References TKroneckerLL().
double TKroneckerLL::NodeDLLDelta | ( | const int | ParamId, |
const int & | NId | ||
) | const |
Definition at line 1214 of file kronecker.cpp.
References TKronMtx::GetApxNoEdgeDLL(), TKronMtx::GetEdgeDLL(), TNGraph::TNodeI::GetInDeg(), TNGraph::TNodeI::GetInNId(), TNGraph::GetNI(), TNGraph::TNodeI::GetOutDeg(), TNGraph::TNodeI::GetOutNId(), Graph, IAssert, TNGraph::IsEdge(), TNGraph::IsNode(), KronIters, LLMtx, and NodePerm.
Referenced by UpdateGraphDLL().
double TKroneckerLL::NodeLLDelta | ( | const int & | NId | ) | const |
Definition at line 1055 of file kronecker.cpp.
References TKronMtx::GetApxNoEdgeLL(), TKronMtx::GetEdgeLL(), TNGraph::TNodeI::GetInDeg(), TNGraph::TNodeI::GetInNId(), TNGraph::GetNI(), TNGraph::TNodeI::GetOutDeg(), TNGraph::TNodeI::GetOutNId(), Graph, IAssert, TNGraph::IsEdge(), TNGraph::IsNode(), KronIters, LLMtx, and NodePerm.
Referenced by SwapNodesLL().
void TKroneckerLL::RestoreGraph | ( | const bool | RestoreNodes = true | ) |
!!!!! MYUNGHWAN, CHECK!
Definition at line 923 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Clr(), TVec< TVal, TSizeTy >::Del(), TNGraph::DelEdge(), TNGraph::DelNode(), GEdgeV, TNGraph::GetNodes(), Graph, LEdgeV, TVec< TVal, TSizeTy >::Len(), LSelfEdge, and RealNodes.
Referenced by MetroGibbsSampleSetup(), and RunKronEM().
void TKroneckerLL::RunEStep | ( | const int & | GibbsWarmUp, |
const int & | WarmUp, | ||
const int & | NSamples, | ||
TFltV & | LLV, | ||
TVec< TFltV > & | DLLV | ||
) |
Definition at line 1567 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), CalcApxGraphDLL(), CalcApxGraphLL(), TVec< TVal, TSizeTy >::Gen(), TExeTm::GetTmStr(), GradV, LogLike, MetroGibbsSampleNext(), MetroGibbsSampleSetup(), and TExeTm::Tick().
Referenced by RunKronEM().
void TKroneckerLL::RunKronEM | ( | const int & | EMIter, |
const int & | GradIter, | ||
double | LrnRate, | ||
double | MnStep, | ||
double | MxStep, | ||
const int & | GibbsWarmUp, | ||
const int & | WarmUp, | ||
const int & | NSamples, | ||
const TKronEMType & | Type = kronNodeMiss , |
||
const int & | NMissing = -1 |
||
) |
Definition at line 1692 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), AppendIsoNodes(), DebugMode, EMType, TVec< TVal, TSizeTy >::Gen(), TKronMtx::GetNodes(), KronIters, LLV, MissEdges, MtxV, ProbMtx, RealEdges, RealNodes, RestoreGraph(), RunEStep(), RunMStep(), and SetRndPerm().
double TKroneckerLL::RunMStep | ( | const TFltV & | LLV, |
const TVec< TFltV > & | DLLV, | ||
const int & | GradIter, | ||
const double & | LrnRate, | ||
double | MnStep, | ||
double | MxStep | ||
) |
Definition at line 1597 of file kronecker.cpp.
References TKronMtx::At(), CalcApxGraphDLL(), CalcApxGraphLL(), TKronMtx::Dump(), TKronMtx::GetDim(), TNGraph::GetEdges(), TKronMtx::GetLLMtx(), TKronMtx::GetMtxSum(), TNGraph::GetNodes(), GetParams(), TExeTm::GetTmStr(), GradV, Graph, TVec< TVal, TSizeTy >::Len(), LLMtx, LogLike, MetroGibbsSampleNext(), ProbMtx, RealEdges, RealNodes, and TExeTm::Tick().
Referenced by RunKronEM().
void TKroneckerLL::SampleGradient | ( | const int & | WarmUp, |
const int & | NSamples, | ||
double & | AvgLL, | ||
TFltV & | GradV | ||
) |
Definition at line 1271 of file kronecker.cpp.
References CalcApxGraphDLL(), CalcApxGraphLL(), TVec< TVal, TSizeTy >::Gen(), GetLL(), TInt::GetMegaStr(), TExeTm::GetSecs(), TExeTm::GetTmStr(), GradV, TKronMtx::Len(), LLMtx, TVec< TVal, TSizeTy >::PutAll(), SampleNextPerm(), TExeTm::Tick(), and UpdateGraphDLL().
Referenced by GradDescent(), GradDescent2(), GradDescentConvergence(), and TestKronDescent().
bool TKroneckerLL::SampleNextPerm | ( | int & | NId1, |
int & | NId2 | ||
) |
Definition at line 1111 of file kronecker.cpp.
References GEdgeV, TRnd::GetUniDev(), TRnd::GetUniDevInt(), InvertPerm, TVec< TVal, TSizeTy >::Len(), LogLike, NodePerm, Nodes, PermSwapNodeProb, TVec< TVal, TSizeTy >::Swap(), and SwapNodesLL().
Referenced by MetroGibbsSampleNext(), MetroGibbsSampleSetup(), SampleGradient(), TestGradDescent(), and TestSamplePerm().
void TKroneckerLL::SetBestDegPerm | ( | ) |
!!!!! MYUNGHWAN, CHECK!
Definition at line 842 of file kronecker.cpp.
References TKronMtx::At(), TVec< TVal, TSizeTy >::Gen(), TNGraph::TNodeI::GetDeg(), TKronMtx::GetDim(), TNGraph::GetNI(), Graph, KronIters, NodePerm, Nodes, ProbMtx, SetIPerm(), and TVec< TVal, TSizeTy >::Sort().
Referenced by SetPerm().
|
inline |
Definition at line 167 of file kronecker.h.
void TKroneckerLL::SetDegPerm | ( | ) |
Definition at line 828 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TNGraph::BegNI(), TNGraph::EndNI(), TVec< TVal, TSizeTy >::Gen(), Graph, TVec< TVal, TSizeTy >::Len(), NodePerm, SetIPerm(), and TVec< TVal, TSizeTy >::Sort().
Referenced by GradDescentConvergence(), SetPerm(), TKronMaxLL::SetPerm(), TestGradDescent(), and TestKronDescent().
void TKroneckerLL::SetGraph | ( | const PNGraph & | GraphPt | ) |
Definition at line 882 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TNGraph::BegEI(), TNGraph::EndEI(), GEdgeV, TVec< TVal, TSizeTy >::Gen(), TKronMtx::GetDim(), TNGraph::GetEdges(), TNGraph::GetNIdV(), TNGraph::GetNodes(), TSnap::GetSubGraph(), Graph, IAssert, TNGraph::IsNode(), KronIters, LEdgeV, TKronMtx::Len(), LLMtx, LSelfEdge, Nodes, ProbMtx, RealEdges, and RealNodes.
Referenced by InitLL().
void TKroneckerLL::SetIPerm | ( | const TIntV & | Perm | ) |
!!!!! MYUNGHWAN, CHECK!
Definition at line 875 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Gen(), InvertPerm, and TVec< TVal, TSizeTy >::Len().
Referenced by SetBestDegPerm(), SetDegPerm(), SetOrderPerm(), SetPerm(), SetRndPerm(), and TKroneckerLL().
void TKroneckerLL::SetOrderPerm | ( | ) |
Definition at line 813 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Gen(), TNGraph::GetNodes(), Graph, NodePerm, Nodes, and SetIPerm().
Referenced by GradDescentConvergence(), SetPerm(), TKronMaxLL::SetPerm(), TestGradDescent(), TestKronDescent(), and TestSamplePerm().
void TKroneckerLL::SetPerm | ( | const char & | PermId | ) |
Definition at line 805 of file kronecker.cpp.
References FailR, SetBestDegPerm(), SetDegPerm(), SetOrderPerm(), and SetRndPerm().
Referenced by TestBicCriterion().
|
inline |
Definition at line 183 of file kronecker.h.
References SetIPerm().
void TKroneckerLL::SetRandomEdges | ( | const int & | NEdges, |
const bool | isDir = true |
||
) |
!!!!! MYUNGHWAN, CHECK!
Definition at line 1417 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TNGraph::AddEdge(), TKronMtx::At(), EMType, GEdgeV, TKronMtx::GetDim(), TKronMtx::GetMtxSum(), TRnd::GetUniDev(), Graph, InvertPerm, TNGraph::IsEdge(), IsObsEdge(), kronEdgeMiss, KronIters, LEdgeV, TVec< TVal, TSizeTy >::Len(), LSelfEdge, Nodes, and ProbMtx.
Referenced by MetroGibbsSampleNext(), and MetroGibbsSampleSetup().
void TKroneckerLL::SetRndPerm | ( | ) |
Definition at line 820 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Gen(), TNGraph::GetNodes(), Graph, NodePerm, Nodes, SetIPerm(), and TVec< TVal, TSizeTy >::Shuffle().
Referenced by RunKronEM(), SetPerm(), TKronMaxLL::SetPerm(), and TestGradDescent().
double TKroneckerLL::SwapNodesLL | ( | const int & | NId1, |
const int & | NId2 | ||
) |
Definition at line 1083 of file kronecker.cpp.
References TKronMtx::GetApxNoEdgeLL(), TKronMtx::GetEdgeLL(), Graph, InvertPerm, TNGraph::IsEdge(), KronIters, LLMtx, LogLike, NodeLLDelta(), NodePerm, and TVec< TVal, TSizeTy >::Swap().
Referenced by SampleNextPerm().
|
static |
Definition at line 2109 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TGnuPlot::AddPlot(), TKronMtx::Dump(), TNGraph::GetEdges(), TKronMtx::GetInitMtx(), GetKronIters(), TNGraph::GetNodes(), gpwLinesPoints, GradDescent(), LLV, TGnuPlot::SavePng(), SetPerm(), TGnuPlot::SetXYLabel(), and TMath::Sqr().
|
static |
Definition at line 2138 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), TGnuPlot::AddPlot(), CalcApxGraphDLL(), CalcApxGraphLL(), TStr::CStr(), FailR, TStr::Fmt(), TKronMtx::GenFastKronecker(), TNGraph::GetEdges(), TKronMtx::GetMtx(), TNGraph::GetNodes(), gpwLines, GradV, Graph, KronIters, SampleNextPerm(), TGnuPlot::SavePng(), SetDegPerm(), SetOrderPerm(), SetRndPerm(), TGnuPlot::SetXYLabel(), and UpdateGraphDLL().
TFltQu TKroneckerLL::TestKronDescent | ( | const bool & | DoExact, |
const bool & | TruePerm, | ||
double | LearnRate, | ||
const int & | WarmUp, | ||
const int & | NSamples, | ||
const TKronMtx & | TrueParam | ||
) |
Definition at line 1942 of file kronecker.cpp.
References TKronMtx::At(), CalcApxGraphDLL(), CalcApxGraphLL(), CalcGraphDLL(), CalcGraphLL(), TKronMtx::Dump(), TKronMtx::GetAvgAbsErr(), TKronMtx::GetLLMtx(), TKronMtx::GetMtxSum(), GetParams(), TExeTm::GetSecs(), TExeTm::GetTmStr(), GradV, LLMtx, LogLike, ProbMtx, TVec< TVal, TSizeTy >::PutAll(), SampleGradient(), SetDegPerm(), and SetOrderPerm().
TFltV TKroneckerLL::TestSamplePerm | ( | const TStr & | OutFNm, |
const int & | WarmUp, | ||
const int & | NSamples, | ||
const TKronMtx & | TrueMtx, | ||
const bool & | DoPlot = true |
||
) |
Definition at line 1795 of file kronecker.cpp.
References TVec< TVal, TSizeTy >::Add(), CalcApxGraphDLL(), CalcApxGraphLL(), TStr::CStr(), TKronMtx::Dump(), TKronMtx::Empty(), TStr::Fmt(), TVec< TVal, TSizeTy >::Gen(), TNGraph::GetEdges(), GetLL(), TInt::GetMegaStr(), TNGraph::GetNodes(), GetParams(), TExeTm::GetSecs(), TExeTm::GetTmStr(), GradV, Graph, InitLL(), TVec< TVal, TSizeTy >::Len(), LogLike, NodePerm, PermSwapNodeProb, PlotAutoCorrelation(), PlotGrad(), ProbMtx, TVec< TVal, TSizeTy >::PutAll(), SampleNextPerm(), SetOrderPerm(), TExeTm::Tick(), and UpdateGraphDLL().