martinnormark / neural-mesh-simplification

Un-official and WIP Implementation of the Neural Mesh Simplification paper
MIT License
10 stars 0 forks source link

Implement `edge_predictor` sparse attention network #17

Closed martinnormark closed 3 months ago

martinnormark commented 3 months ago

Develop the network for proposing candidate triangles. This component is responsible for predicting the connectivity between the sampled points.

  1. Input:
    • Sampled points from the PointSampler
    • Original mesh connectivity (edges)
  2. Main components: a. k-nn graph construction b. DevConv layer c. Sparse self-attention layer
  3. Functionality steps: a. Extend the original mesh connectivity:
    • Construct a k-nn graph over the sampled points
    • Combine this with the original mesh edges to avoid isolated nodes b. Process the extended graph:
    • Apply a DevConv layer c. Apply sparse self-attention:
    • Predict the probability that point x_i is connected with point x_j
  4. Output:
    • A simplified adjacency matrix (A_s) representing the predicted connectivity
  5. Key equations:
    • Self-attention: S[i, j] = softmax((W_q f_j)^T (W_k f_i))
    • Simplified adjacency: A_s[i, j] = S[i, :] A S[j, :]^T

To implement this, we'll need:

  1. A function to construct the k-nn graph
  2. The DevConv layer (which we already have)
  3. A sparse self-attention mechanism
  4. A method to combine the original and predicted connectivity

Additional considerations:

martinnormark commented 3 months ago

Done in 00a68224d02fa110e7fd3edb318b748b5cec355f