BayesNet.spaceCplxToString

static BayesNet.spaceCplxToString(dSize, dim, usedMem)

Return a human-readable string summarising the space complexity of a graphical model.

Parameters:
  • dSize (float) – log10 of the joint domain size

  • dim (int) – number of independent parameters

  • usedMem (int) – memory footprint in bytes

Returns:

a string of the form 'domainSize: X, dim: Y, mem: Z'

Return type:

str

Example

import pyagrum as gum

gum.BayesNet.spaceCplxToString(3.0, 42, 2048)  # log10 domain size, dimension, memory
# 'domainSize: 1000, dim: 42, mem: 2Ko 0o'
bn = gum.fastBN("A->B->C")
s = bn.spaceCplxToString(bn.log10DomainSize(), bn.dim(), bn.memoryFootprint())
s.startswith("domainSize: 8, dim: 5")
# True

Class

BayesNet