All Projects → enochkan → torch-metrics

enochkan / torch-metrics

Licence: MIT License
Metrics for model evaluation in pytorch

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to torch-metrics

gan-vae-pretrained-pytorch
Pretrained GANs + VAEs + classifiers for MNIST/CIFAR in pytorch.
Stars: ✭ 134 (+35.35%)
Mutual labels:  pytorch-implementation
SelfOrganizingMap-SOM
Pytorch implementation of Self-Organizing Map(SOM). Use MNIST dataset as a demo.
Stars: ✭ 33 (-66.67%)
Mutual labels:  pytorch-implementation
libmcu
A toolkit for firmware development
Stars: ✭ 33 (-66.67%)
Mutual labels:  metrics
SpinNet
[CVPR 2021] SpinNet: Learning a General Surface Descriptor for 3D Point Cloud Registration
Stars: ✭ 181 (+82.83%)
Mutual labels:  pytorch-implementation
ElasticFace
Official repository for ElasticFace: Elastic Margin Loss for Deep Face Recognition
Stars: ✭ 86 (-13.13%)
Mutual labels:  pytorch-implementation
Relation-Network-PyTorch
Implementation of Relation Network and Recurrent Relational Network using PyTorch v1.3. Original papers: (RN) https://arxiv.org/abs/1706.01427 (RRN): https://arxiv.org/abs/1711.08028
Stars: ✭ 17 (-82.83%)
Mutual labels:  pytorch-implementation
DualStudent
Code for Paper ''Dual Student: Breaking the Limits of the Teacher in Semi-Supervised Learning'' [ICCV 2019]
Stars: ✭ 106 (+7.07%)
Mutual labels:  pytorch-implementation
prometheus-httpd
Expose Prometheus metrics using inets httpd.
Stars: ✭ 21 (-78.79%)
Mutual labels:  metrics
nlp classification
Implementing nlp papers relevant to classification with PyTorch, gluonnlp
Stars: ✭ 224 (+126.26%)
Mutual labels:  pytorch-implementation
MelNet-SpeechGeneration
Implementation of MelNet in PyTorch to generate high-fidelity audio samples
Stars: ✭ 19 (-80.81%)
Mutual labels:  pytorch-implementation
OpenNMT-kpg-release
Keyphrase Generation
Stars: ✭ 162 (+63.64%)
Mutual labels:  pytorch-implementation
ConvLSTM-PyTorch
ConvLSTM/ConvGRU (Encoder-Decoder) with PyTorch on Moving-MNIST
Stars: ✭ 202 (+104.04%)
Mutual labels:  pytorch-implementation
photometric optimization
Photometric optimization code for creating the FLAME texture space and other applications
Stars: ✭ 271 (+173.74%)
Mutual labels:  pytorch-implementation
tldr
TLDR is an unsupervised dimensionality reduction method that combines neighborhood embedding learning with the simplicity and effectiveness of recent self-supervised learning losses
Stars: ✭ 95 (-4.04%)
Mutual labels:  pytorch-implementation
attention-sampling-pytorch
This is a PyTorch implementation of the paper: "Processing Megapixel Images with Deep Attention-Sampling Models".
Stars: ✭ 25 (-74.75%)
Mutual labels:  pytorch-implementation
Pruning filters for efficient convnets
PyTorch implementation of "Pruning Filters For Efficient ConvNets"
Stars: ✭ 96 (-3.03%)
Mutual labels:  pytorch-implementation
Walk-Transformer
From Random Walks to Transformer for Learning Node Embeddings (ECML-PKDD 2020) (In Pytorch and Tensorflow)
Stars: ✭ 26 (-73.74%)
Mutual labels:  pytorch-implementation
gin-metrics
gin-gonic/gin metrics for prometheus.
Stars: ✭ 87 (-12.12%)
Mutual labels:  metrics
icingaweb2-module-pnp
Integrate PNP graphs into Icinga Web 2
Stars: ✭ 32 (-67.68%)
Mutual labels:  metrics
differentiable-morphogenesis
experimenting with differentiable models of morphogenesis 🔬 🦠
Stars: ✭ 38 (-61.62%)
Mutual labels:  pytorch-implementation

Torch-metrics

PyPI version License: MIT

Model evaluation metrics for PyTorch

Torch-metrics serves as a custom library to provide common ML evaluation metrics in Pytorch, similar to tf.keras.metrics.

As summarized in this issue, Pytorch does not have a built-in libary torch.metrics for model evaluation metrics. This is similar to the metrics library in PyTorch Lightning.

Usage

  • pip install --upgrade torch-metrics
from torch_metrics import Accuracy

## define metric ##
metric = Accuracy(from_logits=False)
y_pred = torch.tensor([1, 2, 3, 4])
y_true = torch.tensor([0, 2, 3, 4])

print(metric(y_pred, y_true))
## define metric ##
metric = Accuracy()
y_pred = torch.tensor([[0.2, 0.6, 0.1, 0.05, 0.05],
                       [0.2, 0.1, 0.6, 0.05, 0.05],
                       [0.2, 0.05, 0.1, 0.6, 0.05],
                       [0.2, 0.05, 0.05, 0.05, 0.65]])
y_true = torch.tensor([0, 2, 3, 4])

print(metric(y_pred, y_true))

Implementation

Metrics from tf.keras.metrics and other metrics that are already implemented vs to-do

  • MeanSquaredError class
  • RootMeanSquaredError class
  • MeanAbsoluteError class
  • Precision class
  • Recall class
  • MeanIoU class
  • DSC class (Dice Similarity Coefficient)
  • F1Score class
  • RSquared class
  • Hinge class
  • SquaredHinge class
  • LogCoshError class
  • Accuracy class
  • KLDivergence class
  • CosineSimilarity class
  • AUC class
  • BinaryCrossEntropy class
  • CategoricalCrossEntropy class
  • SparseCategoricalCrossentropy class

Local Development and Testing

To quickly get started with local development, run:

make develop

To test, run:

python3 -m pytest

Pre-commit hooks

To run pre-commit against all files:

pre-commit run --all-files

Contributing

Please raise issues or feature requests here. It will be extremely helpful if you comment on a specific issue before working on it. This provides visibility for others who also intend to work on the same issue. Reference any pull requests to their original issues.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].