learning
Configure REINVENT4 transfer learning and staged reinforcement learning runs safely.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- learning
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Configure REINVENT4 transfer learning and staged reinforcement learning runs safely.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/monitoring-and-outputs.md5.6 KB
- 参考文档references/tl-rl-workflows.md8.0 KB
- 参考文档references/troubleshooting.md7.0 KB
- 脚本scripts/check_learning_config.py14.7 KB
03 SKILL.md 正文
REINVENT4 Learning
Use this sub-skill when the user asks for transfer learning, transfer_learning.toml, staged RL/curriculum learning, staged_learning.toml, diversity filters, inception memory, TensorBoard monitoring, or a TL-then-RL workflow.
Route the request
- Use
run_type = "transfer_learning"to bias a prior or checkpoint toward a curated SMILES set and write anoutput_model_filethat can later be sampled or used as an RLagent_file. - Use
run_type = "staged_learning"for all reinforcement learning, including a single-stage RL run and multi-stage curriculum learning. - For TL followed by RL, prepare and validate the TL config first, plan a brief sample/quality check of the TL model, then set the staged-learning
agent_fileto the chosen TL.modelor checkpoint while keepingprior_filecompatible with the same generator type. - Cross-link to the scoring sub-skill for scoring component design, transforms, external scoring files, and scoring-only validation; this sub-skill only covers how scoring is embedded in staged learning.
- Cross-link to the sampling sub-skill when the user needs to sample from a prior, TL model, or RL checkpoint.
- Cross-link to the data-pipeline sub-skill when the training or seed SMILES file needs cleaning, splitting, column extraction, or standardization.
Safe workflow
- Identify the generator family from the model file and input shape: Reinvent uses one-column SMILES; Mol2Mol/Pepinvent usually need conditional input plus
sample_strategy; LibInvent/LinkInvent use two-column fragment inputs. - Use CPU by default for dry-run validation and small examples; if the config says
device = "cuda:0", tell the userreinvent --device cpu FILEoverrides the config for CPU fallback. - Validate config shape before any training: run
python sub-skills/learning/scripts/check_learning_config.py CONFIGfrom the skill root or copy the script beside the planned config. - Never start long TL/RL training without explicit user approval for runtime, model files, input SMILES, scoring files, output locations, and device.
- Prefer short exploratory settings first: small
num_epochsfor TL, conservative RLmax_steps, and checkpoint files on every stage.
Required config anchors
- TL config: top-level
run_type,device, optional top-leveltb_logdir, then[parameters]withinput_model_file,smiles_file,output_model_file,num_epochs,batch_size, and usuallyvalidation_smiles_fileplussave_every_n_epochs. - Mol2Mol TL: include
[parameters.pairs]or dottedpairs.*thresholds for Tanimoto pair construction. - RL config: top-level
run_type,device, optional top-leveltb_logdir,[parameters],[learning_strategy], optional[diversity_filter], optional[inception]or[intrinsic_penalty], and one or more[[stage]]blocks. - RL parameters:
prior_file,agent_file,summary_csv_prefix,batch_size, optionalsmiles_filefor conditional generators, and safe checkpoint/continuation settings (use_checkpoint,purge_memories). - RL stages: each
[[stage]]needsmax_steps,termination = "simple",min_steps,max_score, optionalchkpt_file, and[stage.scoring]with inline components orfilenameplusfiletypefor bundled stage scoring files.
Bundled guidance
- Read
references/tl-rl-workflows.mdfor concrete TL, staged RL, diversity filter, inception, intrinsic penalty, and TL-then-RL patterns. - Read
references/monitoring-and-outputs.mdfor TensorBoard log layout, CSV columns, checkpoint behavior, and review criteria. - Read
references/troubleshooting.mdfor device fallback, missing model/input files, model type mismatch, scoring-file path errors, SMILES column issues, TensorBoard confusion, remote responder setup, and long-run safeguards. - Run
scripts/check_learning_config.pyto statically parse TOML/JSON/YAML configs and report missing major sections or risky settings without importing REINVENT4 or starting training.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).