compositional_graph_models/data.py
def deserialize_binary(
    equation: Dict[str, str],
    function_vocab: Dict[str, int],
    token_vocab: Dict[str, int],
) -> dgl.DGLGraph:
    """
    Deserialize binary equation data from the "equation_verification_40k" format
    into a DGLGraph. See the module docstring for the graph properties.

    Parameters
    ----------
    equation
        The "equation" field of a serialized example; a serialized binary tree.
    function_vocab
        A mapping from function name to id. See `build_vocabs()`.
    token_vocab
        A mapping from token name to id. See `build_vocabs()`.

    Returns
    -------
    DGLGraph
        The equation tree, deserialized into a usable data structure.
    """
    func = equation["func"].split(",")
    vars = equation["vars"].split(",")
    return _deserialize_binary_recurse(func, vars, function_vocab, token_vocab)

    Deserialize binary equation data from the "equation_verification_40k" format
    into a DGLGraph. See the module docstring for the graph properties.

    Parameters
    ----------
    equation
        The "equation" field of a serialized example; a serialized binary tree.
    function_vocab
        A mapping from function name to id. See `build_vocabs()`.
    token_vocab
        A mapping from token name to id. See `build_vocabs()`.

    Returns
    -------
    DGLGraph
        The equation tree, deserialized into a usable data structure.
    
Deserialize binary equation data from the "equation_verification_40k" format
into a DGLGraph. See the module docstring for the graph properties.

Parameters

equation
The "equation" field of a serialized example; a serialized binary tree.
function_vocab
A mapping from function name to id.

Returns

DGLGraph
The equation tree, deserialized into a usable data structure.
Deserialize binary equation data from the " equation_verification_40k " format into a DGLGraph . See the module docstring for the graph properties . Parameters equation The " equation " field of a serialized example ; a serialized binary tree . function_vocab A mapping from function name to id . Returns DGLGraph The equation tree deserialized into a usable data structure .
def deserialize_binary(
    equation: Dict[str, str],
    function_vocab: Dict[str, int],
    token_vocab: Dict[str, int],
) -> dgl.DGLGraph:
    func = equation["func"].split(",")
    vars = equation["vars"].split(",")
    return _deserialize_binary_recurse(func, vars, function_vocab, token_vocab)
def deserialize_binary ( equation : Dict [ str , str ] , function_vocab : Dict [ str , int ] , token_vocab : Dict [ str , int ] , ) -> dgl . DGLGraph : func = equation [ "func" ] . split ( "," ) vars = equation [ "vars" ] . split ( "," ) return _deserialize_binary_recurse ( func , vars , function_vocab , token_vocab )
Deserialize binary equation data from the "equation_verification_40k" format
into a DGLGraph.
Deserialize binary equation data from the " equation_verification_40k " format into a DGLGraph .
"""
    Deserialize binary equation data from the "equation_verification_40k" format
    into a DGLGraph. See the module docstring for the graph properties.

    Parameters
    ----------
    equation
        The "equation" field of a serialized example; a serialized binary tree.
    function_vocab
        A mapping from function name to id. See `build_vocabs()`.
    token_vocab
        A mapping from token name to id. See `build_vocabs()`.

    Returns
    -------
    DGLGraph
        The equation tree, deserialized into a usable data structure.
    """
equation
Dict[str, str]
function_vocab
Dict[str, int]
token_vocab
Dict[str, int]