MarkovRandomField.loadGUM

MarkovRandomField.loadGUM(name, binary=None)

Load a jgum (JSON) or bgum (binary/msgpack) file.

Parameters:
  • name (str) – the file’s path (extension: .jgum for JSON, .bgum for binary)

  • binary (bool, optional) – True to read a bgum (msgpack) file, False to read a jgum (JSON) file. By default, the format is given by the extension (binary for an unknown extension).

Raises:
Return type:

None

See also

JGUM / BGUM Format Reference

complete format reference

Example

import pyagrum as gum

mrf = gum.fastMRF("A--B;B--C")
mrf.saveGUM("model.jgum")
mrf2 = gum.MarkovRandomField()
mrf2.loadGUM("model.jgum")
mrf2.hasSameStructure(mrf)
# True

Class

MarkovRandomField