File size: 3,935 Bytes
5e0b58b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
"""Brain-5D core neural network components.

This package provides the fundamental building blocks of the Brain-5D
spiking neural network, including:
- 5D spatial indexing and coordinate transformations
- Izhikevich neuron model with multiple types, homeostasis, and energy
- Synaptic connections with STDP, reward-modulated plasticity, and metaplasticity
- Sparse spiking neural network with event-driven spike propagation

All components are fully typed and support serialization.
"""

from __future__ import annotations

# ============================================================================
# Network
# ============================================================================
from .network import (
    Brain5DConfig,
    NetworkConfig,
    NeuralNetwork,
    PostStepHook,
    SimulationConfig,
    SpikeEvent,
    StepResult,
    TopologyConfig,
    create_network,
)

# ============================================================================
# Neuron
# ============================================================================
from .neuron import (
    Neuron,
    NeuronConfig,
    NeuronType,
    create_neuron,
    create_random_neuron,
)

# ============================================================================
# Spatial Index
# ============================================================================
from .spatial_index import (
    BITS_PER_DIM,
    DIM_INDICES,
    DIM_NAMES,
    MASK,
    MAX_COORD,
    SHIFTS,
    Coord5D,
    Dim5D,
    chebyshev_distance_5d,
    coords_to_linear,
    coords_to_linear_batch,
    distance_5d,
    euclidean_distance_5d,
    get_dimension_index,
    get_dimension_name,
    is_valid_coord,
    is_valid_coord_in_dims,
    iter_linear_neighbours,
    iter_neighbour_coords,
    linear_to_5d,
    linear_to_coord,
    linear_to_coords_batch,
    make_boundary_coord,
    manhattan_distance_5d,
    neighbour_count,
    neighbour_offsets,
    pack_coords,
    total_cells,
    unpack_coords,
    validate_coord,
    validate_coord_in_dims,
    validate_dims,
    weighted_distance_5d,
)

# ============================================================================
# Synapse
# ============================================================================
from .synapse import (
    A_MINUS,
    A_PLUS,
    ELIGIBILITY_DECAY,
    TAU_MINUS,
    TAU_PLUS,
    W_MAX,
    W_MIN,
    Synapse,
    SynapseConfig,
    create_random_synapse,
    create_synapse,
)

# ============================================================================
# Public API
# ============================================================================

__all__ = [
    # Spatial index
    "BITS_PER_DIM",
    "Coord5D",
    "DIM_INDICES",
    "DIM_NAMES",
    "Dim5D",
    "MASK",
    "MAX_COORD",
    "SHIFTS",
    "chebyshev_distance_5d",
    "coords_to_linear",
    "coords_to_linear_batch",
    "distance_5d",
    "euclidean_distance_5d",
    "get_dimension_index",
    "get_dimension_name",
    "is_valid_coord",
    "is_valid_coord_in_dims",
    "iter_linear_neighbours",
    "iter_neighbour_coords",
    "linear_to_5d",
    "linear_to_coord",
    "linear_to_coords_batch",
    "make_boundary_coord",
    "manhattan_distance_5d",
    "neighbour_count",
    "neighbour_offsets",
    "pack_coords",
    "total_cells",
    "unpack_coords",
    "validate_coord",
    "validate_coord_in_dims",
    "validate_dims",
    "weighted_distance_5d",
    # Neuron
    "Neuron",
    "NeuronConfig",
    "NeuronType",
    "create_neuron",
    "create_random_neuron",
    # Synapse
    "A_MINUS",
    "A_PLUS",
    "ELIGIBILITY_DECAY",
    "TAU_MINUS",
    "TAU_PLUS",
    "W_MAX",
    "W_MIN",
    "Synapse",
    "SynapseConfig",
    "create_random_synapse",
    "create_synapse",
    # Network
    "Brain5DConfig",
    "NetworkConfig",
    "NeuralNetwork",
    "PostStepHook",
    "SimulationConfig",
    "SpikeEvent",
    "StepResult",
    "TopologyConfig",
    "create_network",
]