-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
133 lines (113 loc) · 3.17 KB
/
__init__.py
File metadata and controls
133 lines (113 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
"""
Attention - Dynamic Resource Allocation for Symbol Streams
A framework for modeling attention as the routing of symbols through
cascading sequences with filtering, pattern matching, and reinforcement.
Core Insight:
Attention is not a single mechanism but an emergent property of
multiple sequences with subscribing processes that hash patterns,
publish associations, and reinforce convergent signals.
Architecture:
Sequence → Process → Sequence → Process → ...
- Sequences are bounded buffers forcing prioritization
- Processes subscribe to sequences and match patterns
- Matched patterns publish to other sequences
- Value (salience) determines what persists
Quick Start:
from attention import Sequence, Symbol, RepetitionProcess
# Create sequences
input_seq = Sequence("input", capacity=20)
output_seq = Sequence("output", capacity=10, min_value=0.5)
# Create a process that detects repeated symbols
detector = RepetitionProcess(
"repeat_detector",
inputs=[input_seq],
outputs=[output_seq]
)
detector.start()
# Publish symbols
input_seq.publish(Symbol(data="hello", value=0.6))
input_seq.publish(Symbol(data="hello", value=0.6)) # Repeat detected!
Integration Points:
- full-duplex: Feed DuplexStream symbols into attention sequences
- novelty: Use NoveltyProcess to route by novelty scores
- life: Use world model allocations as salience via AllocationAdapter
Novelty Integration:
from attention import create_novelty_pipeline
working, conscious, proc = create_novelty_pipeline()
proc.start()
# Publish to working memory - novel items auto-promote to conscious
working.publish(Symbol(data="something new", value=0.5))
"""
from .sequence import (
Symbol,
Sequence,
SequenceChain,
EvictionPolicy,
Subscription,
Filter,
)
from .process import (
Process,
Match,
LookupProcess,
RepetitionProcess,
ConvergenceProcess,
LoopDetector,
)
from .salience import (
SalienceFunction,
CompositeSalience,
SalienceTracker,
SalienceRecord,
# Built-in functions
constant_salience,
recency_salience,
length_salience,
keyword_salience,
# Adapters for external systems
NoveltyAdapter,
AllocationAdapter,
)
from .novelty_process import (
NoveltyProcess,
SequenceFrame,
SimpleNoveltyProbe,
SimpleNoveltyResult,
create_novelty_pipeline,
is_novelty_available,
)
__version__ = "0.2.0"
__all__ = [
# Core
"Symbol",
"Sequence",
"SequenceChain",
"EvictionPolicy",
"Subscription",
"Filter",
# Processes
"Process",
"Match",
"LookupProcess",
"RepetitionProcess",
"ConvergenceProcess",
"LoopDetector",
# Salience
"SalienceFunction",
"CompositeSalience",
"SalienceTracker",
"SalienceRecord",
"constant_salience",
"recency_salience",
"length_salience",
"keyword_salience",
"NoveltyAdapter",
"AllocationAdapter",
# Novelty integration
"NoveltyProcess",
"SequenceFrame",
"SimpleNoveltyProbe",
"SimpleNoveltyResult",
"create_novelty_pipeline",
"is_novelty_available",
]