Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasZahradnik committed Oct 24, 2024
1 parent 1dffc33 commit 02f8696
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 5 additions & 4 deletions docs/advanced/database_deep_learning.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Deep Learning on Databases
==========================

Expand Down Expand Up @@ -111,12 +112,12 @@ With just those few lines of code, we have managed to create a relational datase
Training on data from database
******************************

The dataset is ready; let's now take a look at defining the *template*, which roughly corresponds to creating a neural model architecture.
The dataset is ready; let's now take a look at defining the *template*, which roughly corresponds to creating a neural model architecture.
A template can be seen as a high-level blueprint for constructing a computation graph, which will be automatically tailored for each example and its target query.

The template we will define here calculates embeddings for each type of chemical bond (bond type is an integer in the range 1-7). Then we will
define four stacked *Message Passing Neural Networks* (*MPNNs*) where edges are bonds and nodes are chemical atoms. Our proposed
layers are similar to the *GraphSAGE* architecture except for the extra edge (*bond*) embeddings. Finally, the template
layers are similar to the *GraphSAGE* architecture except for the extra edge (*bond*) embeddings. Finally, the template
defines a readout layer (*mutagenic*) that pools embeddings of all nodes from all layers and aggregates them into one
value passed into a sigmoid function for the target molecule classification.

Expand All @@ -140,9 +141,9 @@ value passed into a sigmoid function for the target molecule classification.
template += R.layer4(V.A)[1,] <= (R.layer3(V.N)[1,], R.bond_embed(V.B)[1,], R._bond(V.N, V.A, V.B))
template += R.layer4(V.A)[1,] <= R.layer3(V.A)[1,]
template += (R.mutagenic(V.M)[1,] <= (
template += R.mutagenic(V.M)[1,] <= (
R.layer1(V.A)[1,], R.layer2(V.A)[1,], R.layer3(V.A)[1,], R.layer4(V.A)[1,], R.atom(V.A, V.M)[1,]
)) | [Transformation.IDENTITY]
)
template += R.mutagenic / 1 | [Transformation.SIGMOID]
Expand Down
9 changes: 3 additions & 6 deletions docs/advanced/eval_inference_engine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,20 @@ to get to the goal station. The second rule aggregates all possible instances an

.. code-block:: Python
metadata = Metadata(aggregation=Aggregation.MIN, transformation=Transformation.IDENTITY)
metadata = Metadata(aggregation=Aggregation.MIN)
template += (R.shortest(V.X, V.Y) <= R.connected(V.X, V.Y, V.L)) | metadata
template += (R.shortest(V.X, V.Y) <= (R.connected(V.X, V.Z, V.L), R.shortest_path(V.Z, V.Y))) | metadata
.. attention::

Notice we are appending metadata with aggregation (Min) and transformation (Identity) functions.
Notice we are appending metadata with an aggregation (Min) functions.


It is also necessary to set additional transformation functions to identity.

.. code-block:: Python
template += R.shortest_path / 2 | Metadata(combination=Combination.MIN, transformation=Transformation.IDENTITY)
template += R.connected / 3 | Metadata(transformation=Transformation.IDENTITY)
template += R.shortest_path / 2 | Metadata(combination=Combination.MIN)
Evaluating Queries
Expand Down

0 comments on commit 02f8696

Please sign in to comment.