Giter Site home page Giter Site logo

gnnsdp's Introduction

Learn to approximate SDP solutions with GNN

Dataset

The dataset contains 100 training examples, where each example contains the following data:

  • (a_k, b_k), k=1,..,N: N pairs of 3D unit vectors representing the directional measurments to be aligned
  • C: a symmetric matrix of size n x n (n = 4*N+4), which is the objective fuction for the SDP min <C, X>
  • X: a symmetric matrix of size n x n, which is the primal optimal solution
  • S: a symmetric matrix of size n x n, which is the dual optimal solution

I provide this dataset in a .mat file, as the solutions are generated by the MOSEK solver in Matlab. Note that I also calculate Aty = C - S. Because C is known, learning either S or Aty is equivalent.

You can download the dataset here.

This line shows how to read the .mat file and generate a Pytorch Geometric Dataset.

Basic approach

  • We start with an input fully-connected graph, where each node i has a feature [a_k || b_k] of dimension 6 Optionally, we could use a different input feature that comes from the cost matrix C, see here. We add a dummy node 0 with feature all ones because the size of X and S is 4(N+1), with (N+1) blocks.

  • We perform multiple layers of message passing on this input graph, and we generate a graph where each node has a feature f_i with high dimension.

  • Given f_i, we then learn four nonlinear functions parametrized by MLPs:

    • primal_node(f_i), which returns the diagonal blocks of X
    • primal_edge(f_i,f_j), which returns the off-diagonal blocks of X
    • dual_node(f_i), which returns the diagonal blocks of S
    • dual_edge(f_i,f_j), which returns the off-diagonal blocks of S
  • We perform supervised learning, where the loss function is:

loss = primal_loss + dual_loss

primal_loss = || X - X_gt || / || X_gt ||

dual_loss = || S - S_gt || / || S_gt ||

where all the norms are Frobenious norms.

A sample implementation is here.

gnnsdp's People

Contributors

hankyang94 avatar

Watchers

 avatar

Forkers

xiaogaogaoxiao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.