Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deme representation in atomese #103

Open
ngeiswei opened this issue Sep 2, 2019 · 1 comment
Open

Deme representation in atomese #103

ngeiswei opened this issue Sep 2, 2019 · 1 comment

Comments

@ngeiswei
Copy link
Member

ngeiswei commented Sep 2, 2019

Overview

The idea is to represent the deme in Atomese. In other words the result from calling build_knobs from representation should create an atomese program representation the exemplar decorated with knobs. Then running this atomese program with the right arguments (i.e. knob settings) should instantiate a candidate.

Why

Deme representation is a crucial part of MOSES, it is not done randomly and must have properties such as maximizing candidate expressiveness and density, etc. By having the representation in atomese it is a first step towards being able to improve upon that step via meta-learning, or automate the process of building a representation for new operators, etc.

Initial Suggestion of Representation

Here is an example of representation, not necessarily the final one but I think it could look like that this.

Textual representation:

(And [P (Not P)] [Q (Not Q)])

this prototype (aka representation) has 2 knobs, the first one can be set to P or (Not P), and the second one can be set to Q or (Not Q). The suggested Atomese representation would be

(Lambda
  (VariableList
    (TypedVariable
      (Variable "$kb1-pos")
      (Type "NumberNode"))
    (TypedVariable
      (Variable "$kb2-pos")
      (Type "NumberNode")))
  (Put
    (VariableList
      (Variable "$kb1")
      (Variable "$kb2"))
    (And
      (Variable "$kb1")
      (Variable "$kb2"))
    (List
      (Cond
        (Equal (Variable "$kb1-pos" (Number 0)) (Predicate "P")
        (Equal (Variable "$kb1-pos" (Number 1)) (Not (Predicate "P")))
      (Cond
        (Equal (Variable "$kb2-pos" (Number 0)) (Predicate "Q")
        (Equal (Variable "$kb2-pos" (Number 1)) (Not (Predicate "Q"))))))

Side note: I wonder if we don't want to introduce a plain switch-case link, that would simplify the representation a bit. But that can be done later on, once we settle on the correct representation.

Task

The first task is gonna be to test and refine such representation. I suggest to run asmoses on some demo problem such as pa and build at hand the atomese representations of the first few prototypes to see if that representation holds up in practice. Then run these atomese representation (given knob settings in arguments) to see if they indeed produce the desired candidates.

Then, once this testing phase results in a correct representation, then port build_knobs accordingly.

@ngeiswei
Copy link
Member Author

ngeiswei commented Sep 2, 2019

There's a case operator in scheme https://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Conditionals.html, looks like having a CaseLink would make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant