Closed dgrzech closed 6 years ago
What does the graph you are passing in look like in terms of number of hyperedges and indices for each hyperedge?
hi!
the graph has 9 hyperedges. this is how i initialise it:
std::vector<std::vector<int>> indices(9, std::vector<int>(N));
for (int count = 0; count < N; count++) {
indices[0].push_back(count);
auto vertexNeighboursIdx = m_warpfield.findNeighborsIndex(KNN, m_canonicalVerticesPCL[count]);
for (int i = 1; i < indices.size(); i++) {
indices[i].push_back(vertexNeighboursIdx[i - 1]);
}
}
m_dataGraph = std::make_shared<OptGraph>(indices);
it's as simple as it gets i think. vertexNeighboursIdx
does not contain double entries and the indices are in the range of 0 to 7 to correspond to the no. of deformation nodes
clearly the problem was with the index vector.. thanks for pointing my attention in that direction
hi!
it's likely that i made a mistake somewhere with the indexing of arrays but i'm really struggling to find it, so here goes my question..
i'm running a simple program which uses opt where i try to find the parameters of translation that would transform one 3-d vertex into another using values stored in deformation nodes that are the nearest neighbours of a vertex.
the vertices are:
the obvious solution is that
this is my energy function:
where D = 8 (no. of nearest neighbours, of which for now i'm only using 1) and N = 1.
the initial cost value is correctly 0.0002 and it is brought down to 0 as expected. however, after i copy the values of transformations back to the cpu via:
the values stored in the vector are:
which is clearly wrong because only one deformation node should be updated. m_transformation is initialised as follows:
where am i going wrong? why are 2 entries of the vector being set to (0.01, 0.01, 0) instead of just one?
when i change the energy term to:
the values are correct, but not if the nodes array stores any less than 8 indices.
thanks in advance for your help!