Create a graph learning engine. See params detail in :meth:`graphscope.Session.graphlearn` Returns: :class:`graphscope.learning.GraphDAGNode`: An instance of learning graph that could be feed to the learning engine, evaluated in eager node. Example: .. code::
(graph, nodes=None, edges=None, gen_labels=None)
| 1654 | |
| 1655 | |
| 1656 | def graphlearn(graph, nodes=None, edges=None, gen_labels=None): |
| 1657 | """Create a graph learning engine. |
| 1658 | |
| 1659 | See params detail in :meth:`graphscope.Session.graphlearn` |
| 1660 | |
| 1661 | Returns: |
| 1662 | :class:`graphscope.learning.GraphDAGNode`: |
| 1663 | An instance of learning graph that could be feed to the learning engine, evaluated in eager node. |
| 1664 | |
| 1665 | Example: |
| 1666 | |
| 1667 | .. code:: python |
| 1668 | |
| 1669 | >>> import graphscope |
| 1670 | >>> g = graphscope.g() |
| 1671 | >>> lg = graphscope.learning(g) |
| 1672 | """ |
| 1673 | assert graph is not None, "graph cannot be None" |
| 1674 | assert ( |
| 1675 | graph._session is not None |
| 1676 | ), "The graph object is invalid" # pylint: disable=protected-access |
| 1677 | return graph._session.graphlearn( |
| 1678 | graph, nodes, edges, gen_labels |
| 1679 | ) # pylint: disable=protected-access |
| 1680 | |
| 1681 | |
| 1682 | def graphlearn_torch( |
nothing calls this directly
no test coverage detected