# How to force a NN to ouput the same output given a reverse input?

I want to choose an architecture that can deal with an input symmetry.

As input, I have a sequence of zeros and ones, like [1, 1, 1, 0, 1, 0] and at the output layer I have N neurons that outputs a categorical distribution like [0.3, 0.4, 0.3].

How can I force a NN to ouput the same distribution when I feed its reverse copy, i.e [1, 1, 1, 0, 1, 0]?

A simple way just to learn twice:

feed straight [1, 1, 1, 0, 1, 0] -> [0.3, 0.4, 0.3]
feed reverse  [0, 1, 0, 1, 1, 1] -> [0.3, 0.4, 0.3]


Or maybe, there are more "elegant" ways? What type of architecture I should use or maybe I need to play with loss functuions?

If you have this input [1, 1, 1, 0, 1, 0] then the sorted related mirror input (in lexicographic order) is the [0, 1, 0, 1, 1, 1] (reverse). So you train the NN only the sorted lexicographic inputs and before testing each sample you convert it to the sorted lexicographic related input (by reversing it) if it is not already in that form.
• So you have one sample [x,y,z,w] you reverse it and it becomes [w,z,y,x] if it is lexicographicaly before [x,y,z,w], then you use that sample both to train and test, else you use the original sample as is. it is simply a normalisation process – Nikos M. May 5 at 19:34