Assume that there are
 data set A (known sample information).
 data set B (unknown sample information).
What I want to achieve is:

Sort each sample of the data set A in a twodimensional space according to a certain rule, that is, make it representable in twodimensional coordinates.
(According to the degree of similarity, correlation, etc. between the samples) 
When a sample is extracted from the data set B and input to the deep learning model, the model can search in the data set A to obtain a sample (set) that has a certain correlation with the input sample.
How can I achieve it?