SNAP Library 4.0, User Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TKronMaxLL Class Reference

#include <kronecker.h>


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 

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 

Definition at line 2354 of file kronecker.cpp.

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
void TKronMaxLL::RoundTheta ( const TFltV ThetaV,
TKronMtx Kronecker 

Definition at line 2361 of file kronecker.cpp.

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
void TKronMaxLL::SetPerm ( const char &  PermId)

Definition at line 2297 of file kronecker.cpp.

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
void TKronMaxLL::Test ( )

Definition at line 2367 of file kronecker.cpp.

2367  {
2369  TKronMtx KronParam = TKronMtx::GetMtx("0.8 0.7; 0.6 0.5");
2370  PNGraph Graph = TKronMtx::GenFastKronecker(KronParam, 8, true, 1);
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
static TVec< TFlt, TSizeTy > 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

Member Data Documentation

THash<TKronMtx, TFEval> TKronMaxLL::FEvalH

Definition at line 280 of file kronecker.h.

TKroneckerLL TKronMaxLL::KronLL

Definition at line 281 of file kronecker.h.

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