layer_diff_pool: DiffPool

Description Usage

View source: R/layers_pool.R

Description

\loadmathjax

A DiffPool layer as presented by Ying et al. (2018).

Mode: batch.

This layer computes a soft clustering \mjeqn\boldsymbolS of the input graphs using a GNN, and reduces graphs as follows:

\mjdeqn\boldsymbol

S = \textrmGNN(\boldsymbolA, \boldsymbolX); \\boldsymbolA' = \boldsymbolS^\top \boldsymbolA \boldsymbolS; \boldsymbolX' = \boldsymbolS^\top \boldsymbolX;

where GNN consists of one GraphConv layer with softmax activation. Two auxiliary loss terms are also added to the model: the link prediction loss \mjdeqn\big\| \boldsymbolA - \boldsymbolS\S^\top \big\| _ F and the entropy loss \mjdeqn- \frac1N \sum\limits_i = 1^N \boldsymbolS \log (\boldsymbolS).

The layer also applies a 1-layer GCN to the input features, and returns the updated graph signal (the number of output channels is controlled by the channels parameter). The layer can be used without a supervised loss, to compute node clustering simply by minimizing the two auxiliary losses.

Input

Output

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
layer_diff_pool(
  object,
  k,
  channels = NULL,
  return_mask = FALSE,
  activation = NULL,
  kernel_initializer = "glorot_uniform",
  kernel_regularizer = NULL,
  kernel_constraint = NULL,
  ...
)

rdinnager/rspektral documentation built on June 12, 2021, 1:26 a.m.