You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raising a separate issue to track a problem mentioned in #11.
Programs containing multiple categorical aggregates can sometimes compile invalidly (i.e. the output of the compiled model doesn't match the output of the rasp program).
This probably happens because the value None is just propagated forward unchanged in the rasp program. In the compiled model, Nones are converted to 0s, on which further operations can be performed (if I'm not mistaken).
Example:
fromtracr.raspimportraspfromtracr.compilerimportcompiling, validatingsel=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]).decodedrasp_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])) # []
The text was updated successfully, but these errors were encountered:
For general inputs, compiled will return the minimum of the input sequence (1 in the example above). IMO the desired behavior here would be to consistently return 0.
Raising a separate issue to track a problem mentioned in #11.
Programs containing multiple categorical aggregates can sometimes compile invalidly (i.e. the output of the compiled model doesn't match the output of the rasp program).
This probably happens because the value None is just propagated forward unchanged in the rasp program. In the compiled model,
None
s are converted to0
s, on which further operations can be performed (if I'm not mistaken).Example:
The text was updated successfully, but these errors were encountered: