Consider the following network:

The red arrow indicates that that node accepts an input, which is a 4x4 binary matrix. I was using 5 steps for evaluating the networks, where a step is each node taking it's input, doing a certain operation on it (indicated by the label), and then sending it to the nodes it's attached to. Then after 5 steps, see the node with the red arrow, if that node has [[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]] then the network is said to return True on the particular input. Note that some of the nodes connect to themselves and others connect more than once to another node.

The numbers represent certain basic operations on a matrix as follows:

0: simply XOR the input matrices

1: simply OR the input matrices

2: XOR the input then invert the result

3: OR the input then invert the result

4: XOR the input then transpose the resulting matrix

5 OR the input then transpose the resulting matrix

6 XOR the input then shift the result so the left half and the right half of the matrix are exchanged

7 OR "

8 XOR the input then flip the result vertically

9 OR "

With these elementary operations and this network configuration:

So this network works pretty well for detecting whether the input matrix is one of the two in the picture above, and doesn't return True very often for any input matrix other than those two.

Now this was a simple problem that you probably wouldn't solve this way but would instead solve directly checking for the particular two inputs, but I see it as a proof of concept and I will be trying to use this method to solve over more complicated input, like non-binary or more complex patterns to return True on.

## No comments:

## Post a Comment