Skip to content

Commit d78c61a

Browse files
committed
uploaded package to pypi and added func tests
1 parent 3d8039e commit d78c61a

File tree

7 files changed

+16
-8
lines changed

7 files changed

+16
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*.egg-info
2+
/*dist

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ As summarized in this [issue](https://github.com/pytorch/pytorch/issues/22439),
55

66
### Usage
77

8-
- `pip install torchmetrics` or
8+
- `pip install --upgrade torch_metrics` or
99
- `git clone https://github.com/chinokenochkan/torch-metrics`
1010

1111
```python
12-
from torchmetrics import RSquaredMetric
12+
from torch_metrics import RSquaredMetric
1313
ground_truth = torch.tensor([2., 41., 55., 65.])
1414
model_out = model(torch.tensor([1., 2., 3.]))
1515
r2 = RSquaredMetric(model_out, ground_truth)

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from setuptools import setup, find_packages
22

33
setup(
4-
name="torchmetrics",
5-
version="1.0.0",
4+
name="torch_metrics",
5+
version="1.0.1",
66
description="Metrics for model evaluation in pytorch",
7-
url="https://github.com/sksq96/pytorch-summary",
7+
url="https://github.com/chinokenochkan/torch-metrics",
88
author="Chi Nok Enoch Kan @chinokenochkan",
99
author_email="[email protected]",
10-
packages=["torchmetrics"],
10+
packages=["torch_metrics"],
1111
)

torch_metrics/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .torch_metrics import RSquaredMetric, MSEMetric, MAEMetric, corrcoef

torch_metrics/tests/func_testing.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from torch_metrics import RSquaredMetric
2+
import torch
3+
t1 = torch.tensor([1., 2., 3.])
4+
t2 = torch.tensor([1., 5., 25.])
5+
print(RSquaredMetric(t1, t2))

torchmetrics/torchmetrics.py renamed to torch_metrics/torch_metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import torch
22

33
def corrcoef(tensor1, tensor2):
4-
xm = x.sub(torch.mean(tensor1))
5-
ym = y.sub(torch.mean(tensor2))
4+
xm = tensor1.sub(torch.mean(tensor1))
5+
ym = tensor2.sub(torch.mean(tensor2))
66
r_num = xm.dot(ym)
77
r_den = torch.norm(xm, 2) * torch.norm(ym, 2)
88
r_val = r_num / r_den

torchmetrics/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)