liveBook · Manning

Multilayer perceptron

As explained in Graph Neural Networks in Action

A multilayer perceptron is a feed-forward neural network composed of one or more fully connected hidden layers between its input and output layers.

A multilayer perceptron (MLP) is a feed-forward neural network with fully connected hidden layers between its input and output. It transforms an input vector through successive linear layers and activations to produce a prediction. In graph workflows, an MLP provides a non-GNN baseline: each node becomes one tabular observation containing node features, while graph structure and geometry are ignored. section 4.3 section 2.4.4

A practical PyTorch MLP follows this pipeline:

  • Define the network as a class with an input size, hidden-layer widths, and output size. section 4.3.1
  • Pass the input through linear layers, applying ReLU after hidden layers and sigmoid at the output for binary prediction. section 4.3.1
  • Train with binary cross-entropy and evaluate predictions using accuracy-oriented metrics such as ROC and AUC. section 4.3 section 4.3.1

Node-classification baseline

A three-layer PyTorch MLP uses two hidden layers with widths 128 and 256, followed by a one-output layer. Trained for 100 epochs, it reaches 85.93% ROC AUC, performing between logistic regression and XGBoost on the same node-feature data. section 4.3.1

Figure 2.14 Structure of a multilayer perceptron
figure

Use the architecture diagram to inspect how an input vector flows through hidden layers toward an output. section 2.4.4

How Graph Neural Networks in Action covers it

How deep it goes
Defines layers, activations, loss, optimizer settings, epochs, and evaluation, but does not derive the network mathematically.
Examples
Uses node-feature classification, flattened image inputs, dog-or-cat outputs, and node2vec traversal vectors as examples.
What it assumes
Assumes feature matrices, labels, train-test splitting, and binary classification while introducing the MLP architecture through code.
What you can do after
Build it from scratch in PyTorch and compare its predictions with logistic regression, XGBoost, and graph neural network baselines.
How it connects
Connects hidden layers with embeddings, image classification, node2vec, graph neural networks, logistic regression, XGBoost, and ROC AUC.

Also explained in

Compare how 2 books explain multilayer perceptron →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Neural Networks in Action. The section links point to the parts of the book it draws on.