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

Next character prediction (list)? #2

Open
jabowery opened this issue Apr 10, 2024 · 1 comment
Open

Next character prediction (list)? #2

jabowery opened this issue Apr 10, 2024 · 1 comment

Comments

@jabowery
Copy link

Recognizing this may be beyond the intended scope of the maxsynth ILP approach to program synthesis:

Muggleton does, in "Inductive Logic Programming: Theory and Methods" , reference Solomonoff Induction as foundational. Bearing in mind the critical difference between Rissanen's Turing INcomplete MDL codes, and the Turing Complete basis for Kolmogorov Complexity used by Solomonoff, what might a "next character prediction" based on ILP look like?

For example, the following is non-working code for a problem generator that reads in a 100M snapshot of Wikipedia for a list problem:

(maxsynth) jabowery@jaboweryML:~/devel/maxsynth$ cat ilpexp/problem/list/wiki/wiki.py 
import random
from ..list import ListProblem, gen_list
wikistr = open('/mnt/BulkData/home/jabowery/dev/sequitur/data/enwik8').read()
context = 1000
pred_len = 1
def gen_pos():
    pos = random.randint(0,len(wikistr)-1-context-pred_len)
    x = list(wikistr[pos:pos+context+1])
    y = x[-pred_len:]
    x = x[:-pred_len]
    return f'f({x},{y})'

def gen_neg():
    while True:
        pos = random.randint(0,len(wikistr)-1-context-pred_len)
        x = list(wikistr[pos:pos+context+1])
        pos = random.randint(0,len(wikistr)-1-context-pred_len)
        y = wikistr[pos:pos+pred_len]
        x = x[:-pred_len]
        return f'f({x},{y})'

WIKI = 'wiki'

class Wiki(ListProblem):
    def __init__(self, noise_level=0):
        super().__init__(WIKI, gen_pos, gen_neg, WIKI, noise_level)

@andrewcropper
Copy link

Richard Evans uses ILP to do character prediction:

Richard Evans, José Hernández-Orallo, Johannes Welbl, Pushmeet Kohli, Marek J. Sergot:
Making sense of sensory input. Artif. Intell. 293: 103438 (2021)

Available here: https://arxiv.org/pdf/1910.02227.pdf

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

2 participants