0
$\begingroup$

I am representing a set of images with a matrix $x$ that is of shape $(k, n)$. I want to treat all images $x^*:= AxB$, where $A$ is an invertible matrix of shape $(k,k)$ and $B$ is an invertible matrix of shape $(n,n)$, as being equivalent to $x$. Both $A$ and $B$ are known. i.e., a practically relevant distance metric $d$ in my $x$-space is such that $d(x,AxB)=0$.

[I am feeding these representations $x$ into a machine learning algorithm.]

I want to create a new representation of my images so that all images $x$ and $x^*$ are mapped to the same point in a one-to-one manner. How can I do this? The reason I seek such a representation is that my machine learning algorithm is treating $x$ and $x^*$ as different data points, but they are actually the same.

As an analogy, if there is a mirror along the $y$-axis in two dimensions, imagine that mirror images of points are equivalent in some metric. Then you can define a mapping $(x,y)\rightarrow(|x|, y)$ so that we can compute distances between them on a consistent basis.

EDIT: $n>k$ typically.

  • 0
    Are you saying that $A$ and $B$ are already known (invertible) matrices? In which case $x$ is equivalent not only to $AxB$ but then also to $A^2xB^2$ or any $A^k xB^k$ for $k\in {\Bbb Z}$.2017-01-31
  • 0
    @H.H.Rugh Yes. Right, I didn't realize that property follows too. But for my application, $A^2xB^2=x$ again.2017-01-31
  • 0
    Unless your matrices $A$ and $B$ have 'nice' properties it may be hard to construct a good metric assigning equivalent points distance zero. Your example with a mirror does have a nice propery: $B^2$ is the identity which simplifies life. The general problem is probably too hard.2017-01-31

2 Answers 2

0

There may be a simple way to get around, simply by computing a metric that has the relevant property on the full space. In practice this treats points and their image as equivalent, having distance zero.

In case that $A^2 x B^2=x$, or say more generally that $A^p x B^p=x$ for all $x$ and some $p\geq 2$ your relevant distance metric should compute the distance between equivalence classes of the form: $[x]=\{x,AxB,...A^{p-1}x B^{p-1}\}$. This you may do so by letting: $$ d([x],[y]) = \min_{0\leq j,k

In general mapping equivalence classes to a specific representation of it would need an explicit fundamental domain. And usually you will get discontinuities in your map (with respect to the standard metric) if you do so. If e.g. $x$ is of size $2\times 1$ and your map is $(x,y)\mapsto (-x,-y)$. You may try with e.g. $D=\{ (x,y) : x>0\} \cup \{(0,y):y>0\}$. Mapping points to $D$ is not continuous at the points of the form $(0,y),y>0$ (with respect to usual Euclidean distances). Would this be a good solution to you? (for this particular map).

0

Let's suppose that $k \ge n$. Then almost every* image $x$ will have $n$ independent columns. If you extend those to a basis of $\Bbb R^k$, you get a $k \times k$ matrix $M$. Picking $B = M^{-1}$, you find that $xB$ consists of the first $n$ columns of $MB = I_k$, i.e., it looks like an $n \times n$ identity matrix atop a bunch of zeros. Picking $A = I_k$, you get that $AxB$ is the same: the $n \times n$ identity atop $k-n$ rows of zeroes.

Hence almost every image is "the same", under your metric, as any other. I don't think you'll "learn" very much by examining distances in this quotient space.

(*) In the sense of measure theory, with respect to the standard measure. Put differently, the complement of the set of "same" images is of lower dimension than the set of "same" images, which has dimension $nk$.

  • 0
    $A$ and $B$ are pre-determined matrices, though. We cannot choose them. And $n>k$. (This is a one-hot encoding of a sequence from a pool of $k$ characters.)2017-01-31
  • 0
    Oh, lord. So (seeing your comment-answer), you actually know that $A^2 = A$, and $B^2 = B$, or something very like that, but didn't bother mentioning it. Well, so much for my efforts and time. As for the $n > k$, thing, just transpose everything I said -- they're still all equivalent (if $A$ and $B$ are allowed to range over invertible matrices, as I had assumed, rather than being fixed) A last thought: One possible target space: the set of pairs $\{x, AxB\}$. This will be unique for every $x$ and $x'$ to which it's related. One more: be polite and take the time to say clearly what you mean.2017-01-31