Wraps the function
feature_steered_convolution as a TensorFlow layer.
tfg.nn.layer.graph_convolution.feature_steered_convolution_layer( data, neighbors, sizes, translation_invariant=True, num_weight_matrices=8, num_output_channels=None, initializer=tf.compat.v1.truncated_normal_initializer(stddev=0.1), name=None, var_name=None )
The shorthands used below are
V: The number of vertices.
C: The number of channels in the input data.
In the following, A1 to An are optional batch dimensions.
floattensor with shape
[A1, ..., An, V, C].
neighbors: A SparseTensor with the same type as
dataand with shape
[A1, ..., An, V, V]representing vertex neighborhoods. The neighborhood of a vertex defines the support region for convolution. For a mesh, a common choice for the neighborhood of vertex
iwould be the vertices in the K-ring of
iitself). Each vertex must have at least one neighbor. For a faithful implementation of the FeaStNet paper, neighbors should be a row-normalized weight matrix corresponding to the graph adjacency matrix with self-edges:
neighbors[A1, ..., An, i, j] > 0if vertex
neighbors[A1, ..., An, i, i] > 0for all
sum(neighbors, axis=-1)[A1, ..., An, i] == 1.0for all
i. These requirements are relaxed in this implementation.
inttensor of shape
[A1, ..., An]indicating the true input sizes in case of padding (
sizes=Noneindicates no padding).
sizes[A1, ..., An] <= V. If
sizeswill be ignored. As an example, consider an input consisting of three graphs
V2vertices respectively. The padded input would have the following shapes:
data.shape = [3, V, C], and
neighbors.shape = [3, V, V], where
V = max([V0, V1, V2]). The true sizes of each graph will be specified by
sizes=[V0, V1, V2].
data[i, :Vi, :]and
neighbors[i, :Vi, :Vi]will be the vertex and neighborhood data of graph
neighborsshould have no nonzero entries in the padded regions.
Truethe assignment of features to weight matrices will be invariant to translation.
intspecifying the number of weight matrices used in the convolution.
num_output_channels: An optional
intspecifying the number of channels in the output. If
num_output_channels = C.
initializer: An initializer for the trainable variables.
name: A (name_scope) name for this op. Passed through to feature_steered_convolution().
var_name: A (var_scope) name for the variables. Defaults to
Tensor with shape
[A1, ..., An, V, num_output_channels].