-
Notifications
You must be signed in to change notification settings - Fork 43
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
RASP validator fails for some programs #11
Comments
Thanks! Fixed by 001bdb3 -- but, feel free to reopen if you find other cases the validator doesn't catch |
Came across another case that the validator doesn't catch: from tracr.rasp import rasp
from tracr.compiler import compiling, validating
sel = rasp.Select(rasp.indices, rasp.tokens, rasp.Comparison.EQ)
sop = rasp.Aggregate(sel, rasp.indices)
program = rasp.Aggregate(sel, sop)
model = compiling.compile_rasp_to_model(program, vocab={1,2,3,4}, max_seq_len=5, compiler_bos="BOS")
compiled_output = model.apply(["BOS", 1, 2, 3, 4]).decoded
rasp_output = program([1, 2, 3, 4])
# The output of the compiled model does not match the output of the RASP program:
print(rasp_output) # [2.0, 3.0, None, None]
print(compiled_output) # ['BOS', 2, 3, 0, 1]
# The validator doesn't catch the error:
print(validating.validate(program, [1, 2, 3, 4])) # [] |
For all of these cases, can you try increasing the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue #9 introduces a validator to check RASP programs that compile incorrectly.
Here's one case---a RASP program that computes the sum of all inputs up to the current index---in which I think the validator fails (or I've misunderstood how it works):
The text was updated successfully, but these errors were encountered: