Stabilize positions of a cluster of points in three dimensions

28 Views Asked by At

I'm a statistics/machine-learning guy with a geometry problem I'm hoping to get some help on.

I am working on an embedding model that takes objects in a 26-dimensionsal space and, by embedding, projects them into 3 dimensions. The embedding algorithm is stochastic (related to t-SNE) so runs of the algorithm on the same dataset produce approximately the same shape, but at a different position and orientation.

I want to run my model every day and watch how the embedding evolves as data accumulates.

The problem is how to find a transformation of the output on day t that minimizes the difference from the output on day t - 1.

I'm currently able to do this in 2 of the 3 degrees of freedom. I picked two objects in the embedding A and B that are the centroids of major clusters, and each time I generate the embedding, I find and apply translation and rotation of the entire space so the coordinates of those two objects never change.

The problem I have now is to stabilize the embedding in the third degree of freedom.

I think what I want to do, is:

1 Pick a third point, C.

2 Find the point on line AB that is closest to C (call it ABc), such that line ABcC is perpendicular to AB.

3 Find the rotation of ABcC relative to AB.

4 Find a transformation of space t so that the rotation of ABcC in space t is the same as it was in space t-1.

I know how to do steps 1 and 2. But I'm not sure how to go about steps 3 and 4, and frankly not sure this is even the best approach.

Can anyone help?

Thanks much!