CortexNet: unified neural network architecture beyond Transformers
Project description
CortexNet
Language / 语言
- 中文文档入口:
docs/README.md(Chinese + English full docs index) - English quick docs:
docs/en/QUICKSTART_AND_USAGE.md - Chinese quick docs:
docs/zh-CN/QUICKSTART_AND_USAGE.md
CortexNet 是一个面向语言建模与推理场景的神经网络架构实现,核心思路是将多尺度状态空间建模、选择性稀疏注意力、记忆系统、条件路由与可选高级推理模块组合到同一框架中。
CortexNet is a unified neural architecture implementation for language modeling and reasoning, combining multi-scale SSM, selective sparse attention, memory, conditional routing, and optional advanced reasoning modules in one framework.
本仓库已经完成以下整理:
- 统一对外主模型命名为
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 - 支持与问题分流:
SUPPORT.md - 安全策略:
SECURITY.md - 示例代码:
examples/README.md - 发布基准报告:
docs/reports/README.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
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
File details
Details for the file cortexnet-3.2.4.tar.gz.
File metadata
- Download URL: cortexnet-3.2.4.tar.gz
- Upload date:
- Size: 116.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49d52e0b886b35c06879efbb240563d2bd54e3005ab585e8d6566bf0e46beeee
|
|
| MD5 |
4924af76fd95adc8b685e57dfdc82a44
|
|
| BLAKE2b-256 |
34e9edcfaaf5fd3ba7e4d4fddeca35946c58b1593e587f8e78823a673539cd34
|
File details
Details for the file cortexnet-3.2.4-py3-none-any.whl.
File metadata
- Download URL: cortexnet-3.2.4-py3-none-any.whl
- Upload date:
- Size: 126.8 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 |
62199af0abbfb06fe5001bbc582d49f76474f873f8002b5a62c719fe7291fbe7
|
|
| MD5 |
ef74196a0efe243862722ede99eea2e7
|
|
| BLAKE2b-256 |
2fe5ca6968396a256fe16d2b74da631fb63eb89c1dd974533afe1574a4d77bd9
|