MLCGramMatrixLayer
A layer that computes the uncentered cross-correlation values between the spacial planes of each feature channel of a tensor.
Declaration
class MLCGramMatrixLayerOverview
For example, if the input tensor batch function is:
x = x[b, y, x, c]
The computation performed by this layer is:
y = y[b, 1, f, c] = alpha * sum_{x, y} x[b, y, x, f] * x[b, y, x, c]
Interpret this operation as computing all combinations of fully connected layers between the different spatial planes of the input tensor.
The layer performs this operation independently for each tensor in a batch. Then the layer stores these results in the feature channel and x-coordinate indices of the output batch.
Legend:
bThe batch index.
yandxThe spatial coordinates.
cThe feature channel index.
alphaThe scaling factor.