Skip to content

Commit

Permalink
switch to torchmetrics (#590)
Browse files Browse the repository at this point in the history
* switch to torchmetrics

* 0.2.0

Co-authored-by: Akihiro Nitta <nitta@akihironitta.com>
  • Loading branch information
Borda and akihironitta authored Mar 12, 2021
1 parent 1244d88 commit d841cac
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pl_bolts/callbacks/ssl_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import torch
from pytorch_lightning import Callback, LightningModule, Trainer
from pytorch_lightning.metrics.functional import accuracy
from torch import device, Tensor
from torch.nn import functional as F
from torch.optim import Optimizer
from torchmetrics.functional import accuracy


class SSLOnlineEvaluator(Callback): # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion pl_bolts/models/regression/logistic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import pytorch_lightning as pl
import torch
from pytorch_lightning.metrics.functional import accuracy
from torch import nn
from torch.nn import functional as F
from torch.nn.functional import softmax
from torch.optim import Adam
from torch.optim.optimizer import Optimizer
from torchmetrics.functional import accuracy


class LogisticRegression(pl.LightningModule):
Expand Down
2 changes: 1 addition & 1 deletion pl_bolts/models/self_supervised/ssl_finetuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pytorch_lightning as pl
import torch
from pytorch_lightning.metrics import Accuracy
from torch.nn import functional as F
from torchmetrics import Accuracy

from pl_bolts.models.self_supervised import SSLEvaluator

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
torch>=1.6
torchmetrics>=0.2.0
pytorch-lightning>=1.1.1

0 comments on commit d841cac

Please sign in to comment.