Skip to main content

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

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

  • 架构说明:ARCHITECTURE.md
  • 模块职责图:MODULE_MAP.md

Compatibility Notes

  • 对外推荐只使用 CortexNet
  • 历史命名(如 CortexNetV2 / CortexNetV3)仍保留为兼容别名,避免旧代码立即失效。

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.1.tar.gz (114.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cortexnet-3.2.1-py3-none-any.whl (125.1 kB view details)

Uploaded Python 3

File details

Details for the file cortexnet-3.2.1.tar.gz.

File metadata

  • Download URL: cortexnet-3.2.1.tar.gz
  • Upload date:
  • Size: 114.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cortexnet-3.2.1.tar.gz
Algorithm Hash digest
SHA256 0faa9ad89b75350899c4f7a01f0c2e4568926f0a9c3a5f1aeb1a90970835e9f6
MD5 bf12750575f69dc4382923676eb875ab
BLAKE2b-256 42e2ee80068623a9526aa198b063d540454ce819dc138ee8697f1e8c5dc10b1c

See more details on using hashes here.

File details

Details for the file cortexnet-3.2.1-py3-none-any.whl.

File metadata

  • Download URL: cortexnet-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 125.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cortexnet-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7077aa8ceb2e99a0bc6e73d61983b00b2c9b3416a086d81408fb0df66668eb07
MD5 c1bdd4b09ac76580e6d225807f88933e
BLAKE2b-256 f6bb6950177f4fd990e1d8b40738298ff1b6fe0adbe603cfb4e6e323d9cece59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page