Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about selecting landmark points by MaxMin #18

Open
weigcdsb opened this issue Nov 16, 2023 · 1 comment
Open

question about selecting landmark points by MaxMin #18

weigcdsb opened this issue Nov 16, 2023 · 1 comment

Comments

@weigcdsb
Copy link

Hello, I'm kind of confused by the landmark points selction.
It seems the strategy is not exactly as the original MaxMin? It's kind of like the "MinSum" strategy? (testdists += pD(testpt,targetpt);) Or could you explain why it's equivalent to MaxMin?

Thanks a lot!


int aux_landmarkMaxMin(arma::mat& pD, arma::vec& plandmark, arma::vec& seqnp){
  // 4-1. basic setting
  const int nlandmark = plandmark.n_elem;
  const int ntestpts  = seqnp.n_elem;

  // 4-2. we should be careful ; -1 for both vectors
  vec veclandmark = plandmark - 1;
  vec vecseqnp    = seqnp - 1;

  // 4-3. main iteration
  int currentidx      = 0;
  double currentdists = 123456789;
  for (int i=0;i<ntestpts;i++){
    int testpt       = vecseqnp(i);
    double testdists = 0;
    for (int j=0;j<nlandmark;j++){
      int targetpt = veclandmark(j);
      testdists += pD(testpt,targetpt);
    }
    if (testdists<currentdists){
      currentidx   = testpt;
      currentdists = testdists;
    }
  }
  currentidx += 1;

  // 4-4. return output
  return(currentidx);
}
@weigcdsb
Copy link
Author

OK, a follow up...
I implement the original MaxMin method by myself and fix the starting points, the results are different...
These 2 methods are different, would you mind explaining why you choose select landmark by this rather using original MaxMin strategy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant