Tuesday, August 31, 2010

Self-Reflective Interactive Realities


A.I. SpaceGraph

another reason for going directly to JOGL is that i see an opportunity to make an AI scenegraph
a scenegraph is just a framework for managing what drawing commands are performed
so what i'm saying is that certain parts of dANN could form that framework
which is why i wondered if dANN had anything like a quadtree or octree
it seemed similar to that VectorSet or VectorMap we were discussing
for using GraphDrawing to find contents in a hypersphere
a scenegraph is usually a DAG
i think a more appropraite term is 'SpaceGraph'
not scene
described here http://automenta.com/spacegraph

How does space graph differ from scene graph?

scenegraph is just a term used in computer graphics
i'm making a connection between AI and 2d/3d computer rendering
the other side of it, is input sensing
the mouse cursor for example (and multitouch too) generate a sequence of events
and changes in state
the input logic too could benefit from AI

2D Prototype

just working on a 2D model right now
which would be suitable for graph drawing (and interaction)
it does zooming and panning and now i can do intersection with rectangular areas

what i'm saying is that we can do even better than ordinary ‘scenegraphs’ potentially
whether it optimizes it or replaces it entirely


Why focus on user-interfaces rather than AI “work”?

because the graph drawing stuff could form the basis for a new desktop UI
and as a result, apps like netbeans would be obsolete
because we could in essence program directly into it
i'm thinking deeply about it because it may hold a chance of accelerating development, in the long long term
if the system can reason about its drawing commands, its input sense, and what it is working with, it will be completely reflectively AI
then the entire system state can be persisted in graphs and shared over the network
no need for the file system, trac, etc anymore
Git might be a good versioning system to use for serialized graphs
(there is JGit pure java impl of Git which can be used to make a virtual filesystem interface)
for example, code and issues would be linked explicitly
so realizing all this, i'm trying to make a simple 2D interactive framework that dANN can hook into this way
for at minimum, graph layout, text input, and drawing connections between things
i mean a user-inputted drawn connection
like sketches or wires
i think i've found a minimum list of UI functionality necessary to achieve this
full graph reflexivity
even typing the letter 'a' would start to bring up associations
'...is the first letter of English alphabet'


Dont you think for that to happen the AI needs to reach a more mature level?

everything necessary exists right now. its not really AI, just designing it in a way that it can be utilized by AI components like graphs, neural networks, genetic algorithms, etc
then as soon as we can construct those AI components from within the system, we can accelerate experimentation
because all of the results will be right there


Why move to JOGL instead of Java3D?

for interactive graph panning, zooming, and clicking buttons
JOGL is more direct
Java3D's scenegraph is nearly made obsolete when compared with Ardor3D or JME3
some of its terminology are really unweildly, like 'viewplatform' etc
anyway Ardor3D and JME use JOGL as their underlying OpenGL interface
https://jogl.dev.java.net/

Saturday, August 28, 2010

Integrating Logic and Machine Learning


"We may be utilizing machine learning 'too little, too late'.  (IE, we're using too little ML and using ML not early enough).  Thus we may be already going down a slightly wrong path...  we should correct this by taking ML seriously and try to find the best way to incorporate ML in our architecture..." --YKY

interfacing with dANN has been my goal while designing Genifer's Java layer.  when it's finished, it will allow us to combine dANN's components with Genifer concepts.

dANN provides several "machine learning" (and related) components:
  • dynamic bayesian networks
  • many types of neural networks
  • dimensional embedding aka graph drawing
  • graph metrics
  • etc...
Genifer's logic can remain in LISP -- Java may not be allowed to interfere - but the concepts will be reference-able

LISP will be able to bind formulas to Java method calls.  for example, using graph drawing:

List<Atom> getNeighbors(similarityGraph, center, radius)

so now that we know this, the question becomes: how do we create integrative designs that utilize Genifer and dANN as (internal) components?

well we could create many types of integrative designs.  though we may have a chance to evolve them: we can declaratively instantiate new instances of the system inside itself.

http://picocontainer.org/introduction.html


"Constructor Injection is a Dependency Injection variant where a component gets all its dependencies via its constructor."


"The most important benefits of Constructor Injection are:

  • It makes a strong dependency contract
  • It makes testing easy, since dependencies can be passed in as Mock Objects
  • It is very succinct in terms of lines of code
  • Classes that rely on Constructor Injection are generally Good Citizens
  • A dependency may be made immutable by making the dependency reference final"


Systems like Picocontainer, and Spring Framework, are used to declaratively specify "wirings" of component dependencies.  This amounts to a hierarchical property tree listing the interfaces, implementation classes, and constant parameters in order to fill a "container" aka "context".

more later on this...

Friday, August 27, 2010

Tuesday, August 24, 2010

Why GUIs are Important in AI Design

what IDE do you use to develop software?  i hope it's not exclusively command-line tools.  modern IDE's provide a lot of convenience which improves the quality and speed of development: syntax highlighting, code completion, visual debugging, etc

so if you're using an IDE like NetBeans or Eclipse, then your interface to Genifer, for example, is ALREADY through a GUI (though indirectly).

if you understand this, you'll see why i think it's important to consider the GUI's we use to develop AI. 

btw some people need some visualization to think.  i consider your comment that GUIs are only important after the 'back end' is finished to be "logic-based thinking chauvinistic"

On 08/24/2010 04:52 PM, Abram Demski wrote:
I am currently using text editor command-line, because Lispers typically fall back on Emacs and I am not very interested in that... :P
check this out:  http://www.pawfal.org/fluxus/


I think it's sad that there are not better Lisp environments out there... I used to use Powerlisp, which was nice in many ways but too old to be stable (and no longer in development).
for the most modern LISP-like environment that i'm aware of, i suggest to look at NetBeans + Clojure

http://www.enclojure.org/screenshots

I dislike project-oriented environments, which means almost all IDEs... :P
(shocked!)

For Lisp, I'd love an environment which was closer to an "edit and save the memory" model rather than "edit and save and execute text". ("Save the memory" meaning "save a text file containing defuns and setqs to restore the current memory state.) Obviously for large software projects you;d need more than this in terms of project management, but for rapid prototyping, that'd be nice. Imho.
well, this is our opportunity to build that!

On 08/24/2010 05:30 PM, Abram Demski wrote:
The SOAR group recently did some interesting IDE work, too... basically, rather than really editing text, they now edit database entries corresponding to SOAR rules (which looks like text while you're editing it). I don't know a whole lot about it, though.
thanks for the pointer, seems interesting. here's what i could find on SOAR's IDE:
if you can send any more information about it, i can take a closer look

also check out jACT-R, a java imlementation of the ACT-R cognitive models:

    http://anthonymharrison.com/wp/wp-content/uploads/2008/04/tooltip.jpg
    http://jactr.org
Fluxus looks interesting...

If we can built something like that, that would be great.
Fluxus (written in C/C++) embeds its own LISP engine which is tightly integrated with an OpenGL draw loop.

JOGL provides a native OpenGL interface for Java.


in my latest commit i added a simple browser panel:

http://code.google.com/p/genifer/source/detail?r=418f1766575b7ebda60b1929163210904325e4fc

which shows facts and rules.  it uses different colors and font sizes to show the relative probability of each fact.

here is a screenshot running from YKY's latest test group:


Wednesday, August 18, 2010

MicroPSI and Genifer and dANN


I've been investigating MicroPSI.  Here are some introductions:
Psi-Theory is about human action regulation, intention and behaviour. The theory describes a comprehensive model of the human brain, its cognitive processes, emotion and motivation. It is about the informational structure of an intelligent, motivated, emotional agent (called Psi) which is able to survive in arbitrary domains of reality. This agent is driven by several satisfiable needs: need for food, water, the avoidance of pain, certainty, competence and affiliation). The cognitive processes are modulated by emergent emotional states, memory, and sensory perception.

Source Code

I collected a package of some old Java MicroPSI source code from 2005, including the above mentioned documentation that I found helpful.


Motivation
  • Five (5) basic needs that drive behaviour
  • Generate intentions to satisfy needs


Action Regulation
  • Intention is selected and executed
  • Action regulation is modulated by Emotions


Emotions
  • Emotions emerge from the system through modulation of the cognitive processes
  • Agents do not “have” an emotion, but it thinks and acts emotionally




5 Basic Needs that Trigger Behavior
  • Preserve Existence
    • food, water, avoidance of pain
  • Preserve Species
    • sexuality and reproduction
  • Affiliate
    • need to belong to a group and engage in social interactions (“signals of legitimacy”)
  • Be Certain
    • predictability of events and consequences
  • Be Competent
    • capability of mastering problems and tasks, including satisfying one’s needs

PSI Quad Networks
 
Psi Neural Networks and Activation

PSI as part of an Open-Source AGI System

I was wondering how these systems might fit together in a modern implementation of the PSI Cognitive model:
  • PSI - action, motivation, intention, emotion
  • Genifer - logic nodes and logic processing, providing memory, descriptions of sensations, and invokeable actions, geniform natural language
  • dANN - graph framework, bayesian, markov, signal processing, genetic wavelets, procedural learning
  • EnCog - neural networks and learning
  • OpenRDF - read and write semantic web data, utilize publicly available OWL ontologies to structure knowledgebases
  • MOSES - procedure learning
  • DeSTIN - machine learning, pattern recognition, concept formation
  • WordNet, FrameNet, ConceptNet, ...
  • Stanford Parser | RelEx - natural language input
  • NLGen - natural language output
  • anything else?

Thursday, August 5, 2010

My Current HOL Algorithm

The following is equivalent in strength to HOL Light. Continues this post.

  • As an extension of the notion of term (defined here), add the notation of polymorphically typed lambda calculus, an equality predicate, and the choice operator (I'll call it epsilon-- it's a function that takes predicates and forms a term that represents an arbitrary satisfier of the predicate, if one exists; otherwise, it just represents an arbitrary term).
  • Take terms with boolean type as a drop-in replacement for atomic statements in that design. (It may seem strange to use them to replace atomic statements, since they are compound statements, but bear with me. Rules will correspond to valid sequents, rather than to compound statements in the logic.)
  • Use lambda-calculus unification as a drop-in replacement for first-order unification. This includes normalization; we could either store the normal forms of statements in the KB or let the unification algorithm normalize on the spot, depending on whether space efficiency of the KB or time efficiency of the unifier is a bigger concern.
  • Implement equational reasoning. Fundamentally, we treat an equality statement which has a given truth value, T, as if it represented two rules with that truth value: one justifying inferences in each direction, substituting one term for another. These rules cannot be stated as FOL rules, however, since they represent substitution of terms within larger statements. Nonetheless, the same basic propagation scheme for the truth values will work. In addition to the 2 pseudo-rules for each equality statement, we treat the system as knowing A=A for all terms A. Knuth-Bendix completion should be implemented eventually, which allows us to ignore one of the two inference directions for each equality statement without losing anything. Ultimately, I believe this means equational reasoning can be implemented as an extension to the normalization step of the unification algorithm (but I could be wrong here).
  • Finally, we also need one hypothetical reasoning rule: if assuming A implies B with truth calue TV1, and assuming B implies A with truth value TV2, then A=B with truth value (& TV1 TV2) for an appropriate &-formula. Rather than implementing this as one complicated hypothetical reasoning step, it seems to me that the most convenient way would be to implement rule-level reasoning in general (ie, a query can be a rule, rules can be combined with other rules to produce new rules, etc) and then add this as a way of recording high-probability mutual implication.
That's all, folks!

PS:

In addition to the above reasoning system, for HOL Light, we also need the axiom of choice and the axiom of infinity. (The axiom of extensionality is covered by normalization.) Both of these axioms are very much "mathematical" in nature, and it isn't clear whether they are needed for more common-sense reasoning. (My suspicion is that they would emerge in other forms, ie, in coding the KB we'd encode something like these plus much more.)

Tuesday, August 3, 2010

NARS and Genifer

Per SeH's request, here is a comparison of entities in NARS and their possible counterparts in Genifer:

BudgetValue
no counterpart yet, maybe related to utility values
Concept
Term.Predicate
Goal
same as Term
Item
no counterpart yet
Judgement
same as Term
Question
no counterpart yet, or same as Term
Sentence
same as Term
ShortFloat
Term.Constant.Number
Stamp
no counterpart, we don't use time stamps
Task
no counterpart yet, maybe same as Term
TaskLink
no counterpart yet
TruthValue
TruthValue

Sunday, August 1, 2010

AGI use cases

(Some entries are just general description rather than concrete example;  It may take some additional time to think of concrete examples for them)


1. Pattern recognition

Programming related:
  • recognize a program / a program missing a curly brace
  • recognize a function declaration [maybe missing something]
  • recognize a mathematical / logical expression
  • recognize the definition of an abstract data type
  • recognize that the execution of a program is slow (this is fuzzy)
  • recognize that some code / data structure is complex (also fuzzy)
  • recognize that a text / image file is big (also fuzzy)
English related:
  • recognize some nouns, verbs, prepositions, etc
  • recognize NPs, VPs, etc
  • recognize sentences (or almost-sentences missing something)
  • recognize misspelled words
2. Natural language understanding / interpretation

Syntactic parsing into logical form:
  • translate nouns, verbs, prepositions, etc, into logical form
  • translate NPs, VPs, into logical form
  • translate sentences into logical form
Understanding semantics:
  • understanding nouns:
        eg:  chair is an object, dog is an animal, love is an abstract thing
  • understanding verbs:
        eg:  to kick is to hit with a leg;  to kiss is to make contact with lips;
              to love is to kiss, have sex, hold hands, talk, etc.
  • understanding prepositions:
        eg:  John eats spaghetti with Peter -> Peter eats spaghetti
              John eats spaghetti with meatballs -> the spaghetti has meatballs &
                                                                          meatballs don't eat spaghetti
  • understanding sentences
3. Learning from examples

Once we have basic English capability, we can use English to give examples:
  • Roman numeral for '1' consists of one I
    Roman numeral for '2' consists of two I's
    Roman numeral for '3' consists of three I's
    -->  Roman numeral for n consists of n I's

4. Query answering
  • Is 13 an integer?
  • Is 13 an odd number?
  • Is 3.14 a float?
  • All variables must be given a type when they are declared?
  • Every C# program must contain one Main method?
  • Is ++(x + 1) a valid C# statement?
5. Finding explanations
  • Why does some code result in error messages?
        eg:  why is ++(x + 1) invalid?
              what's wrong with  printf("This is a test);  ?
  • Why doesn't a program give the desired result?
        eg:  why doesn't  printf("Hello world/n");  produce a new line?
  • Why is one program slower than another similar program?
6. Performing simple tasks
  • Print all odd numbers from 1 to 100.
  • Replace "John" with "Mary" in this text file.
  • Write a function that reverses an English sentence's word order.