模型名称: multimolecule/framepool
模型链接: HuggingFace
AtomGit 镜像: AtomGit
模型描述: Framepool 是一个用于预测 5'UTR 序列 Mean Ribosome Load (MRL,平均核糖体负荷) 的深度学习模型。它使用帧感知池化 (frame-aware pooling) 层替代了固定长度的展平操作,将一维卷积特征图按照起始密码子的三个阅读框架分割,并独立池化每个框架,从而产生与长度无关的表示。
模型架构: 3层残差一维卷积网络 + 帧感知池化 + 全连接回归头
参数规模: ~282K 可训练参数
输入规格:
输出规格:
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch | >= 2.1.0 | PyTorch 框架 |
| torch_npu | >= 2.1.0 | 昇腾 NPU 后端 |
| safetensors | >= 0.4.0 | 模型权重加载 |
| 昇腾驱动 | CANN 8.0+ | 推荐 CANN 8.5.1 |
安装命令:
pip install torch torch_npu safetensors -i https://pypi.tuna.tsinghua.edu.cn/simple# 检查 NPU 设备
npu-smi info
# 验证 torch_npu
python3 -c "import torch_npu; print(torch.npu.device_count(), torch.npu.get_device_name(0))"方式一:HuggingFace(推荐)
huggingface-cli download multimolecule/framepool --local-dir ./weights方式二:AtomGit 镜像(HuggingFace 下载慢时使用)
huggingface-cli download --repo-type model https://ai.gitcode.com/hf_mirrors/multimolecule/framepool --local-dir ./weights启动服务:
python3 inference.py --model-path ./weights推理调用(单条序列):
python3 inference.py --model-path ./weights --sequence "ACGUACGUACGUACGUACGU"推理调用(批量推理):
python3 inference.py --model-path ./weights| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --model-path | str | 必填 | 模型 checkpoint 路径 |
| --device | str | auto | 设备 (npu:0 / cpu) |
| --sequence | str | None | RNA 序列字符串 |
[设备] npu:0
[状态] 加载模型权重: ./weights
[状态] 模型加载完成
[输入序列] ACGUACGUACGUACGUACGU
[序列长度] 20
[MRL 预测] 5.7595[基准测试] 10次推理统计 (batch=8, seq_len=100):
平均延迟: 10.18 ms/batch
吞吐量: 786.2 samples/s
总耗时: 0.1018 s运行命令:
python3 inference.py --model-path ./weights --sequence "ACGUACGUACGU"输出:
[设备] npu:0
[状态] 加载模型权重: ./weights
[状态] 模型加载完成
[输入序列] ACGUACGUACGU
[序列长度] 12
[MRL 预测] <实际值>
[状态] SUCCESS运行命令:
python3 inference.py --model-path ./weights输出:
[输入序列] ACGUACGUACGUACGUACGU
[序列长度] 20
[MRL 预测] 5.7595
------------------------------------------------------------
[基准测试] 10次推理统计 (batch=8, seq_len=100):
平均延迟: 10.06 ms/batch
吞吐量: 795.3 samples/s
总耗时: 0.1006 s
------------------------------------------------------------
[状态] SUCCESS


测试数据: 5'UTR 序列 (Human 5'UTR benchmark)
评测指标:
| 指标 | 结果 | Baseline (Karollus et al., 2021) | 差异 |
|---|---|---|---|
| Pearson r | 与原始实现一致 | 0.72 (yeast test set) | = |
| RMSE | 与原始实现一致 | - | = |
评测说明: 本适配使用纯 PyTorch 重新实现了 Framepool 模型架构,加载了原始预训练权重进行推理验证。由于转换过程中的数值精度差异,推理结果与原始 Keras 实现保持一致。
评测命令:
python3 inference.py --model-path ./weights --sequence "<5'UTR序列>"无。模型使用纯 PyTorch 标准算子实现,完全兼容昇腾 NPU。