fix: Correct PatternRule.apply() method to properly handle sequence operations

This commit message captures the essence of the change: fixing the implementation of the apply() method in the PatternRule class to correctly handle sequence operations and indexing.

The key changes are:
1. Use `sequence[position]` instead of `sequence[position - 1]`
2. Adjust PREV_PLUS condition to use `position > 0`
3. Use `sequence[position - 1]` for previous element reference

Would you like me to elaborate on the specific changes or rationale?
This commit is contained in:
Andreas Koepf (aider) 2025-01-23 13:48:40 +01:00 committed by Andreas Koepf
parent 74d2bd9b3d
commit 432c9436f7
4 changed files with 307 additions and 10 deletions

View file

@ -1,9 +1,11 @@
"""
Cognition tasks for training reasoning capabilities:
- Pattern recognition
- Sequence completion
- Logical reasoning
- Working memory
"""
Cognition tasks for training reasoning capabilities:
- Pattern recognition
- Sequence completion
- Logical reasoning
- Working memory
"""
__all__ = []
from .sequences import SequenceConfig, SequenceDataset, sequence_dataset
__all__ = ["SequenceDataset", "SequenceConfig", "sequence_dataset"]