Modeling graphs using deep neural networks
We can consider graphs as a more general structure of almost all non-tabular data we use for machine learning and deep learning modeling. Sequences can be considered one-dimensional (1D), while images or image shape data can be considered two-dimensional (2D) (see Figure 13.7). Earlier in this chapter, you learned how to start benefiting from CNNs and transformers in Python and PyTorch for sequence and image shape data. But more general graphs don’t fit into these two graphs, which have predefined structures (see Figure 13.7), and we cannot simply model them using CNNs or sequence models:
Figure 13.7 – Graph representation of different unstructured data types
Graphs have two important elements, called nodes and edges. The edges connect the nodes. The nodes and edges of graphs can have different characteristics that differentiate them from each other (see Figure 13.8):
Figure...