CortexNet: unified neural network architecture beyond Transformers
Project description
CortexNet
CortexNet 是一个面向语言建模与推理场景的神经网络架构实现,核心思路是将多尺度状态空间建模、选择性稀疏注意力、记忆系统、条件路由与可选高级推理模块组合到同一框架中。
本仓库已经完成以下整理:
- 统一对外主模型命名为
CortexNet(不再以*V3作为主入口) - 代码按
pip可发布标准重构到cortexnet/包目录 - 基准/聊天/评测脚本统一归档到
scripts/ - 清理无用导入、冗余变量和缓存文件
- 补充架构文档和模块映射文档,方便开源协作
Installation
pip install -e .
或构建并安装 wheel:
python -m pip install build
python -m build
pip install dist/*.whl
CLI
python -m cortexnet --version
python -m cortexnet --smoke-test
Quick Start
import torch
from cortexnet import CortexNet, CortexNetConfig
config = CortexNetConfig(
vocab_size=32000,
hidden_size=512,
num_layers=4,
num_heads=8,
max_seq_len=2048,
)
model = CortexNet(config).eval()
input_ids = torch.randint(0, config.vocab_size, (1, 16))
with torch.no_grad():
out = model(input_ids)
print(out["logits"].shape)
Package Layout
cortexnet/
adapter/ # 开源模型识别、权重映射、架构适配、推理适配、校准
ops/ # 设备与算子抽象(CPU/CUDA/MPS/NPU/MLU)
model.py # 主模型与 from_pretrained
blocks.py # 核心 block 组合
...
scripts/
benchmarks/ # 性能与量化基准
chat/ # 聊天脚本
eval/ # 能力评测脚本
dev/ # 一键流程与测试运行器
tests/ # 回归与单元测试
Test
python -m pytest -q
Docs
- 文档中心(中英文完整文档):
docs/README.md - 架构说明:
ARCHITECTURE.md - 模块职责图:
MODULE_MAP.md - 变更记录:
CHANGELOG.md - 贡献指南:
CONTRIBUTING.md - 安全策略:
SECURITY.md
Compatibility Notes
- 对外推荐只使用
CortexNet。 - 历史命名(如
CortexNetV2/CortexNetV3)仍保留为兼容别名,避免旧代码立即失效。
Development Commands
make install-dev
make lint
make test-all
make check
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cortexnet-3.2.2.tar.gz
(116.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
cortexnet-3.2.2-py3-none-any.whl
(126.5 kB
view details)
File details
Details for the file cortexnet-3.2.2.tar.gz.
File metadata
- Download URL: cortexnet-3.2.2.tar.gz
- Upload date:
- Size: 116.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01ac77b1d9a80a84bd9753ca520308ba44bf21598c921bc8232c4bde935d1ddb
|
|
| MD5 |
9a3208d1de6ed2bf8f1b46f88c34a67d
|
|
| BLAKE2b-256 |
70a233fc43dc80d2324b44fd3356eb55925342f86fcd3659f48ae1aa16897ac0
|
File details
Details for the file cortexnet-3.2.2-py3-none-any.whl.
File metadata
- Download URL: cortexnet-3.2.2-py3-none-any.whl
- Upload date:
- Size: 126.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
639257c99440e70f997f690ff6ece182ff4a5363bb8341d5c6dcd85f0c374fd3
|
|
| MD5 |
2ac35ff34a6c6d8f00074f5cf5c3d7f0
|
|
| BLAKE2b-256 |
36cd6bacecc6808f108f01d21ce2847a9a766d0b15c88c4d0d29d718c10c3b0d
|