Spaces:
Sleeping
Sleeping
| """ | |
| 突触微柱包 - L1/L2/L3三档突触模式 | |
| """ | |
| from .l1_sparse import SparseSynapticMicroColumn | |
| from .l2_layered import LayeredSynapticMicroColumn | |
| from .l3_full import FullSynapticMicroColumn | |
| # 基类别名 | |
| SynapticMicroColumn = SparseSynapticMicroColumn | |
| SYNAPTIC_TIERS = { | |
| 'L1': SparseSynapticMicroColumn, | |
| 'L2': LayeredSynapticMicroColumn, | |
| 'L3': FullSynapticMicroColumn, | |
| } | |
| def get_synaptic_micro_column(tier: str, num_neurons: int = 100, | |
| column_type: str = 'sensory', **kwargs): | |
| """创建突触微柱 | |
| Args: | |
| tier: 档位(L1/L2/L3) | |
| num_neurons: 神经元数量 | |
| column_type: 功能类型(仅L1/L2/L3内部用到) | |
| """ | |
| if tier not in SYNAPTIC_TIERS: | |
| raise ValueError(f"未知突触档位: {tier}, 可选: {list(SYNAPTIC_TIERS.keys())}") | |
| cls = SYNAPTIC_TIERS[tier] | |
| return cls(num_neurons=num_neurons, **kwargs) | |