SNAP Library 3.0, User Reference
2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <mag.h>
Public Member Functions | |
TMAGFitBern () | |
TMAGFitBern (const PNGraph &G, const int &NAttrs) | |
TMAGFitBern (const PNGraph &G, const TStr &InitFNm) | |
void | Clr () |
void | SaveTxt (const TStr &FNm) |
const int | GetNodes () const |
const int | GetAttrs () const |
const TMAGParam< TMAGNodeBern > & | GetParams () const |
const TMAGNodeBern & | GetNodeAttr () const |
const TFltV & | GetMuV () const |
void | SetMuV (const TFltV &MuV) |
void | GetMtxV (TMAGAffMtxV &MtxV) const |
void | SetMtxV (const TMAGAffMtxV &MtxV) |
PNGraph | GetGraph () |
void | SetGraph (const PNGraph &GraphPt) |
void | SetDebug (const bool _Debug) |
void | SetAlgConf (const bool EStep=true, const bool MStep=true) |
void | Init (const TFltV &MuV, const TMAGAffMtxV &AffMtxV) |
void | RandomInit (const TFltV &MuV, const TMAGAffMtxV &AffMtxV, const int &Seed) |
const TFltVV & | GetPhiVV () const |
void | SetPhiVV (const TIntVV &AttrVV, const int KnownIds=0) |
void | SetPhiVV (const TFltVV &AttrVV, const int KnownIds=0) |
const double | GetInCoeff (const int &i, const int &j, const int &l, const int &A, const TMAGAffMtx &Theta) const |
const double | GetAvgInCoeff (const int &i, const int &AId, const int &A, const TMAGAffMtx &Theta) const |
const double | GetOutCoeff (const int &i, const int &j, const int &l, const int &A, const TMAGAffMtx &Theta) const |
const double | GetAvgOutCoeff (const int &i, const int &AId, const int &A, const TMAGAffMtx &Theta) const |
const double | GetProbPhi (const int &NId1, const int &NId2, const int &AId, const int &Attr1, const int &Attr2) const |
const double | GetProbMu (const int &NId1, const int &NId2, const int &AId, const int &Attr1, const int &Attr2, const bool Left=false, const bool Right=false) const |
const double | GetThetaLL (const int &NId1, const int &NId2, const int &AId) const |
const double | GetAvgThetaLL (const int &NId1, const int &NId2, const int &AId, const bool Left=false, const bool Right=false) const |
const double | GetSqThetaLL (const int &NId1, const int &NId2, const int &AId) const |
const double | GetAvgSqThetaLL (const int &NId1, const int &NId2, const int &AId, const bool Left=false, const bool Right=false) const |
const double | GetProdLinWeight (const int &NId1, const int &NId2) const |
const double | GetAvgProdLinWeight (const int &NId1, const int &NId2, const bool Left=false, const bool Right=false) const |
const double | GetProdSqWeight (const int &NId1, const int &NId2) const |
const double | GetAvgProdSqWeight (const int &NId1, const int &NId2, const bool Left=false, const bool Right=false) const |
const double | GetEstNoEdgeLL (const int &NId, const int &AId) const |
const double | GradPhiMI (const double &x, const int &NId, const int &AId, const double &Lambda, const double &DeltaQ, const TFltVV &CntVV) |
const double | ObjPhiMI (const double &x, const int &NId, const int &AId, const double &Lambda, const double &Q0, const double &Q1, const TFltVV &CntVV) |
const double | UpdatePhiMI (const double &Lambda, const int &NId, const int &AId, double &Phi) |
const double | UpdateApxPhiMI (const double &Lambda, const int &NId, const int &AId, double &Phi, TFltVV &ProdVV) |
const double | UpdatePhi (const int &NId, const int &AId, double &Phi) |
const double | UpdateMu (const int &AId) |
const void | PrepareUpdateAffMtx (TFltVV &ProdVV, TFltVV &SqVV) |
const void | PrepareUpdateApxAffMtx (TFltVV &ProdVV, TFltVV &SqVV) |
const double | UpdateAffMtx (const int &AId, const double &LrnRate, const double &MaxGrad, const double &Lambda, TFltVV &ProdVV, TFltVV &SqVV, TMAGAffMtx &NewMtx) |
const double | UpdateAffMtxV (const int &GradIter, const double &LrnRate, const double &MaxGrad, const double &Lambda, const int &NReal=0) |
const void | GradAffMtx (const int &AId, const TFltVV &ProdVV, const TFltVV &SqVV, const TMAGAffMtx &CurMtx, TFltV &GradV) |
const void | GradApxAffMtx (const int &AId, const TFltVV &ProdVV, const TFltVV &SqVV, const TMAGAffMtx &CurMtx, TFltV &GradV) |
double | DoEStepOneIter (const TFltV &TrueMuV, TFltVV &NewPhi, const double &Lambda) |
double | DoEStepApxOneIter (const TFltV &TrueMuV, TFltVV &NewPhi, const double &Lambda) |
double | DoEStep (const TFltV &TrueMuV, const int &NIter, double &LL, const double &Lambda) |
void | DoMStep (const int &GradIter, const double &LrnRate, const double &MaxGrad, const double &Lambda, const int &NReal=0) |
void | DoEMAlg (const int &NStep, const int &NEstep, const int &NMstep, const double &LrnRate, const double &MaxGrad, const double &Lambda, const double &ReInit, const int &NReal=0) |
void | CountAttr (TFltV &EstMuV) const |
void | SortAttrOrdering (const TFltV &TrueMuV, TIntV &IndexV) const |
const double | ComputeJointOneLL (const TIntVV &AttrVV) const |
const double | ComputeJointLL (int NSample) const |
const double | ComputeJointAdjLL (const TIntVV &AttrVV) const |
const double | ComputeApxLL () const |
const double | ComputeApxAdjLL () const |
void | MakeCCDF (const TFltPrV &RawV, TFltPrV &CcdfV) |
void | PlotProperties (const TStr &FNm) |
void | NormalizeAffMtxV (TMAGAffMtxV &MtxV, const bool UseMu=false) |
void | UnNormalizeAffMtxV (TMAGAffMtxV &MtxV, const bool UseMu=false) |
Static Public Member Functions | |
static const double | ComputeMI (const TIntVV &AttrV, const int AId1, const int AId2) |
static const double | ComputeMI (const TFltVV &AttrV, const int AId1, const int AId2) |
static const double | ComputeMI (const TIntVV &AttrV) |
static const double | ComputeMI (const TFltVV &AttrV) |
Private Member Functions | |
const bool | NextPermutation (TIntV &IndexV) const |
Private Attributes | |
TFltVV | PhiVV |
TBoolVV | KnownVV |
PNGraph | Graph |
TMAGParam< TMAGNodeBern > | Param |
bool | ESpeedUp |
bool | MSpeedUp |
bool | Debug |
TFltV | AvgPhiV |
TFltVV | AvgPhiPairVV |
TFlt | NormConst |
TVec< TFltV > | MuHisV |
TVec< TMAGAffMtxV > | MtxHisV |
TFltV | LLHisV |
|
inline |
|
inline |
Definition at line 358 of file mag.h.
Definition at line 360 of file mag.h.
const double TMAGFitBern::ComputeApxAdjLL | ( | ) | const |
Definition at line 2046 of file mag.cpp.
const double TMAGFitBern::ComputeApxLL | ( | ) | const |
Definition at line 2005 of file mag.cpp.
const double TMAGFitBern::ComputeJointAdjLL | ( | const TIntVV & | AttrVV | ) | const |
Definition at line 1942 of file mag.cpp.
const double TMAGFitBern::ComputeJointLL | ( | int | NSample | ) | const |
Definition at line 1976 of file mag.cpp.
const double TMAGFitBern::ComputeJointOneLL | ( | const TIntVV & | AttrVV | ) | const |
Definition at line 1900 of file mag.cpp.
|
static |
|
static |
|
static |
Definition at line 2154 of file mag.cpp.
|
static |
Definition at line 2168 of file mag.cpp.
void TMAGFitBern::CountAttr | ( | TFltV & | EstMuV | ) | const |
void TMAGFitBern::DoEMAlg | ( | const int & | NStep, |
const int & | NEstep, | ||
const int & | NMstep, | ||
const double & | LrnRate, | ||
const double & | MaxGrad, | ||
const double & | Lambda, | ||
const double & | ReInit, | ||
const int & | NReal = 0 |
||
) |
Definition at line 1630 of file mag.cpp.
double TMAGFitBern::DoEStep | ( | const TFltV & | TrueMuV, |
const int & | NIter, | ||
double & | LL, | ||
const double & | Lambda | ||
) |
Definition at line 1272 of file mag.cpp.
double TMAGFitBern::DoEStepApxOneIter | ( | const TFltV & | TrueMuV, |
TFltVV & | NewPhi, | ||
const double & | Lambda | ||
) |
Definition at line 1134 of file mag.cpp.
double TMAGFitBern::DoEStepOneIter | ( | const TFltV & | TrueMuV, |
TFltVV & | NewPhi, | ||
const double & | Lambda | ||
) |
Definition at line 1056 of file mag.cpp.
void TMAGFitBern::DoMStep | ( | const int & | GradIter, |
const double & | LrnRate, | ||
const double & | MaxGrad, | ||
const double & | Lambda, | ||
const int & | NReal = 0 |
||
) |
Definition at line 1608 of file mag.cpp.
const double TMAGFitBern::GetAvgInCoeff | ( | const int & | i, |
const int & | AId, | ||
const int & | A, | ||
const TMAGAffMtx & | Theta | ||
) | const |
const double TMAGFitBern::GetAvgOutCoeff | ( | const int & | i, |
const int & | AId, | ||
const int & | A, | ||
const TMAGAffMtx & | Theta | ||
) | const |
const double TMAGFitBern::GetAvgProdLinWeight | ( | const int & | NId1, |
const int & | NId2, | ||
const bool | Left = false , |
||
const bool | Right = false |
||
) | const |
Definition at line 642 of file mag.cpp.
const double TMAGFitBern::GetAvgProdSqWeight | ( | const int & | NId1, |
const int & | NId2, | ||
const bool | Left = false , |
||
const bool | Right = false |
||
) | const |
Definition at line 664 of file mag.cpp.
const double TMAGFitBern::GetAvgSqThetaLL | ( | const int & | NId1, |
const int & | NId2, | ||
const int & | AId, | ||
const bool | Left = false , |
||
const bool | Right = false |
||
) | const |
Definition at line 620 of file mag.cpp.
const double TMAGFitBern::GetAvgThetaLL | ( | const int & | NId1, |
const int & | NId2, | ||
const int & | AId, | ||
const bool | Left = false , |
||
const bool | Right = false |
||
) | const |
Definition at line 598 of file mag.cpp.
const double TMAGFitBern::GetEstNoEdgeLL | ( | const int & | NId, |
const int & | AId | ||
) | const |
const double TMAGFitBern::GetInCoeff | ( | const int & | i, |
const int & | j, | ||
const int & | l, | ||
const int & | A, | ||
const TMAGAffMtx & | Theta | ||
) | const |
|
inline |
|
inline |
|
inline |
const double TMAGFitBern::GetOutCoeff | ( | const int & | i, |
const int & | j, | ||
const int & | l, | ||
const int & | A, | ||
const TMAGAffMtx & | Theta | ||
) | const |
|
inline |
const double TMAGFitBern::GetProbMu | ( | const int & | NId1, |
const int & | NId2, | ||
const int & | AId, | ||
const int & | Attr1, | ||
const int & | Attr2, | ||
const bool | Left = false , |
||
const bool | Right = false |
||
) | const |
const double TMAGFitBern::GetProbPhi | ( | const int & | NId1, |
const int & | NId2, | ||
const int & | AId, | ||
const int & | Attr1, | ||
const int & | Attr2 | ||
) | const |
const double TMAGFitBern::GetProdLinWeight | ( | const int & | NId1, |
const int & | NId2 | ||
) | const |
Definition at line 631 of file mag.cpp.
const double TMAGFitBern::GetProdSqWeight | ( | const int & | NId1, |
const int & | NId2 | ||
) | const |
Definition at line 653 of file mag.cpp.
const double TMAGFitBern::GetSqThetaLL | ( | const int & | NId1, |
const int & | NId2, | ||
const int & | AId | ||
) | const |
Definition at line 609 of file mag.cpp.
const double TMAGFitBern::GetThetaLL | ( | const int & | NId1, |
const int & | NId2, | ||
const int & | AId | ||
) | const |
Definition at line 587 of file mag.cpp.
const void TMAGFitBern::GradAffMtx | ( | const int & | AId, |
const TFltVV & | ProdVV, | ||
const TFltVV & | SqVV, | ||
const TMAGAffMtx & | CurMtx, | ||
TFltV & | GradV | ||
) |
Definition at line 1320 of file mag.cpp.
const void TMAGFitBern::GradApxAffMtx | ( | const int & | AId, |
const TFltVV & | ProdVV, | ||
const TFltVV & | SqVV, | ||
const TMAGAffMtx & | CurMtx, | ||
TFltV & | GradV | ||
) |
Definition at line 1346 of file mag.cpp.
const double TMAGFitBern::GradPhiMI | ( | const double & | x, |
const int & | NId, | ||
const int & | AId, | ||
const double & | Lambda, | ||
const double & | DeltaQ, | ||
const TFltVV & | CntVV | ||
) |
void TMAGFitBern::Init | ( | const TFltV & | MuV, |
const TMAGAffMtxV & | AffMtxV | ||
) |
|
private |
void TMAGFitBern::NormalizeAffMtxV | ( | TMAGAffMtxV & | MtxV, |
const bool | UseMu = false |
||
) |
Definition at line 1454 of file mag.cpp.
const double TMAGFitBern::ObjPhiMI | ( | const double & | x, |
const int & | NId, | ||
const int & | AId, | ||
const double & | Lambda, | ||
const double & | Q0, | ||
const double & | Q1, | ||
const TFltVV & | CntVV | ||
) |
void TMAGFitBern::PlotProperties | ( | const TStr & | FNm | ) |
Definition at line 1727 of file mag.cpp.
Definition at line 1532 of file mag.cpp.
Definition at line 1545 of file mag.cpp.
void TMAGFitBern::RandomInit | ( | const TFltV & | MuV, |
const TMAGAffMtxV & | AffMtxV, | ||
const int & | Seed | ||
) |
|
inline |
void TMAGFitBern::SetGraph | ( | const PNGraph & | GraphPt | ) |
Definition at line 385 of file mag.cpp.
|
inline |
|
inline |
void TMAGFitBern::SetPhiVV | ( | const TIntVV & | AttrVV, |
const int | KnownIds = 0 |
||
) |
|
inline |
void TMAGFitBern::UnNormalizeAffMtxV | ( | TMAGAffMtxV & | MtxV, |
const bool | UseMu = false |
||
) |
Definition at line 1492 of file mag.cpp.
const double TMAGFitBern::UpdateAffMtx | ( | const int & | AId, |
const double & | LrnRate, | ||
const double & | MaxGrad, | ||
const double & | Lambda, | ||
TFltVV & | ProdVV, | ||
TFltVV & | SqVV, | ||
TMAGAffMtx & | NewMtx | ||
) |
Definition at line 1418 of file mag.cpp.
const double TMAGFitBern::UpdateAffMtxV | ( | const int & | GradIter, |
const double & | LrnRate, | ||
const double & | MaxGrad, | ||
const double & | Lambda, | ||
const int & | NReal = 0 |
||
) |
Definition at line 1558 of file mag.cpp.
const double TMAGFitBern::UpdateApxPhiMI | ( | const double & | Lambda, |
const int & | NId, | ||
const int & | AId, | ||
double & | Phi, | ||
TFltVV & | ProdVV | ||
) |
Definition at line 930 of file mag.cpp.
const double TMAGFitBern::UpdateMu | ( | const int & | AId | ) |
const double TMAGFitBern::UpdatePhi | ( | const int & | NId, |
const int & | AId, | ||
double & | Phi | ||
) |
Definition at line 756 of file mag.cpp.
const double TMAGFitBern::UpdatePhiMI | ( | const double & | Lambda, |
const int & | NId, | ||
const int & | AId, | ||
double & | Phi | ||
) |
Definition at line 826 of file mag.cpp.
|
private |
|
private |