Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to run hg38 experiment on newer pytorch lightning version. #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ scikit-learn
matplotlib
tqdm
rich
pytorch-lightning==1.8.6
pytorch-lightning==2.1.2
hydra-core
omegaconf
wandb
Expand All @@ -29,4 +29,4 @@ pyfaidx
polars
genomic-benchmarks
loguru
liftover
liftover
3 changes: 3 additions & 0 deletions src/dataloaders/datasets/hg38_char_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def __init__(self, characters: Sequence[str], model_max_length: int, padding_sid
def vocab_size(self) -> int:
return len(self._vocab_str_to_int)

def get_vocab(self) -> dict[str, int]:
return self.get_added_vocab()

def _tokenize(self, text: str) -> List[str]:
return list(text)

Expand Down
8 changes: 0 additions & 8 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,19 +364,11 @@ def on_train_epoch_start(self):
# Reset training torchmetrics
self.task._reset_torchmetrics("train")

def training_epoch_end(self, outputs):
# Log training torchmetrics
super().training_epoch_end(outputs)

def on_validation_epoch_start(self):
# Reset all validation torchmetrics
for name in self.val_loader_names:
self.task._reset_torchmetrics(name)

def validation_epoch_end(self, outputs):
# Log all validation torchmetrics
super().validation_epoch_end(outputs)

def on_test_epoch_start(self):
# Reset all test torchmetrics
for name in self.test_loader_names:
Expand Down