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
TKronMaxLL Class Reference

#include <kronecker.h>

Collaboration diagram for TKronMaxLL:

Classes

class  TFEval
 

Public Member Functions

 TKronMaxLL (const PNGraph &GraphPt, const TKronMtx &StartParam)
 
void SetPerm (const char &PermId)
 
void GradDescent (const int &NIter, const double &LrnRate, const double &MnStep, const double &MxStep, const double &WarmUp, const double &NSamples)
 

Static Public Member Functions

static void RoundTheta (const TFltV &ThetaV, TFltV &NewThetaV)
 
static void RoundTheta (const TFltV &ThetaV, TKronMtx &Kronecker)
 
static void Test ()
 

Private Attributes

THash< TKronMtx, TFEvalFEvalH
 
TKroneckerLL KronLL
 

Detailed Description

Definition at line 265 of file kronecker.h.

Constructor & Destructor Documentation

TKronMaxLL::TKronMaxLL ( const PNGraph GraphPt,
const TKronMtx StartParam 
)
inline

Definition at line 283 of file kronecker.h.

283 : KronLL(GraphPt, StartParam) { }
TKroneckerLL KronLL
Definition: kronecker.h:281

Member Function Documentation

void TKronMaxLL::GradDescent ( const int &  NIter,
const double &  LrnRate,
const double &  MnStep,
const double &  MxStep,
const double &  WarmUp,
const double &  NSamples 
)
void TKronMaxLL::RoundTheta ( const TFltV ThetaV,
TFltV NewThetaV 
)
static

Definition at line 2354 of file kronecker.cpp.

References TVec< TVal, TSizeTy >::Gen(), TVec< TVal, TSizeTy >::Len(), and TMath::Round().

2354  {
2355  NewThetaV.Gen(ThetaV.Len());
2356  for (int i = 0; i < ThetaV.Len(); i++) {
2357  NewThetaV[i] = TMath::Round(ThetaV[i], 3); }
2358 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
static double Round(const double &Val)
Definition: xmath.h:16
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:523

Here is the call graph for this function:

void TKronMaxLL::RoundTheta ( const TFltV ThetaV,
TKronMtx Kronecker 
)
static

Definition at line 2361 of file kronecker.cpp.

References TKronMtx::At(), TKronMtx::GenMtx(), TVec< TVal, TSizeTy >::Len(), and TMath::Round().

2361  {
2362  Kronecker.GenMtx((int)sqrt((double)ThetaV.Len()));
2363  for (int i = 0; i < ThetaV.Len(); i++) {
2364  Kronecker.At(i) = TMath::Round(ThetaV[i], 3); }
2365 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
const double & At(const int &Row, const int &Col) const
Definition: kronecker.h:46
static double Round(const double &Val)
Definition: xmath.h:16
void GenMtx(const int &Dim)
Definition: kronecker.h:40

Here is the call graph for this function:

void TKronMaxLL::SetPerm ( const char &  PermId)

Definition at line 2297 of file kronecker.cpp.

References FailR, KronLL, TKroneckerLL::SetDegPerm(), TKroneckerLL::SetOrderPerm(), and TKroneckerLL::SetRndPerm().

Referenced by Test().

2297  {
2298  if (PermId == 'o') KronLL.SetOrderPerm();
2299  else if (PermId == 'd') KronLL.SetDegPerm();
2300  else if (PermId == 'r') KronLL.SetRndPerm();
2301  else FailR("Unknown permutation type (o,d,r)");
2302 }
void SetOrderPerm()
Definition: kronecker.cpp:813
TKroneckerLL KronLL
Definition: kronecker.h:281
void SetDegPerm()
Definition: kronecker.cpp:828
void SetRndPerm()
Definition: kronecker.cpp:820
#define FailR(Reason)
Definition: bd.h:240

Here is the call graph for this function:

Here is the caller graph for this function:

void TKronMaxLL::Test ( )
static

Definition at line 2367 of file kronecker.cpp.

References TKronMtx::GenFastKronecker(), TKronMtx::GetMtx(), TVec< TFlt >::GetV(), TKronMtx::PutRndSeed(), and SetPerm().

2367  {
2369  TKronMtx KronParam = TKronMtx::GetMtx("0.8 0.7; 0.6 0.5");
2370  PNGraph Graph = TKronMtx::GenFastKronecker(KronParam, 8, true, 1);
2371 
2372  TKronMaxLL KronMaxLL(Graph, TFltV::GetV(0.9, 0.7, 0.5, 0.3));
2373  KronMaxLL.SetPerm('d');
2374  //KronMaxLL.MaximizeLL(10000, 50000);
2375  /*TKroneckerLL KronLL(Graph, *TKronMtx::GetMtx("0.9 0.7; 0.5 0.3"));
2376  KronLL.SetDegPerm();
2377  KronLL.GradDescent(0.005/double(Graph->GetNodes()));*/
2378 }
TFltV & GetMtx()
Definition: kronecker.h:35
static void PutRndSeed(const int &Seed)
Definition: kronecker.h:108
Definition: bd.h:196
static TVec< TFlt, int > GetV(const TFlt &Val1)
Returns a vector on element Val1.
Definition: ds.h:848
static PNGraph GenFastKronecker(const TKronMtx &SeedMtx, const int &NIter, const bool &IsDir, const int &Seed=0)
Definition: kronecker.cpp:349

Here is the call graph for this function:

Member Data Documentation

THash<TKronMtx, TFEval> TKronMaxLL::FEvalH
private

Definition at line 280 of file kronecker.h.

TKroneckerLL TKronMaxLL::KronLL
private

Definition at line 281 of file kronecker.h.

Referenced by SetPerm().


The documentation for this class was generated from the following files: