Categories
Uncategorized

Graph Neural Networks

A Graph Neural Network (GNN) is a Neural Network that utilizes the graph data structure and information contained within the nodes and edges to tune model parameters and produce a node label.

First nodes are given a distributed vector representation based on features of the nodes.

We then use this an input to our GNN which will use a loss function to iteratively train a model and tune parameters using Gradient Ascent to transform each node representation. These node representations can then be used to complete the task your loss function was minimizing.

Application of GNN at Uber

GNNs are used at Uber to make dish and restaurant recommendations on Uber Eats based on previous order history. There are two graphs one with users and dishes and one with users and restaurants. They have undirected weighted edges denoting how many times a dish has been ordered by a user or how many times a user has ordered from a restaurant.

The goal is to be able to take a user node and compare it with an unseen dish or restaurant node and compute the similarity of the outputs of the GNN and if it is high then we recommend this dish or restaurant.

Our model will effectively learn what general users like what general dishes or restaurants making the output similar or different. The way it decides this is by using the supplied edges. The higher the weighting between users and dishes/restaurants the similar the outputs get and if there is no edge then the outputs are different.

The quality of our model in correctly making outputs similar and different is based on the loss function. The loss function is then used in Gradient Descent to find the minimum of the loss function to make it correctly transform our node vectors.

Implementing this in offline testing, using the similarity of the outputs of the GNN for recommendations along with other features it was the most important one. A/B testing also demonstrated that using the GNN produced better recommendations.

This article was interesting because after working with NNs and CNNs this is an interesting way of using graphs with NN. Graphs seem to be a versatile data structure and can be used in many places even Reinforcement Learning.

Sources:

Food Discovery with Uber Eats: Using Graph Learning to Power Recommendations

MSR Cambridge Lecture Series: An Introduction to Graph Neural Networks: Models and Applications

https://arxiv.org/abs/1812.08434

Categories
Uncategorized

Using Graphs for Logistics

The Wikipedia article on Logistics states that Logistics is the management of the flow of things between the point of origin and the point of consumption to meet the requirements of customers and corporations. Logistics is something that many industries like e-commerce, shipping companies, fast food, etc. need to deal with.

Companies can use graphs to represent shipping networks where nodes are distribution hubs or branches and the edges are delivery routes. We can then use Dijkstra’s algorithm on the graph to determine the shortest path from one point to another.

In Logistics, there are many variables that the nodes and edges can have. Specific distribution hubs or routes might have certain properties like cost, availability, carbon footprint, time, etc. that we must also take into account. Property Graphs can be used to attach properties to nodes or edges.

Then Dijkstra’s algorithm can give us the shortest available path that can minimize many things like cost and carbon footprint also taking into account things like what we are transporting.

Something that I didn’t think about that is discussed in the article I read was the computation time taken to find the shortest path. Property Graphs solve this computation problem and this is why they are used instead of regular Graphs as they take node and edge properties into account during computation rather than after.

Source: https://dev.to/fppt/managing-delivery-networks-a-use-case-for-graph-databases-2jb0