Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Compiler doesn't support numerical Maps with negative output values #24

@langosco

Description

@langosco

Currently, the compiler doesn't support programs with numerical Maps that have negative output values for some inputs (cf PR #13).

For example, the program

 out = rasp.numerical(rasp.Map(lambda x: x - 1, rasp.tokens))

raises an error when compiled with vocab={0,1,2} (or any vocab including values <= 0).

It would be nice to support this; for example, negative values could be shifted by a bias parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions