Skip to main content

CortexNet

CI PyPI version License

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
  • Hugging Face 发布:docs/en/HF_PUBLISHING.md / docs/zh-CN/HF_PUBLISHING.md

Compatibility Notes

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

Development Commands

make install-dev
make lint
make test-all
make check

Metadata

Release files for cortexnet 3.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cortexnet 3.2.5
File Size Uploaded Provenance
cortexnet-3.2.5.tar.gz 116.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cortexnet 3.2.5
File Interpreter ABI Platform
cortexnet-3.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 243.6 kB

Release files / cortexnet-3.2.5.tar.gz

Download URL cortexnet-3.2.5.tar.gz
Size 116.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2d2f667cd2a5ce14651a2f8c5a129d1ffb0c75091f639197110765f607662224
BLAKE2b-256 checksum
How to use checksums
ff0c9dc55f647ae2f003f087e840bc4ef17e163d25885c7b1936bfe8ff64a05a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / cortexnet-3.2.5-py3-none-any.whl

Download URL cortexnet-3.2.5-py3-none-any.whl
Size 126.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76e0718834ed64f1fe5d144a4e51fc9f2857abfeef3afc1154b6365f978362d1
BLAKE2b-256 checksum
How to use checksums
62cc5571ddeb664f12cfb2f3d5ce1ee7c0f1794b7ba84f3235db3bf6a880ce11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for cortexnet 3.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page