Spaces:
Sleeping
Sleeping
| """ | |
| 微柱功能类型统一基类 | |
| 定义7种微柱功能的公共接口 | |
| """ | |
| from abc import ABC, abstractmethod | |
| import numpy as np | |
| from typing import Dict, Any | |
| class MicroColumn(ABC): | |
| """微柱基类""" | |
| def __init__(self, num_neurons: int = 100): | |
| self.num_neurons = num_neurons | |
| self.output = None | |
| def forward(self, inputs: np.ndarray) -> np.ndarray: | |
| """前向传播""" | |
| pass | |
| def get_config(self) -> Dict[str, Any]: | |
| """返回配置""" | |
| pass | |
| def reset(self): | |
| """重置状态""" | |
| self.output = None | |