|
Download docs/ARCHITECTURE.md from zhangdebiao/rlclean: direct link, hf CLI and curl.
- Browser
- Download file 1.59 kB
-
https://huggingface.co/datasets/zhangdebiao/rlclean/resolve/main/docs/ARCHITECTURE.md
- Command line
-
hf download hf://datasets/zhangdebiao/rlclean/docs/ARCHITECTURE.md
-
curl -L -o ARCHITECTURE.md https://huggingface.co/datasets/zhangdebiao/rlclean/resolve/main/docs/ARCHITECTURE.md
1.59 kB
Architecture
分层
- Domain
domain/model.pydomain/methods.pydomain/consistency.pydomain/invariants.pysrc/rlclean/repair/(detector/ddpm/bandit)
- Application
src/rlclean/pipeline/pipeline_service.pysrc/rlclean/pipeline/cleaner.py
- Infrastructure
src/rlclean/utils/executor.pysrc/rlclean/utils/registry.py
- Interface
src/rlclean/cli/main.py
设计意图
- Domain 不依赖脚本细节,只定义方法语义、约束与规则。
- Application 只编排用例,不关心底层命令执行实现。
- Infrastructure 只处理执行、路径、日志落盘。
- Interface 只负责输入配置并触发应用服务。
编排模型
PipelineService 负责阶段顺序:
- build_dataset
- detect
- filter
- verify_alignment
- run_cleaners
- evaluate
方法策略:
- DecoupledDetectorStrategy
- DDPMCleanerStrategy
- BanditCleanerStrategy
三者通过统一接口接入 orchestrator,可串行或并行。
产物规范
每个 run 按噪声类型独立归档:
runs/<run_name>/<noise_type>/
├── configs/
├── logs/
├── scores/
├── indices/
├── datasets/
├── models/
│ ├── ddpm/
│ └── bandit/
└── eval/
一致性防线
domain/consistency.py + domain/invariants.py 对以下关键条件做强校验:
- clean/dirty 分区互斥且覆盖评估核心区间
- 索引不越界
pred_mask_s/a/r长度与全量 transition 对齐
不满足即中断流程,避免错误数据进入清洗阶段。