Skip to content

Commit e14efe7

Browse files
lucapinelloclaude
andcommitted
Document fine_tune NotImplementedError on Sei + LegNet
The two oracles raise ``NotImplementedError`` for ``fine_tune()`` — a deliberate design decision for Sei (21,907-class head is tied to training vocabulary) and LegNet (single-output MPRA head trained on one cell type). Replaced the stale ``# TODO: for now we decided not to implement`` comment with a real docstring that explains *why* and points users at AlphaGenome / Borzoi for track-adaptive workflows. Behavior unchanged — same exception, clearer error message + docstring. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6ebc996 commit e14efe7

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

chorus/oracles/legnet.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,16 @@ def _predict_direct(self,
312312
return preds
313313

314314
def fine_tune(self, tracks: List[OraclePredictionTrack], track_names: List[str], **kwargs) -> None:
315-
"""Fine-tune LegNet on new tracks."""
316-
# TODO: for now we decided not to implement this functionality
317-
raise NotImplementedError("LegNet fine-tuning not yet implemented")
315+
"""Fine-tuning is not supported for LegNet.
316+
317+
LegNet's single-output MPRA head is trained on a specific cell
318+
type (HepG2) and assay. Fine-tuning on arbitrary tracks would
319+
require retraining from scratch — outside Chorus's scope.
320+
"""
321+
raise NotImplementedError(
322+
"LegNet fine-tuning is not supported. Train a new LegNet "
323+
"model externally if you need a different cell type / assay."
324+
)
318325

319326
def _get_context_size(self) -> int:
320327
"""Return the required context size for the model."""

chorus/oracles/sei.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,17 @@ def _predict_direct(self,
492492
return selected_preds, selected_classes
493493

494494
def fine_tune(self, tracks: List[Track], track_names: List[str], **kwargs) -> None:
495-
"""Fine-tune Sei on new tracks."""
496-
# TODO: for now we decided not to implement this functionality
497-
raise NotImplementedError("Sei fine-tuning not yet implemented")
495+
"""Fine-tuning is not supported for Sei.
496+
497+
Sei's 21,907-class classification head is tied to its training
498+
vocabulary; fine-tuning on user-supplied tracks would require
499+
re-engineering the head. Use AlphaGenome or Borzoi for
500+
workflows that need on-the-fly track adaptation.
501+
"""
502+
raise NotImplementedError(
503+
"Sei fine-tuning is not supported. Use AlphaGenome or "
504+
"Borzoi for workflows that need on-the-fly track adaptation."
505+
)
498506

499507
def _get_context_size(self) -> int:
500508
"""Return the required context size for the model."""

0 commit comments

Comments
 (0)