Skip to content

Commit

Permalink
set min TM version 0.10 (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Jun 30, 2023
1 parent 10f71cf commit 7a426b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
numpy <1.26.0
pytorch-lightning >1.7.0, <2.0.0 # strict
torchmetrics <0.12.0
torchmetrics >=0.10.0, <0.12.0
lightning-utilities >0.3.1 # this is needed for PL 1.7
torchvision >=0.10.0 # todo: move to topic related extras
tensorboard >=2.9.1, <2.14.0 # for `TensorBoardLogger`
2 changes: 1 addition & 1 deletion src/pl_bolts/models/regression/logistic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def _log_metrics(self, acc: Tensor, loss: Tensor, stage: str, **kwargs: bool) ->
def _calculate_accuracy(self, x: Tensor, y: Tensor) -> Tensor:
_, y_hat = torch.max(x, dim=-1)
return functional.accuracy(
y_hat, y, task="multiclass", average="weighted", num_classes=self.hparams.num_classes
y_hat, y, task="multiclass", average="weighted", num_classes=self.hparams.num_classes, top_k=1
)

def _regularization(self, loss: Tensor) -> Tensor:
Expand Down

0 comments on commit 7a426b4

Please sign in to comment.