Tuesday, July 28, 2015

How does it work

IQ Solver is designed to handle data presented as a graph. However the current version solves only sequential tests. Simplified version of algorithm of finding the solution works in the following way. For every sequence the following steps are ordered:

  • Check if it composes of the same elements - if yes then in description you will see.

[7, 7, 7] consists only of : 7
  • Check if it repeats the same subsequence of elements. If yes then the description is:
[1, 1, 2, 1, 1, 2, 1, 1, 2] is repeated sequence of : [1, 1, 2]
  • Check if element a[n] = a[n-2] # a[n-1]  where # is +, -, * or / . Sample description:
Obtain element by applying "-" on previous 2 elements of [1, 4, -3, 7, -10] 

  • Create a new imaginary sequence by applying +, -, * or / on the current and previous elements. 
Apply "-" on consecutive elements in [1, 3, 7, 15] to get [2, 4, 8]
  • Create n imaginary sequences by splitting the original sequence:
[1, 1, 2, 2, 3, 4, 4, 8] may be divided into 2 sequences: 
         [1, 2, 3, 4]; [1, 2, 4, 8]
  • If some elements are repeated - create 2 imaginary sequences - one with number of each repetition (or 1 is an element is single) and the second with the repeated elements.
[5, 8, 5, 5, 8, 5, 5, 5, 8] may be divided into values [5, 8, 5, 8, 5, 8] and number of their repetitions [1, 1, 2, 1, 3, 1]

The same steps as applied on original series are also applied on the imaginary ones. This creates a a huge tree  of potential solutions. To handle this, a total complexity of solution is calculated and it determines which steps should be performed first. This rate is even shown as the low value indicate simple solution, which should be the right one.

Example


Here is the generated explanation of the sequence 5,8,5,5,8,5,5,5,8
[5, 8, 5, 5, 8, 5, 5, 5, 8] may be divided into values [5, 8, 5, 8, 5, 8] and number of their repetitions [1, 1, 2, 1, 3, 1]
  [5, 8, 5, 8, 5, 8] is repeated sequence of : [5, 8]
  [1, 1, 2, 1, 3, 1] may be divided into 2 sequences: 
         [1, 2, 3]; [1, 1, 1]
    Apply "-" on consecutive elements in [1, 2, 3] to get 1
    [1, 1, 1] consists only of : 1

And the graph to this solution generated using GraphStream library


Monday, July 27, 2015

Introduction

Vision


This blog is about my project of Artificial Intelligence. It is planned to be able to deduce concepts, create complex concepts basing on basic ones and apply them to new data. It is supposed to pass experience from one task into another. The ultimate test to check if it is general enough - I don't know if achievable at all - is to let it control characters in arbitrary virtual world. It should be able to learn from the scratch how this world works and how to act within it. People could then watch the concepts it creates and how it perceives the world, which is the only reality it knows.

Current state


Currently this AI is able to solve numerical IQ tests. It is available online, so you may check it at http://iqsolver.eu/ . Here is a list of samples questions: http://iqsolver.eu/samples.html, you may try to solve them yourself and then compare with the answer of AI :). For most questions more than 1 answer are generated, but the first one is probably the right one. I will write later about what it can and cannot do.

Plans

Below is an ambitious list of test steps the AI should be able to achieve during its development. However, it shouldn't be designed specifically to them, but rather solve them using generality of its intelligence.

  1. Solving numeric single-line sequence tests
  2. Solving multiple-lines or matrix numerical tests
  3. Deducing rules in arbitrary complex structure containing sequences, maps, maps of sequences, etc. Anything that could be stored in a JSON document
  4. Deducing rules of complete information games for example: board games (Chess, Go, Reversi)  being given sequence of game snapshots.
  5. Learning how to play full information games.
  6. Coping with partial information games - distinguishing between what is perceived and what is real
  7. Theory of mind - being able to deduce what other agents may know
  8. Being able to learn the rules of any computer game provided that non-graphical interface is given: not a 3D image but a set of number which indeed every object in computer game is. Agents controlled by this AI could be put in the virtual environment.

Currently step 1 is generally achieved. Many single-sequence tests require step 2: dividing sequence into many sub-sequences. I have some ideas how to make steps 2-4, the rest is just a vision. If you have some ideas - please comment.