Пример #1
0
def loadGm(f, d='gm', operator='adder'):
    """ save a graphical model to a hdf5 file:
  Args:
    f  : filepath 
    g  : dataset (defaut : 'gm')
    operator : operator of the graphical model ('adder' / 'multiplier')
  """
    if (operator == 'adder'):
        gm = adder.GraphicalModel()
    elif (operator == 'multiplier'):
        gm = multiplier.GraphicalModel()
    else:
        raise RuntimeError("unknown operator: " + operator)
    hdf5.loadGraphicalModel(gm, f, d)
    return gm
Пример #2
0
def loadGm(f,d='gm',operator='adder'):
  """ save a graphical model to a hdf5 file:
  Args:
    f  : filepath 
    g  : dataset (defaut : 'gm')
    operator : operator of the graphical model ('adder' / 'multiplier')
  """
  if(operator=='adder'):
    gm=adder.GraphicalModel()
  elif(operator=='multiplier'):
    gm=multiplier.GraphicalModel()
  else:
    raise RuntimeError("unknown operator: "+ operator)
  hdf5.loadGraphicalModel(gm,f,d)
  return gm