Skip to content

Commit

Permalink
Merge pull request #30 from Genentech/fix-pearson
Browse files Browse the repository at this point in the history
added reset method to PearsonCorrCoef
  • Loading branch information
avantikalal authored Jul 26, 2024
2 parents f349d29 + dedfa8c commit ef2f2a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/grelu/lightning/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,6 @@ def compute(self) -> torch.Tensor:
return output.mean()
else:
return output

def reset(self) -> None:
self.pearson.reset()
7 changes: 3 additions & 4 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@
EnformerModel,
EnformerPretrainedModel,
)
from grelu.resources import DEFAULT_WANDB_HOST
from grelu.sequence.format import convert_input_type

inputs = convert_input_type(["A" * 128], "one_hot")


try:
wandb.login(host="https://genentech.wandb.io", anonymous="never", timeout=0)
wandb.login(host=DEFAULT_WANDB_HOST, anonymous="never", timeout=0)
except wandb.errors.UsageError: # login anonymously if not logged in already
wandb.login(
host="https://genentech.wandb.io", relogin=True, anonymous="must", timeout=0
)
wandb.login(host=DEFAULT_WANDB_HOST, relogin=True, anonymous="must", timeout=0)


# Test a fully convolutional model with residual connections and autocropping
Expand Down

0 comments on commit ef2f2a7

Please sign in to comment.