MeshEdgeConvLayer<T>

Layers · AiDotNet.NeuralNetworks.Layers

Implements edge convolution for mesh-based neural networks (MeshCNN style).

Inheritance: LayerBase<T> → MeshEdgeConvLayer<T>

Implements: IShapeContract

For Beginners

Think of a mesh as a surface made of connected triangles. Each triangle edge is shared by (at most) two triangles. This layer examines each edge and the two triangles it connects to learn meaningful features about the shape.

Key concepts:

  • Edge: A line segment connecting two vertices, shared by up to 2 faces
  • Dihedral angle: The angle between two faces sharing an edge
  • Edge features: Properties like length, angles, and face normals

The layer learns to recognize patterns in how faces connect, enabling recognition of shapes, surface curvature, and other geometric properties.

How It Works

MeshEdgeConvLayer processes triangle meshes by treating edges as the fundamental unit. Each edge connects two triangular faces, and the layer learns to extract features from the geometric relationship between these faces.

Reference: “MeshCNN: A Network with an Edge” by Hanocka et al., SIGGRAPH 2019

Constructors

Constructor Summary
MeshEdgeConvLayer(int inputChannels, int outputChannels, int numNeighbors, IActivationFunction<T> activationFunction) Initializes a new instance of the MeshEdgeConvLayer class with vector activation.
MeshEdgeConvLayer(int inputChannels, int outputChannels, int numNeighbors, IVectorActivationFunction<T> vectorActivation) Initializes a new instance of the MeshEdgeConvLayer class with vector activation.

Properties

Property Summary
bool SupportsTraining { get; } Gets a value indicating whether this layer supports training (backpropagation).
int InputChannels { get; set; } Gets the number of input feature channels per edge.
int NumNeighbors { get; set; } Gets the number of neighboring edges to consider for each edge convolution.
int OutputChannels { get; set; } Gets the number of output feature channels per edge.

Methods

Method Summary
Dictionary<string, string> GetParameterRoles() Returns parameter roles for per-role optimizer configuration (e.g., weight decay exemption for biases).
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank)
IReadOnlyList<Tensor<T>> GetTrainableParameters() Returns all trainable parameter tensors marked with [TrainableParameter].
Tensor<T> GetBiases() Gets the bias tensor.
Tensor<T> GetWeights() Gets the weight tensor.
void ResetState() Resets the cached state from forward/backward passes.
void SetEdgeAdjacency(int[] edgeAdjacency) Sets the edge adjacency information for the current mesh.
void SetTrainableParameters(IReadOnlyList<Tensor<T>> parameters) Replaces trainable parameter tensors (e.g., with ParameterBuffer views).
void UpdateParameters(T learningRate) Updates the layer parameters using the computed gradients and learning rate.
void ZeroGrad() Clears all gradient fields discovered by convention ({paramName}Gradient).