├── .azure ├── gpu-integrations.yml ├── gpu-nuke-cache.yml └── gpu-unittests.yml ├── .codecov.yml ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .github ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── documentation.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── actions │ ├── pull-caches │ │ └── action.yml │ └── push-caches │ │ └── action.yml ├── assistant.py ├── dependabot.yml ├── labeling-config.yml ├── markdown-links-config.json ├── mergify.yml ├── stale.yml └── workflows │ ├── _focus-diff.yml │ ├── _merge_cache.yml │ ├── ci-checks.yml │ ├── ci-integrate.yml │ ├── ci-rtfd.yml │ ├── ci-tests.yml │ ├── clear-cache.yml │ ├── cmd-help.yml │ ├── cmd-rebase.yml │ ├── docker-build.yml │ ├── docs-build.yml │ ├── greetings.yml │ ├── labeler.yml │ ├── publish-pkg.yml │ └── slash-cmd-dispatch.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CHANGELOG.md ├── CITATION.cff ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.md ├── _samples ├── bert_score-own_model.py ├── detection_map.py ├── plotting.py └── rouge_score-own_normalizer_and_tokenizer.py ├── dockers ├── README.md └── ubuntu-cuda │ └── Dockerfile ├── docs ├── .build_docs.sh ├── .readthedocs.yaml ├── Makefile ├── README.md ├── make.bat ├── paper_JOSS │ ├── paper.bib │ └── paper.md ├── redirect.html ├── rtfd-build.sh └── source │ ├── _static │ ├── copybutton.js │ ├── css │ │ └── custom.css │ └── images │ │ ├── icon.png │ │ ├── icon.svg │ │ ├── logo.png │ │ ├── logo.svg │ │ ├── logo_light.svg │ │ └── plot_example.png │ ├── _templates │ ├── autosummary │ │ └── module.rst │ ├── classtemplate.rst │ ├── layout.html │ └── theme_variables.jinja │ ├── aggregation │ ├── cat.rst │ ├── max.rst │ ├── mean.rst │ ├── min.rst │ ├── running_mean.rst │ ├── running_sum.rst │ └── sum.rst │ ├── all-metrics.rst │ ├── audio │ ├── complex_scale_invariant_signal_noise_ratio.rst │ ├── deep_noise_suppression_mean_opinion_score.rst │ ├── non_intrusive_speech_quality_assessment.rst │ ├── perceptual_evaluation_speech_quality.rst │ ├── permutation_invariant_training.rst │ ├── scale_invariant_signal_distortion_ratio.rst │ ├── scale_invariant_signal_noise_ratio.rst │ ├── short_time_objective_intelligibility.rst │ ├── signal_distortion_ratio.rst │ ├── signal_noise_ratio.rst │ ├── source_aggregated_signal_distortion_ratio.rst │ └── speech_reverberation_modulation_energy_ratio.rst │ ├── classification │ ├── accuracy.rst │ ├── auroc.rst │ ├── average_precision.rst │ ├── calibration_error.rst │ ├── cohen_kappa.rst │ ├── confusion_matrix.rst │ ├── coverage_error.rst │ ├── eer.rst │ ├── exact_match.rst │ ├── f1_score.rst │ ├── fbeta_score.rst │ ├── group_fairness.rst │ ├── hamming_distance.rst │ ├── hinge_loss.rst │ ├── jaccard_index.rst │ ├── label_ranking_average_precision.rst │ ├── label_ranking_loss.rst │ ├── logauc.rst │ ├── matthews_corr_coef.rst │ ├── negative_predictive_value.rst │ ├── precision.rst │ ├── precision_at_fixed_recall.rst │ ├── precision_recall_curve.rst │ ├── recall.rst │ ├── recall_at_fixed_precision.rst │ ├── roc.rst │ ├── sensitivity_at_specificity.rst │ ├── specificity.rst │ ├── specificity_at_sensitivity.rst │ └── stat_scores.rst │ ├── clustering │ ├── adjusted_mutual_info_score.rst │ ├── adjusted_rand_score.rst │ ├── calinski_harabasz_score.rst │ ├── cluster_accuracy.rst │ ├── completeness_score.rst │ ├── davies_bouldin_score.rst │ ├── dunn_index.rst │ ├── fowlkes_mallows_index.rst │ ├── homogeneity_score.rst │ ├── mutual_info_score.rst │ ├── normalized_mutual_info_score.rst │ ├── rand_score.rst │ └── v_measure_score.rst │ ├── conf.py │ ├── detection │ ├── complete_intersection_over_union.rst │ ├── distance_intersection_over_union.rst │ ├── generalized_intersection_over_union.rst │ ├── intersection_over_union.rst │ ├── mean_average_precision.rst │ ├── modified_panoptic_quality.rst │ └── panoptic_quality.rst │ ├── governance.rst │ ├── image │ ├── arniqa.rst │ ├── dists.rst │ ├── error_relative_global_dimensionless_synthesis.rst │ ├── frechet_inception_distance.rst │ ├── image_gradients.rst │ ├── inception_score.rst │ ├── kernel_inception_distance.rst │ ├── learned_perceptual_image_patch_similarity.rst │ ├── mifid.rst │ ├── multi_scale_structural_similarity.rst │ ├── peak_signal_noise_ratio.rst │ ├── peak_signal_to_noise_with_block.rst │ ├── perceptual_path_length.rst │ ├── quality_with_no_reference.rst │ ├── relative_average_spectral_error.rst │ ├── root_mean_squared_error_using_sliding_window.rst │ ├── spatial_correlation_coefficient.rst │ ├── spatial_distortion_index.rst │ ├── spectral_angle_mapper.rst │ ├── spectral_distortion_index.rst │ ├── structural_similarity.rst │ ├── total_variation.rst │ ├── universal_image_quality_index.rst │ └── visual_information_fidelity.rst │ ├── index.rst │ ├── links.rst │ ├── multimodal │ ├── clip_iqa.rst │ ├── clip_score.rst │ └── lve.rst │ ├── nominal │ ├── cramers_v.rst │ ├── fleiss_kappa.rst │ ├── pearsons_contingency_coefficient.rst │ ├── theils_u.rst │ └── tschuprows_t.rst │ ├── pages │ ├── implement.rst │ ├── lightning.rst │ ├── overview.rst │ ├── plotting.rst │ └── quickstart.rst │ ├── pairwise │ ├── cosine_similarity.rst │ ├── euclidean_distance.rst │ ├── linear_similarity.rst │ ├── manhattan_distance.rst │ └── minkowski_distance.rst │ ├── pyplots │ ├── binary_accuracy.py │ ├── binary_accuracy_multistep.py │ ├── collection_binary.py │ ├── collection_binary_together.py │ ├── confusion_matrix.py │ ├── multiclass_accuracy.py │ └── tracker_binary.py │ ├── references │ ├── metric.rst │ └── utilities.rst │ ├── regression │ ├── concordance_corr_coef.rst │ ├── cosine_similarity.rst │ ├── critical_success_index.rst │ ├── crps.rst │ ├── explained_variance.rst │ ├── js_divergence.rst │ ├── kendall_rank_corr_coef.rst │ ├── kl_divergence.rst │ ├── log_cosh_error.rst │ ├── mean_absolute_error.rst │ ├── mean_absolute_percentage_error.rst │ ├── mean_squared_error.rst │ ├── mean_squared_log_error.rst │ ├── minkowski_distance.rst │ ├── normalized_root_mean_squared_error.rst │ ├── pearson_corr_coef.rst │ ├── r2_score.rst │ ├── rse.rst │ ├── spearman_corr_coef.rst │ ├── symmetric_mean_absolute_percentage_error.rst │ ├── tweedie_deviance_score.rst │ └── weighted_mean_absolute_percentage_error.rst │ ├── retrieval │ ├── auroc.rst │ ├── fall_out.rst │ ├── hit_rate.rst │ ├── map.rst │ ├── mrr.rst │ ├── normalized_dcg.rst │ ├── precision.rst │ ├── precision_recall_curve.rst │ ├── r_precision.rst │ └── recall.rst │ ├── segmentation │ ├── dice.rst │ ├── generalized_dice.rst │ ├── hausdorff_distance.rst │ └── mean_iou.rst │ ├── shape │ └── procrustes.rst │ ├── text │ ├── bert_score.rst │ ├── bleu_score.rst │ ├── char_error_rate.rst │ ├── chrf_score.rst │ ├── edit.rst │ ├── extended_edit_distance.rst │ ├── infolm.rst │ ├── match_error_rate.rst │ ├── perplexity.rst │ ├── rouge_score.rst │ ├── sacre_bleu_score.rst │ ├── squad.rst │ ├── translation_edit_rate.rst │ ├── word_error_rate.rst │ ├── word_info_lost.rst │ └── word_info_preserved.rst │ └── wrappers │ ├── bootstrapper.rst │ ├── classwise_wrapper.rst │ ├── feature_share.rst │ ├── metric_tracker.rst │ ├── min_max.rst │ ├── multi_output_wrapper.rst │ ├── multi_task_wrapper.rst │ ├── running.rst │ └── transformations.rst ├── examples ├── README.rst ├── audio │ ├── README.rst │ ├── pesq.py │ └── signal_to_noise_ratio.py ├── image │ ├── README.rst │ ├── clip_score.py │ └── spatial_correlation_coef.py └── text │ ├── README.rst │ ├── bertscore.py │ ├── perplexity.py │ └── rouge.py ├── pyproject.toml ├── requirements.txt ├── requirements ├── README.md ├── _devel.txt ├── _docs.txt ├── _doctest.txt ├── _integrate.txt ├── _tests.txt ├── audio.txt ├── audio_test.txt ├── base.txt ├── classification_test.txt ├── clustering.txt ├── clustering_test.txt ├── debug.txt ├── detection.txt ├── detection_test.txt ├── image.txt ├── image_test.txt ├── integrate.txt ├── multimodal.txt ├── nominal_test.txt ├── regression_test.txt ├── segmentation_test.txt ├── text.txt ├── text_test.txt ├── typing.txt └── visual.txt ├── setup.py ├── src ├── conftest.py └── torchmetrics │ ├── __about__.py │ ├── __init__.py │ ├── aggregation.py │ ├── audio │ ├── __init__.py │ ├── _deprecated.py │ ├── dnsmos.py │ ├── nisqa.py │ ├── pesq.py │ ├── pit.py │ ├── sdr.py │ ├── snr.py │ ├── srmr.py │ └── stoi.py │ ├── classification │ ├── __init__.py │ ├── accuracy.py │ ├── auroc.py │ ├── average_precision.py │ ├── base.py │ ├── calibration_error.py │ ├── cohen_kappa.py │ ├── confusion_matrix.py │ ├── eer.py │ ├── exact_match.py │ ├── f_beta.py │ ├── group_fairness.py │ ├── hamming.py │ ├── hinge.py │ ├── jaccard.py │ ├── logauc.py │ ├── matthews_corrcoef.py │ ├── negative_predictive_value.py │ ├── precision_fixed_recall.py │ ├── precision_recall.py │ ├── precision_recall_curve.py │ ├── ranking.py │ ├── recall_fixed_precision.py │ ├── roc.py │ ├── sensitivity_specificity.py │ ├── specificity.py │ ├── specificity_sensitivity.py │ └── stat_scores.py │ ├── clustering │ ├── __init__.py │ ├── adjusted_mutual_info_score.py │ ├── adjusted_rand_score.py │ ├── calinski_harabasz_score.py │ ├── cluster_accuracy.py │ ├── davies_bouldin_score.py │ ├── dunn_index.py │ ├── fowlkes_mallows_index.py │ ├── homogeneity_completeness_v_measure.py │ ├── mutual_info_score.py │ ├── normalized_mutual_info_score.py │ └── rand_score.py │ ├── collections.py │ ├── detection │ ├── __init__.py │ ├── _deprecated.py │ ├── _mean_ap.py │ ├── ciou.py │ ├── diou.py │ ├── giou.py │ ├── helpers.py │ ├── iou.py │ ├── mean_ap.py │ └── panoptic_qualities.py │ ├── functional │ ├── __init__.py │ ├── audio │ │ ├── __init__.py │ │ ├── _deprecated.py │ │ ├── dnsmos.py │ │ ├── nisqa.py │ │ ├── pesq.py │ │ ├── pit.py │ │ ├── sdr.py │ │ ├── snr.py │ │ ├── srmr.py │ │ └── stoi.py │ ├── classification │ │ ├── __init__.py │ │ ├── accuracy.py │ │ ├── auroc.py │ │ ├── average_precision.py │ │ ├── calibration_error.py │ │ ├── cohen_kappa.py │ │ ├── confusion_matrix.py │ │ ├── eer.py │ │ ├── exact_match.py │ │ ├── f_beta.py │ │ ├── group_fairness.py │ │ ├── hamming.py │ │ ├── hinge.py │ │ ├── jaccard.py │ │ ├── logauc.py │ │ ├── matthews_corrcoef.py │ │ ├── negative_predictive_value.py │ │ ├── precision_fixed_recall.py │ │ ├── precision_recall.py │ │ ├── precision_recall_curve.py │ │ ├── ranking.py │ │ ├── recall_fixed_precision.py │ │ ├── roc.py │ │ ├── sensitivity_specificity.py │ │ ├── specificity.py │ │ ├── specificity_sensitivity.py │ │ └── stat_scores.py │ ├── clustering │ │ ├── __init__.py │ │ ├── adjusted_mutual_info_score.py │ │ ├── adjusted_rand_score.py │ │ ├── calinski_harabasz_score.py │ │ ├── cluster_accuracy.py │ │ ├── davies_bouldin_score.py │ │ ├── dunn_index.py │ │ ├── fowlkes_mallows_index.py │ │ ├── homogeneity_completeness_v_measure.py │ │ ├── mutual_info_score.py │ │ ├── normalized_mutual_info_score.py │ │ ├── rand_score.py │ │ └── utils.py │ ├── detection │ │ ├── __init__.py │ │ ├── _deprecated.py │ │ ├── _panoptic_quality_common.py │ │ ├── ciou.py │ │ ├── diou.py │ │ ├── giou.py │ │ ├── iou.py │ │ ├── map.py │ │ └── panoptic_qualities.py │ ├── image │ │ ├── __init__.py │ │ ├── _deprecated.py │ │ ├── arniqa.py │ │ ├── d_lambda.py │ │ ├── d_s.py │ │ ├── dists.py │ │ ├── dists_models │ │ │ └── weights.pt │ │ ├── ergas.py │ │ ├── gradients.py │ │ ├── lpips.py │ │ ├── lpips_models │ │ │ ├── alex.pth │ │ │ ├── squeeze.pth │ │ │ └── vgg.pth │ │ ├── perceptual_path_length.py │ │ ├── psnr.py │ │ ├── psnrb.py │ │ ├── qnr.py │ │ ├── rase.py │ │ ├── rmse_sw.py │ │ ├── sam.py │ │ ├── scc.py │ │ ├── ssim.py │ │ ├── tv.py │ │ ├── uqi.py │ │ ├── utils.py │ │ └── vif.py │ ├── multimodal │ │ ├── __init__.py │ │ ├── clip_iqa.py │ │ ├── clip_score.py │ │ └── lve.py │ ├── nominal │ │ ├── __init__.py │ │ ├── cramers.py │ │ ├── fleiss_kappa.py │ │ ├── pearson.py │ │ ├── theils_u.py │ │ ├── tschuprows.py │ │ └── utils.py │ ├── pairwise │ │ ├── __init__.py │ │ ├── cosine.py │ │ ├── euclidean.py │ │ ├── helpers.py │ │ ├── linear.py │ │ ├── manhattan.py │ │ └── minkowski.py │ ├── regression │ │ ├── __init__.py │ │ ├── concordance.py │ │ ├── cosine_similarity.py │ │ ├── crps.py │ │ ├── csi.py │ │ ├── explained_variance.py │ │ ├── js_divergence.py │ │ ├── kendall.py │ │ ├── kl_divergence.py │ │ ├── log_cosh.py │ │ ├── log_mse.py │ │ ├── mae.py │ │ ├── mape.py │ │ ├── minkowski.py │ │ ├── mse.py │ │ ├── nrmse.py │ │ ├── pearson.py │ │ ├── r2.py │ │ ├── rse.py │ │ ├── spearman.py │ │ ├── symmetric_mape.py │ │ ├── tweedie_deviance.py │ │ ├── utils.py │ │ └── wmape.py │ ├── retrieval │ │ ├── __init__.py │ │ ├── _deprecated.py │ │ ├── auroc.py │ │ ├── average_precision.py │ │ ├── fall_out.py │ │ ├── hit_rate.py │ │ ├── ndcg.py │ │ ├── precision.py │ │ ├── precision_recall_curve.py │ │ ├── r_precision.py │ │ ├── recall.py │ │ └── reciprocal_rank.py │ ├── segmentation │ │ ├── __init__.py │ │ ├── dice.py │ │ ├── generalized_dice.py │ │ ├── hausdorff_distance.py │ │ ├── mean_iou.py │ │ └── utils.py │ ├── shape │ │ ├── __init__.py │ │ └── procrustes.py │ └── text │ │ ├── __init__.py │ │ ├── _deprecated.py │ │ ├── bert.py │ │ ├── bleu.py │ │ ├── cer.py │ │ ├── chrf.py │ │ ├── edit.py │ │ ├── eed.py │ │ ├── helper.py │ │ ├── helper_embedding_metric.py │ │ ├── infolm.py │ │ ├── mer.py │ │ ├── perplexity.py │ │ ├── rouge.py │ │ ├── sacre_bleu.py │ │ ├── squad.py │ │ ├── ter.py │ │ ├── wer.py │ │ ├── wil.py │ │ └── wip.py │ ├── image │ ├── __init__.py │ ├── _deprecated.py │ ├── arniqa.py │ ├── d_lambda.py │ ├── d_s.py │ ├── dists.py │ ├── ergas.py │ ├── fid.py │ ├── inception.py │ ├── kid.py │ ├── lpip.py │ ├── mifid.py │ ├── perceptual_path_length.py │ ├── psnr.py │ ├── psnrb.py │ ├── qnr.py │ ├── rase.py │ ├── rmse_sw.py │ ├── sam.py │ ├── scc.py │ ├── ssim.py │ ├── tv.py │ ├── uqi.py │ └── vif.py │ ├── metric.py │ ├── multimodal │ ├── __init__.py │ ├── clip_iqa.py │ ├── clip_score.py │ └── lve.py │ ├── nominal │ ├── __init__.py │ ├── cramers.py │ ├── fleiss_kappa.py │ ├── pearson.py │ ├── theils_u.py │ └── tschuprows.py │ ├── py.typed │ ├── regression │ ├── __init__.py │ ├── concordance.py │ ├── cosine_similarity.py │ ├── crps.py │ ├── csi.py │ ├── explained_variance.py │ ├── js_divergence.py │ ├── kendall.py │ ├── kl_divergence.py │ ├── log_cosh.py │ ├── log_mse.py │ ├── mae.py │ ├── mape.py │ ├── minkowski.py │ ├── mse.py │ ├── nrmse.py │ ├── pearson.py │ ├── r2.py │ ├── rse.py │ ├── spearman.py │ ├── symmetric_mape.py │ ├── tweedie_deviance.py │ └── wmape.py │ ├── retrieval │ ├── __init__.py │ ├── _deprecated.py │ ├── auroc.py │ ├── average_precision.py │ ├── base.py │ ├── fall_out.py │ ├── hit_rate.py │ ├── ndcg.py │ ├── precision.py │ ├── precision_recall_curve.py │ ├── r_precision.py │ ├── recall.py │ └── reciprocal_rank.py │ ├── segmentation │ ├── __init__.py │ ├── dice.py │ ├── generalized_dice.py │ ├── hausdorff_distance.py │ └── mean_iou.py │ ├── shape │ ├── __init__.py │ └── procrustes.py │ ├── text │ ├── __init__.py │ ├── _deprecated.py │ ├── bert.py │ ├── bleu.py │ ├── cer.py │ ├── chrf.py │ ├── edit.py │ ├── eed.py │ ├── infolm.py │ ├── mer.py │ ├── perplexity.py │ ├── rouge.py │ ├── sacre_bleu.py │ ├── squad.py │ ├── ter.py │ ├── wer.py │ ├── wil.py │ └── wip.py │ ├── utilities │ ├── __init__.py │ ├── checks.py │ ├── compute.py │ ├── data.py │ ├── distributed.py │ ├── enums.py │ ├── exceptions.py │ ├── imports.py │ ├── plot.py │ └── prints.py │ └── wrappers │ ├── __init__.py │ ├── abstract.py │ ├── bootstrapping.py │ ├── classwise.py │ ├── feature_share.py │ ├── minmax.py │ ├── multioutput.py │ ├── multitask.py │ ├── running.py │ ├── tracker.py │ └── transformations.py └── tests ├── README.md ├── integrations ├── __init__.py ├── conftest.py ├── lightning │ ├── __init__.py │ └── boring_model.py └── test_lightning.py └── unittests ├── __init__.py ├── _helpers ├── __init__.py ├── testers.py └── wrappers.py ├── audio ├── __init__.py ├── test_c_si_snr.py ├── test_dnsmos.py ├── test_nisqa.py ├── test_pesq.py ├── test_pit.py ├── test_sa_sdr.py ├── test_sdr.py ├── test_si_sdr.py ├── test_si_snr.py ├── test_snr.py ├── test_srmr.py └── test_stoi.py ├── bases ├── __init__.py ├── test_aggregation.py ├── test_collections.py ├── test_composition.py ├── test_ddp.py ├── test_hashing.py ├── test_metric.py └── test_saving_loading.py ├── classification ├── __init__.py ├── _inputs.py ├── test_accuracy.py ├── test_auc.py ├── test_auroc.py ├── test_average_precision.py ├── test_calibration_error.py ├── test_cohen_kappa.py ├── test_confusion_matrix.py ├── test_eer.py ├── test_exact_match.py ├── test_f_beta.py ├── test_group_fairness.py ├── test_hamming_distance.py ├── test_hinge.py ├── test_jaccard.py ├── test_logauc.py ├── test_matthews_corrcoef.py ├── test_negative_predictive_value.py ├── test_precision_fixed_recall.py ├── test_precision_recall.py ├── test_precision_recall_curve.py ├── test_ranking.py ├── test_recall_fixed_precision.py ├── test_roc.py ├── test_sensitivity_specificity.py ├── test_specificity.py ├── test_specificity_sensitivity.py └── test_stat_scores.py ├── clustering ├── __init__.py ├── _inputs.py ├── test_adjusted_mutual_info_score.py ├── test_adjusted_rand_score.py ├── test_calinski_harabasz_score.py ├── test_cluster_accuracy.py ├── test_davies_bouldin_score.py ├── test_dunn_index.py ├── test_fowlkes_mallows_index.py ├── test_homogeneity_completeness_v_measure.py ├── test_mutual_info_score.py ├── test_normalized_mutual_info_score.py ├── test_rand_score.py └── test_utils.py ├── conftest.py ├── deprecations ├── __init__.py └── root_class_imports.py ├── detection ├── __init__.py ├── test_intersection.py ├── test_map.py ├── test_modified_panoptic_quality.py └── test_panoptic_quality.py ├── image ├── __init__.py ├── test_arniqa.py ├── test_csi.py ├── test_d_lambda.py ├── test_d_s.py ├── test_dists.py ├── test_ergas.py ├── test_fid.py ├── test_image_gradients.py ├── test_inception.py ├── test_kid.py ├── test_lpips.py ├── test_mifid.py ├── test_ms_ssim.py ├── test_perceptual_path_length.py ├── test_psnr.py ├── test_psnrb.py ├── test_qnr.py ├── test_rase.py ├── test_rmse_sw.py ├── test_sam.py ├── test_scc.py ├── test_ssim.py ├── test_tv.py ├── test_uqi.py └── test_vif.py ├── multimodal ├── __init__.py ├── test_clip_iqa.py ├── test_clip_score.py └── test_lve.py ├── nominal ├── __init__.py ├── test_cramers.py ├── test_fleiss_kappa.py ├── test_pearson.py ├── test_theils_u.py └── test_tschuprows.py ├── pairwise ├── __init__.py └── test_pairwise_distance.py ├── regression ├── __init__.py ├── test_concordance.py ├── test_cosine_similarity.py ├── test_crps.py ├── test_explained_variance.py ├── test_js_divergence.py ├── test_kendall.py ├── test_kl_divergence.py ├── test_log_cosh_error.py ├── test_mean_error.py ├── test_minkowski_distance.py ├── test_pearson.py ├── test_r2.py ├── test_rse.py ├── test_spearman.py └── test_tweedie_deviance.py ├── retrieval ├── __init__.py ├── _inputs.py ├── helpers.py ├── test_auroc.py ├── test_fallout.py ├── test_hit_rate.py ├── test_map.py ├── test_mrr.py ├── test_ndcg.py ├── test_precision.py ├── test_precision_recall_curve.py ├── test_r_precision.py └── test_recall.py ├── segmentation ├── __init__.py ├── inputs.py ├── test_dice.py ├── test_generalized_dice_score.py ├── test_hausdorff_distance.py ├── test_mean_iou.py └── test_utils.py ├── shape ├── __init__.py └── test_procrustes.py ├── text ├── __init__.py ├── _helpers.py ├── _inputs.py ├── test_bertscore.py ├── test_bleu.py ├── test_cer.py ├── test_chrf.py ├── test_edit.py ├── test_eed.py ├── test_infolm.py ├── test_mer.py ├── test_perplexity.py ├── test_rouge.py ├── test_sacre_bleu.py ├── test_squad.py ├── test_ter.py ├── test_wer.py ├── test_wil.py └── test_wip.py ├── utilities ├── test_plot.py └── test_utilities.py └── wrappers ├── __init__.py ├── test_bootstrapping.py ├── test_classwise.py ├── test_feature_share.py ├── test_minmax.py ├── test_multioutput.py ├── test_multitask.py ├── test_running.py ├── test_tracker.py └── test_transformations.py /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This is a comment. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # These owners will be the default owners for everything in 5 | # the repo. Unless a later match takes precedence, 6 | # @global-owner1 and @global-owner2 will be requested for 7 | # review when someone opens a pull request. 8 | * @SkafteNicki @borda @justusschock 9 | 10 | # owners 11 | /.github/CODEOWNERS @williamFalcon @lantiga 12 | # main 13 | /README.md @borda @SkafteNicki @lantiga 14 | # installation 15 | /setup.py @borda @SkafteNicki @justusschock 16 | 17 | # Base API 18 | /src/torchmetrics/metric.py @SkafteNicki @justusschock @borda @lantiga 19 | /src/torchmetrics/collections.py @SkafteNicki @justusschock @borda 20 | 21 | # CI/CD 22 | /.github/workflows/ @borda @justusschock @ethanwharris 23 | # configs in root 24 | /*.yml @borda @justusschock @ethanwharris 25 | 26 | # Docs 27 | /docs/ @lantiga @SkafteNicki @borda 28 | /.github/*.md @lantiga @SkafteNicki @borda 29 | /.github/ISSUE_TEMPLATE/*.md @lantiga @borda @SkafteNicki 30 | /docs/source/conf.py @borda @awaelchli @justusschock 31 | /docs/paper_JOSS/ @SkafteNicki @borda @justusschock @williamFalcon 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug / fix, help wanted 6 | assignees: '' 7 | --- 8 | 9 | ## 🐛 Bug 10 | 11 | 12 | 13 | ### To Reproduce 14 | 15 | Sample code and steps to reproduce the behavior with expected result... 16 | 17 | 24 | 25 |
26 | Code sample 27 | 28 | ```python 29 | # Ideally attach a minimal code sample to reproduce the decried issue. 30 | # Minimal means having the shortest code but still preserving the bug. 31 | ``` 32 | 33 |
34 | 35 |
36 | Environment 37 | 38 | - TorchMetrics version (if build from source, add commit SHA): ??? 39 | - Python & PyTorch Version (e.g., 1.0): ??? 40 | - Any other relevant information such as OS (e.g., Linux): ??? 41 | 42 |
43 | 44 | ### Additional context 45 | 46 | 47 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Ask a Question 4 | url: https://github.com/Lightning-AI/torchmetrics/discussions/new 5 | about: Ask and answer TorchMetrics related questions 6 | - name: 💬 Chat with us 7 | url: https://discord.gg/VptPCZkGNa 8 | about: Live chat with experts, engineers, and users in our Discord community. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Typos and doc fixes 3 | about: Typos and doc fixes 4 | title: '' 5 | labels: documentation 6 | assignees: '' 7 | --- 8 | 9 | ## 📚 Documentation 10 | 11 | For typos and doc fixes, please go ahead and: 12 | 13 | - For a simple typo or fix, please send directly a PR (no need to create an issue) 14 | - If you are not sure about the proper solution, please describe here your finding... 15 | 16 | Thanks! 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | --- 8 | 9 | ## 🚀 Feature 10 | 11 | 12 | 13 | ### Motivation 14 | 15 | 16 | 17 | ### Pitch 18 | 19 | 20 | 21 | ### Alternatives 22 | 23 | 24 | 25 | ### Additional context 26 | 27 | 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## What does this PR do? 2 | 3 | Fixes #\ 4 | 5 |
6 | Before submitting 7 | 8 | - [ ] Was this **discussed/agreed** via a Github issue? (no need for typos and docs improvements) 9 | - [ ] Did you read the [contributor guideline](https://github.com/Lightning-AI/torchmetrics/blob/master/.github/CONTRIBUTING.md), Pull Request section? 10 | - [ ] Did you make sure to **update the docs**? 11 | - [ ] Did you write any new **necessary tests**? 12 | 13 |
14 | 15 |
16 | PR review 17 | 18 | Anyone in the community is free to review the PR once the tests have passed. 19 | If we didn't discuss your PR in Github issues there's a high chance it will not be merged. 20 | 21 |
22 | 23 | ## Did you have fun? 24 | 25 | Make sure you had fun coding 🙃 26 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Basic dependabot.yml file with 2 | # minimum configuration for two package managers 3 | 4 | version: 2 5 | updates: 6 | # Enable version updates for python 7 | - package-ecosystem: "pip" 8 | # Look for a `requirements` in the `root` directory 9 | directory: "/requirements" 10 | # Check for updates once a week 11 | schedule: 12 | interval: "weekly" 13 | # Labels on pull requests for version updates only 14 | labels: ["test / CI"] 15 | pull-request-branch-name: 16 | # Separate sections of the branch name with a hyphen 17 | # for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1` 18 | separator: "-" 19 | # Allow up to 5 open pull requests for pip dependencies 20 | open-pull-requests-limit: 5 21 | 22 | # Enable version updates for GitHub Actions 23 | - package-ecosystem: "github-actions" 24 | directory: "/" 25 | # Check for updates once a week 26 | schedule: 27 | interval: "monthly" 28 | # Labels on pull requests for version updates only 29 | labels: ["test / CI"] 30 | pull-request-branch-name: 31 | # Separate sections of the branch name with a hyphen 32 | # for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1` 33 | separator: "-" 34 | # Allow up to 5 open pull requests for GitHub Actions 35 | open-pull-requests-limit: 5 36 | -------------------------------------------------------------------------------- /.github/markdown-links-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": [ 3 | { 4 | "pattern": "^https://github.com/Lightning-AI/torchmetrics/pull/.*" 5 | }, 6 | { 7 | "pattern": ".*https://dev.azure.com/Lightning-AI/Metrics/_apis/build/status.*" 8 | } 9 | ], 10 | "httpHeaders": [ 11 | { 12 | "urls": [ 13 | "https://github.com/", 14 | "https://guides.github.com/", 15 | "https://help.github.com/", 16 | "https://docs.github.com/" 17 | ], 18 | "headers": { 19 | "Accept-Encoding": "zstd, br, gzip, deflate" 20 | } 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # https://github.com/marketplace/stale 2 | 3 | # Number of days of inactivity before an issue becomes stale 4 | daysUntilStale: 60 5 | # Number of days of inactivity before a stale issue is closed 6 | daysUntilClose: 9 7 | # Issues with these labels will never be considered stale 8 | exemptLabels: 9 | - pinned 10 | - security 11 | # Label to use when marking an issue as stale 12 | staleLabel: wontfix 13 | # Comment to post when marking an issue as stale. Set to `false` to disable 14 | markComment: > 15 | This issue has been automatically marked as stale because it has not had 16 | recent activity. It will be closed if no further activity occurs. Thank you 17 | for your contributions. 18 | # Comment to post when closing a stale issue. Set to `false` to disable 19 | closeComment: false 20 | 21 | # Set to true to ignore issues in a project (defaults to false) 22 | exemptProjects: true 23 | # Set to true to ignore issues in a milestone (defaults to false) 24 | exemptMilestones: true 25 | # Set to true to ignore issues with an assignee (defaults to false) 26 | exemptAssignees: true 27 | -------------------------------------------------------------------------------- /.github/workflows/_focus-diff.yml: -------------------------------------------------------------------------------- 1 | name: Evaluate diff 2 | 3 | on: 4 | workflow_call: 5 | # Map the workflow outputs to job outputs 6 | outputs: 7 | test-dirs: 8 | description: "Test folders" 9 | value: ${{ jobs.eval-diff.outputs.focus }} 10 | 11 | jobs: 12 | eval-diff: 13 | runs-on: ubuntu-latest 14 | timeout-minutes: 5 15 | # Map the job outputs to step outputs 16 | outputs: 17 | focus: ${{ steps.diff-domains.outputs.focus }} 18 | steps: 19 | - uses: actions/checkout@v4 20 | - uses: actions/setup-python@v5 21 | 22 | - name: Get PR diff 23 | id: diff-domains 24 | env: 25 | PR_NUMBER: "${{ github.event.pull_request.number }}" 26 | run: | 27 | set -e 28 | echo $PR_NUMBER 29 | pip install -q -U packaging fire pyGithub pyopenssl 30 | echo "focus=$(python .github/assistant.py changed-domains $PR_NUMBER)" >> $GITHUB_OUTPUT 31 | 32 | - run: echo "${{ steps.diff-domains.outputs.focus }}" 33 | -------------------------------------------------------------------------------- /.github/workflows/ci-checks.yml: -------------------------------------------------------------------------------- 1 | name: General checks 2 | 3 | on: 4 | push: 5 | branches: [master, "release/*"] 6 | pull_request: 7 | branches: [master, "release/*"] 8 | types: [opened, reopened, ready_for_review, synchronize] 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} 12 | cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }} 13 | 14 | jobs: 15 | check-code: 16 | uses: Lightning-AI/utilities/.github/workflows/check-typing.yml@v0.14.3 17 | with: 18 | actions-ref: v0.14.3 19 | extra-typing: "typing" 20 | 21 | check-schema: 22 | uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.14.3 23 | with: 24 | actions-ref: v0.14.3 25 | azure-schema-version: "v1.208.0" 26 | 27 | check-package: 28 | if: github.event.pull_request.draft == false 29 | uses: Lightning-AI/utilities/.github/workflows/check-package.yml@v0.14.3 30 | with: 31 | actions-ref: v0.14.3 32 | artifact-name: dist-packages-${{ github.sha }} 33 | import-name: "torchmetrics" 34 | testing-matrix: | 35 | { 36 | "os": ["ubuntu-22.04", "macos-13", "windows-2022"], 37 | "python-version": ["3.9", "3.11"] 38 | } 39 | 40 | check-md-links: 41 | uses: Lightning-AI/utilities/.github/workflows/check-md-links.yml@v0.14.3 42 | with: 43 | base-branch: master 44 | config-file: ".github/markdown-links-config.json" 45 | -------------------------------------------------------------------------------- /.github/workflows/ci-rtfd.yml: -------------------------------------------------------------------------------- 1 | name: RTFD Preview 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | 7 | permissions: 8 | pull-requests: write 9 | 10 | jobs: 11 | documentation-links: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: readthedocs/actions/preview@v1 15 | with: 16 | project-slug: "torchmetrics" 17 | -------------------------------------------------------------------------------- /.github/workflows/clear-cache.yml: -------------------------------------------------------------------------------- 1 | name: Clear cache ... 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - ".github/workflows/clear-cache.yml" 7 | workflow_dispatch: 8 | inputs: 9 | pattern: 10 | description: "pattern for cleaning cache" 11 | default: "pip-|conda" 12 | required: false 13 | type: string 14 | age-days: 15 | description: "setting the age of caches in days to be dropped" 16 | required: true 17 | type: number 18 | default: 5 19 | schedule: 20 | # on Sundays 21 | - cron: "0 0 * * 0" 22 | 23 | jobs: 24 | cron-clear: 25 | if: github.event_name == 'schedule' || github.event_name == 'pull_request' 26 | uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.14.3 27 | with: 28 | scripts-ref: v0.14.3 29 | dry-run: ${{ github.event_name == 'pull_request' }} 30 | pattern: "pip-latest" 31 | age-days: 7 32 | 33 | direct-clear: 34 | if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' 35 | uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.14.3 36 | with: 37 | scripts-ref: v0.14.3 38 | dry-run: ${{ github.event_name == 'pull_request' }} 39 | pattern: ${{ inputs.pattern || 'pypi_wheels' }} # setting str in case of PR / debugging 40 | age-days: ${{ fromJSON(inputs.age-days) || 0 }} # setting 0 in case of PR / debugging 41 | -------------------------------------------------------------------------------- /.github/workflows/cmd-help.yml: -------------------------------------------------------------------------------- 1 | name: /help command 2 | on: 3 | repository_dispatch: 4 | types: [help-command] 5 | 6 | jobs: 7 | help: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Update with comment 11 | uses: peter-evans/create-or-update-comment@v4.0.0 12 | with: 13 | token: ${{ secrets.PAT_GHOST }} 14 | reaction-token: ${{ secrets.PAT_GHOST }} 15 | repository: ${{ github.event.client_payload.github.payload.repository.full_name }} 16 | comment-id: ${{ github.event.client_payload.github.payload.comment.id }} 17 | body: | 18 | > Slash command help (added by @pl-ghost bot) 19 | > 20 | > Command | Description 21 | > --- | --- 22 | > /rebase | Rebase the pull request on top of the current master. 23 | > /help | Print out this help message 24 | reaction-type: hooray 25 | -------------------------------------------------------------------------------- /.github/workflows/greetings.yml: -------------------------------------------------------------------------------- 1 | name: Greetings 2 | # https://github.com/marketplace/actions/first-interaction 3 | 4 | on: [issues] # pull_request 5 | 6 | jobs: 7 | greeting: 8 | runs-on: ubuntu-22.04 9 | steps: 10 | - uses: actions/first-interaction@v1 11 | with: 12 | repo-token: ${{ secrets.GITHUB_TOKEN }} 13 | issue-message: "Hi! Thanks for your contribution! Great first issue!" 14 | pr-message: "Hey thanks for the input! Please give us a bit of time to review it!" 15 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: "Pull Request Labeler" 2 | on: [pull_request_target] 3 | 4 | jobs: 5 | triage-prs: 6 | permissions: 7 | contents: read 8 | pull-requests: write 9 | runs-on: ubuntu-latest 10 | steps: 11 | # Uploads repository content to the runner 12 | - uses: actions/checkout@v4 13 | - uses: actions/labeler@v5 14 | with: 15 | # The path to the label configuration file. 16 | configuration-path: .github/labeling-config.yml 17 | # Whether removing labels when matching files are reverted or no longer changed by the PR 18 | sync-labels: true 19 | -------------------------------------------------------------------------------- /.github/workflows/slash-cmd-dispatch.yml: -------------------------------------------------------------------------------- 1 | name: Slash Command Dispatch 2 | on: 3 | issue_comment: 4 | types: [created] 5 | 6 | jobs: 7 | slash-command-dispatch: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Slash Command Dispatch 11 | uses: peter-evans/slash-command-dispatch@v4.0.0 12 | with: 13 | token: ${{ secrets.PAT_GHOST }} 14 | reaction-token: ${{ secrets.PAT_GHOST }} 15 | # these commands belo need to be listed in particular workflows under: 16 | # on: 17 | # repository_dispatch: 18 | # types: [-command, ...] 19 | # NOTE: when added new command pls update also help 20 | commands: | 21 | rebase 22 | help 23 | # permission field sets the repository permission level required by the user to dispatch commands. 24 | # It expects one of the five repository permission levels, or none. From the least to greatest 25 | # permission level they are none, read, triage, write, maintain and admin. 26 | permission: write 27 | # The issue type required for commands. (issue, pull-request, both) 28 | issue-type: pull-request 29 | reactions: true 30 | allow-edits: false 31 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # Manifest syntax https://packaging.python.org/en/latest/guides/using-manifest-in/ 2 | graft wheelhouse 3 | 4 | recursive-exclude __pycache__ *.py[cod] *.orig 5 | # include also models 6 | recursive-include src *.pth *.pt 7 | 8 | # Include the README and CHANGELOG 9 | include *.md 10 | recursive-include src *.md 11 | 12 | # Include the license file 13 | include LICENSE 14 | 15 | # Include Citation file 16 | include *.cff 17 | 18 | # Include marker file for PEP 561 19 | recursive-include src *.typed 20 | 21 | exclude *.sh 22 | exclude *.toml 23 | exclude *.svg 24 | 25 | # exclude tests from package 26 | recursive-exclude tests * 27 | recursive-exclude site * 28 | exclude tests 29 | 30 | # Exclude the documentation files 31 | recursive-exclude docs * 32 | exclude docs 33 | 34 | # Include the Requirements 35 | include requirements.txt 36 | recursive-include requirements *.txt 37 | recursive-exclude requirements *.py 38 | 39 | # Exclude build configs 40 | exclude *.yml 41 | exclude *.yaml 42 | exclude Makefile 43 | 44 | prune .devcontainer 45 | prune .git 46 | prune .github 47 | prune examples* 48 | prune temp* 49 | prune test* 50 | prune SandBox* 51 | -------------------------------------------------------------------------------- /dockers/README.md: -------------------------------------------------------------------------------- 1 | # Docker images 2 | 3 | ## Build images from Dockerfiles 4 | 5 | You can build it on your own, note it takes lots of time, be prepared. 6 | 7 | ```bash 8 | git clone https://github.com/Lightning-AI/torchmetrics.git 9 | 10 | # build with the default arguments 11 | docker image build -t torchmetrics:latest -f dockers/ubuntu-cuda/Dockerfile . 12 | 13 | # build with specific arguments 14 | docker image build -t torchmetrics:ubuntu-cuda11.7.1-py3.9-torch1.13 \ 15 | -f dockers/base-cuda/Dockerfile \ 16 | --build-arg PYTHON_VERSION=3.9 \ 17 | --build-arg PYTORCH_VERSION=1.13 \ 18 | --build-arg CUDA_VERSION=11.7.1 \ 19 | . 20 | ``` 21 | 22 | To run your docker use 23 | 24 | ```bash 25 | docker image list 26 | docker run --rm -it torchmetrics:latest bash 27 | ``` 28 | 29 | and if you do not need it anymore, just clean it: 30 | 31 | ```bash 32 | docker image list 33 | docker image rm torchmetrics:latest 34 | ``` 35 | 36 | ## Run docker image with GPUs 37 | 38 | To run docker image with access to your GPUs, you need to install 39 | 40 | ```bash 41 | # Add the package repositories 42 | distribution=$(. /etc/os-release;echo $ID$VERSION_ID) 43 | curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - 44 | curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list 45 | 46 | sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit 47 | sudo systemctl restart docker 48 | ``` 49 | 50 | and later run the docker image with `--gpus all`. For example, 51 | 52 | ```bash 53 | docker run --rm -it --gpus all torchmetrics:ubuntu-cuda11.7.1-py3.9-torch1.12 54 | ``` 55 | -------------------------------------------------------------------------------- /docs/.build_docs.sh: -------------------------------------------------------------------------------- 1 | make clean 2 | make html --debug --jobs "$(nproc)" 3 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = -W 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = source 8 | BUILDDIR = build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 20 | 21 | livehtml: 22 | sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 23 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/redirect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

You will be redirected to TorchMetrics docs.

8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/rtfd-build.sh: -------------------------------------------------------------------------------- 1 | # building for PRs and skip stable and latest states 2 | 3 | export SPHINX_ENABLE_GALLERY=0 4 | 5 | if ! [ $READTHEDOCS_VERSION == "latest" -o $READTHEDOCS_VERSION == "stable" ]; 6 | then 7 | cd ./docs ; 8 | export SPHINX_FETCH_ASSETS=0 ; 9 | make html --jobs $(nproc) ; 10 | ls -lh build 11 | else 12 | echo "Void build... :-]" ; 13 | mkdir -p ./docs/build/html 14 | cp ./docs/redirect.html ./docs/build/html/index.html 15 | fi 16 | -------------------------------------------------------------------------------- /docs/source/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | .sphx-glr-thumbcontainer { 2 | min-height: 90% !important; 3 | min-width: 90% !important; 4 | } 5 | -------------------------------------------------------------------------------- /docs/source/_static/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/docs/source/_static/images/icon.png -------------------------------------------------------------------------------- /docs/source/_static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/docs/source/_static/images/logo.png -------------------------------------------------------------------------------- /docs/source/_static/images/plot_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/docs/source/_static/images/plot_example.png -------------------------------------------------------------------------------- /docs/source/_templates/autosummary/module.rst: -------------------------------------------------------------------------------- 1 | {{ name | escape | underline }} 2 | 3 | .. currentmodule:: {{ fullname }} 4 | 5 | {% block functions %} 6 | {% if functions %} 7 | .. rubric:: Functions 8 | 9 | .. autosummary:: 10 | :nosignatures: 11 | {% for item in functions %} 12 | {{ item }} 13 | {%- endfor %} 14 | {% endif %} 15 | {% endblock %} 16 | 17 | {% block classes %} 18 | {% if classes %} 19 | .. rubric:: Classes 20 | 21 | .. autosummary:: 22 | :nosignatures: 23 | {% for item in classes %} 24 | {{ item }} 25 | {%- endfor %} 26 | {% endif %} 27 | {% endblock %} 28 | 29 | {% block exceptions %} 30 | {% if exceptions %} 31 | .. rubric:: Exceptions 32 | 33 | .. autosummary:: 34 | :nosignatures: 35 | {% for item in exceptions %} 36 | {{ item }} 37 | {%- endfor %} 38 | {% endif %} 39 | {% endblock %} 40 | 41 | .. automodule:: {{ fullname }} 42 | -------------------------------------------------------------------------------- /docs/source/_templates/classtemplate.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | .. currentmodule:: {{ module }} 4 | 5 | 6 | {{ name | underline}} 7 | 8 | .. autoclass:: {{ name }} 9 | :members: 10 | 11 | 12 | .. 13 | autogenerated from source/_templates/classtemplate.rst 14 | note it does not have :inherited-members: 15 | -------------------------------------------------------------------------------- /docs/source/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | 4 | {% block footer %} {{ super() }} 5 | 21 | 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /docs/source/_templates/theme_variables.jinja: -------------------------------------------------------------------------------- 1 | {%- set external_urls = { 2 | 'github': 'https://github.com/Lightning-AI/torchmetrics', 3 | 'github_issues': 'https://github.com/Lightning-AI/torchmetrics/issues', 4 | 'contributing': 'https://github.com/Lightning-AI/torchmetrics/blob/master/.github/CONTRIBUTING.md', 5 | 'docs': 'https://lightning.ai/docs/torchmetrics/latest', 6 | 'twitter': 'https://twitter.com/PyTorchLightnin', 7 | 'discuss': 'https://pytorch-lightning.slack.com', 8 | 'previous_pytorch_versions': 'https://torchmetrics.rtfd.io/en/latest/', 9 | 'home': 'https://torchmetrics.rtfd.io/en/latest/', 10 | 'get_started': 'https://lightning.ai/docs/torchmetrics/latest/pages/quickstart.html', 11 | 'blog': 'https://www.pytorchlightning.ai/blog', 12 | 'support': 'https://github.com/Lightning-AI/torchmetrics/issues', 13 | 'community': 'https://pytorch-lightning.slack.com', 14 | 'forums': 'https://pytorch-lightning.slack.com', 15 | } 16 | -%} 17 | -------------------------------------------------------------------------------- /docs/source/aggregation/cat.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Concatenation 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Aggregation 5 | 6 | .. include:: ../links.rst 7 | 8 | ############# 9 | Concatenation 10 | ############# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.aggregation.CatMetric 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/aggregation/max.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Maximum 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Aggregation 5 | 6 | .. include:: ../links.rst 7 | 8 | ####### 9 | Maximum 10 | ####### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.aggregation.MaxMetric 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/aggregation/mean.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Aggregation 5 | 6 | .. include:: ../links.rst 7 | 8 | #### 9 | Mean 10 | #### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.aggregation.MeanMetric 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/aggregation/min.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Minimum 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Aggregation 5 | 6 | .. include:: ../links.rst 7 | 8 | ####### 9 | Minimum 10 | ####### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.aggregation.MinMetric 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/aggregation/running_mean.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Aggregation 5 | 6 | .. include:: ../links.rst 7 | 8 | ############ 9 | Running Mean 10 | ############ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.aggregation.RunningMean 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/aggregation/running_sum.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Sum 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Aggregation 5 | 6 | .. include:: ../links.rst 7 | 8 | ########### 9 | Running Sum 10 | ########### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.aggregation.RunningSum 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/aggregation/sum.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Sum 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Aggregation 5 | 6 | .. include:: ../links.rst 7 | 8 | ### 9 | Sum 10 | ### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.aggregation.SumMetric 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/all-metrics.rst: -------------------------------------------------------------------------------- 1 | .. this page is referring other pages with `customcarditem`; bypass hierarchy is patch with redirect 2 | 3 | All TorchMetrics 4 | ================ 5 | 6 | .. tutoriallist:: 7 | -------------------------------------------------------------------------------- /docs/source/audio/complex_scale_invariant_signal_noise_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Complex Scale-Invariant Signal-to-Noise Ratio (C-SI-SNR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################################################## 9 | Complex Scale-Invariant Signal-to-Noise Ratio (C-SI-SNR) 10 | ######################################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.ComplexScaleInvariantSignalNoiseRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.complex_scale_invariant_signal_noise_ratio 22 | -------------------------------------------------------------------------------- /docs/source/audio/deep_noise_suppression_mean_opinion_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Deep Noise Suppression Mean Opinion Score (DNSMOS) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################################## 9 | Deep Noise Suppression Mean Opinion Score (DNSMOS) 10 | ################################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.dnsmos.DeepNoiseSuppressionMeanOpinionScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.dnsmos.deep_noise_suppression_mean_opinion_score 22 | -------------------------------------------------------------------------------- /docs/source/audio/non_intrusive_speech_quality_assessment.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Non-Intrusive Speech Quality Assessment (NISQA v2.0) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | #################################################### 9 | Non-Intrusive Speech Quality Assessment (NISQA v2.0) 10 | #################################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.nisqa.NonIntrusiveSpeechQualityAssessment 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.nisqa.non_intrusive_speech_quality_assessment 22 | -------------------------------------------------------------------------------- /docs/source/audio/perceptual_evaluation_speech_quality.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Perceptual Evaluation of Speech Quality (PESQ) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################################## 9 | Perceptual Evaluation of Speech Quality (PESQ) 10 | ############################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.pesq.PerceptualEvaluationSpeechQuality 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.pesq.perceptual_evaluation_speech_quality 22 | -------------------------------------------------------------------------------- /docs/source/audio/permutation_invariant_training.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Permutation Invariant Training (PIT) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | #################################### 9 | Permutation Invariant Training (PIT) 10 | #################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.PermutationInvariantTraining 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.permutation_invariant_training 22 | -------------------------------------------------------------------------------- /docs/source/audio/scale_invariant_signal_distortion_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Scale-Invariant Signal-to-Distortion Ratio (SI-SDR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################################### 9 | Scale-Invariant Signal-to-Distortion Ratio (SI-SDR) 10 | ################################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.ScaleInvariantSignalDistortionRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.scale_invariant_signal_distortion_ratio 22 | -------------------------------------------------------------------------------- /docs/source/audio/scale_invariant_signal_noise_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Scale-Invariant Signal-to-Noise Ratio (SI-SNR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################################## 9 | Scale-Invariant Signal-to-Noise Ratio (SI-SNR) 10 | ############################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.ScaleInvariantSignalNoiseRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.scale_invariant_signal_noise_ratio 22 | -------------------------------------------------------------------------------- /docs/source/audio/short_time_objective_intelligibility.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Short-Time Objective Intelligibility (STOI) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ########################################### 9 | Short-Time Objective Intelligibility (STOI) 10 | ########################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.stoi.ShortTimeObjectiveIntelligibility 16 | 17 | Functional Interface 18 | ____________________ 19 | 20 | .. autofunction:: torchmetrics.functional.audio.stoi.short_time_objective_intelligibility 21 | -------------------------------------------------------------------------------- /docs/source/audio/signal_distortion_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Signal to Distortion Ratio (SDR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################ 9 | Signal to Distortion Ratio (SDR) 10 | ################################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.SignalDistortionRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.signal_distortion_ratio 22 | -------------------------------------------------------------------------------- /docs/source/audio/signal_noise_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Signal-to-Noise Ratio (SNR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ########################### 9 | Signal-to-Noise Ratio (SNR) 10 | ########################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.SignalNoiseRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.signal_noise_ratio 22 | -------------------------------------------------------------------------------- /docs/source/audio/source_aggregated_signal_distortion_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Source Aggregated Signal-to-Distortion Ratio (SA-SDR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ##################################################### 9 | Source Aggregated Signal-to-Distortion Ratio (SA-SDR) 10 | ##################################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.sdr.SourceAggregatedSignalDistortionRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.sdr.source_aggregated_signal_distortion_ratio 22 | -------------------------------------------------------------------------------- /docs/source/audio/speech_reverberation_modulation_energy_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Speech-to-Reverberation Modulation Energy Ratio (SRMR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg 4 | :tags: Audio 5 | 6 | .. include:: ../links.rst 7 | 8 | ###################################################### 9 | Speech-to-Reverberation Modulation Energy Ratio (SRMR) 10 | ###################################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.audio.srmr.SpeechReverberationModulationEnergyRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.audio.srmr.speech_reverberation_modulation_energy_ratio 22 | -------------------------------------------------------------------------------- /docs/source/classification/accuracy.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Accuracy 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ######## 9 | Accuracy 10 | ######## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.Accuracy 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryAccuracy 20 | ^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryAccuracy 23 | :exclude-members: update, compute 24 | 25 | MulticlassAccuracy 26 | ^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassAccuracy 29 | :exclude-members: update, compute 30 | 31 | MultilabelAccuracy 32 | ^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelAccuracy 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.classification.accuracy 41 | 42 | binary_accuracy 43 | ^^^^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_accuracy 46 | 47 | multiclass_accuracy 48 | ^^^^^^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_accuracy 51 | 52 | multilabel_accuracy 53 | ^^^^^^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_accuracy 56 | -------------------------------------------------------------------------------- /docs/source/classification/auroc.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Area Under the Receiver Operating Characteristic Curve (AUROC) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ##### 9 | AUROC 10 | ##### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.AUROC 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryAUROC 20 | ^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryAUROC 23 | :exclude-members: update, compute 24 | 25 | MulticlassAUROC 26 | ^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassAUROC 29 | :exclude-members: update, compute 30 | 31 | MultilabelAUROC 32 | ^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelAUROC 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.auroc 41 | 42 | binary_auroc 43 | ^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_auroc 46 | 47 | multiclass_auroc 48 | ^^^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_auroc 51 | 52 | multilabel_auroc 53 | ^^^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_auroc 56 | -------------------------------------------------------------------------------- /docs/source/classification/average_precision.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Average Precision 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ################# 9 | Average Precision 10 | ################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.AveragePrecision 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryAveragePrecision 20 | ^^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryAveragePrecision 23 | :exclude-members: update, compute 24 | 25 | MulticlassAveragePrecision 26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassAveragePrecision 29 | :exclude-members: update, compute 30 | 31 | MultilabelAveragePrecision 32 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelAveragePrecision 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.average_precision 41 | 42 | binary_average_precision 43 | ^^^^^^^^^^^^^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_average_precision 46 | 47 | multiclass_average_precision 48 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_average_precision 51 | 52 | multilabel_average_precision 53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_average_precision 56 | -------------------------------------------------------------------------------- /docs/source/classification/calibration_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Calibration Error 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ################# 9 | Calibration Error 10 | ################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.CalibrationError 16 | :noindex: 17 | :exclude-members: update, compute 18 | :special-members: __new__ 19 | 20 | BinaryCalibrationError 21 | ^^^^^^^^^^^^^^^^^^^^^^ 22 | 23 | .. autoclass:: torchmetrics.classification.BinaryCalibrationError 24 | :exclude-members: update, compute 25 | 26 | MulticlassCalibrationError 27 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 28 | 29 | .. autoclass:: torchmetrics.classification.MulticlassCalibrationError 30 | :exclude-members: update, compute 31 | 32 | Functional Interface 33 | ____________________ 34 | 35 | .. autofunction:: torchmetrics.functional.calibration_error 36 | 37 | binary_calibration_error 38 | ^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | .. autofunction:: torchmetrics.functional.classification.binary_calibration_error 41 | 42 | multiclass_calibration_error 43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.multiclass_calibration_error 46 | -------------------------------------------------------------------------------- /docs/source/classification/cohen_kappa.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Cohen Kappa 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ########### 9 | Cohen Kappa 10 | ########### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.CohenKappa 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryCohenKappa 20 | ^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryCohenKappa 23 | :exclude-members: update, compute 24 | 25 | MulticlassCohenKappa 26 | ^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassCohenKappa 29 | :exclude-members: update, compute 30 | 31 | Functional Interface 32 | ____________________ 33 | 34 | cohen_kappa 35 | ^^^^^^^^^^^ 36 | 37 | .. autofunction:: torchmetrics.functional.cohen_kappa 38 | 39 | binary_cohen_kappa 40 | ^^^^^^^^^^^^^^^^^^ 41 | 42 | .. autofunction:: torchmetrics.functional.classification.binary_cohen_kappa 43 | 44 | multiclass_cohen_kappa 45 | ^^^^^^^^^^^^^^^^^^^^^^ 46 | 47 | .. autofunction:: torchmetrics.functional.classification.multiclass_cohen_kappa 48 | -------------------------------------------------------------------------------- /docs/source/classification/confusion_matrix.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Confusion Matrix 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Confusion Matrix 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.ConfusionMatrix 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryConfusionMatrix 20 | ^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryConfusionMatrix 23 | :exclude-members: update, compute 24 | 25 | MulticlassConfusionMatrix 26 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassConfusionMatrix 29 | :exclude-members: update, compute 30 | 31 | MultilabelConfusionMatrix 32 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelConfusionMatrix 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | confusion_matrix 41 | ^^^^^^^^^^^^^^^^ 42 | 43 | .. autofunction:: torchmetrics.functional.confusion_matrix 44 | 45 | binary_confusion_matrix 46 | ^^^^^^^^^^^^^^^^^^^^^^^ 47 | 48 | .. autofunction:: torchmetrics.functional.classification.binary_confusion_matrix 49 | 50 | multiclass_confusion_matrix 51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 52 | 53 | .. autofunction:: torchmetrics.functional.classification.multiclass_confusion_matrix 54 | 55 | multilabel_confusion_matrix 56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. autofunction:: torchmetrics.functional.classification.multilabel_confusion_matrix 59 | -------------------------------------------------------------------------------- /docs/source/classification/coverage_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Coverage Error 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ############## 9 | Coverage Error 10 | ############## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.classification.MultilabelCoverageError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.classification.multilabel_coverage_error 22 | -------------------------------------------------------------------------------- /docs/source/classification/eer.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Expected Error Rate (EER) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################### 9 | Expected Error Rate (EER) 10 | ######################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.classification.EER 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryEER 20 | ^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryEER 23 | :exclude-members: update, compute 24 | 25 | MulticlassEER 26 | ^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassEER 29 | :exclude-members: update, compute 30 | 31 | MultilabelEER 32 | ^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelEER 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.classification.eer 41 | 42 | binary_eer 43 | ^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_eer 46 | 47 | multiclass_eer 48 | ^^^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_eer 51 | 52 | multilabel_eer 53 | ^^^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_eer 56 | -------------------------------------------------------------------------------- /docs/source/classification/exact_match.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Exact Match 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ########### 9 | Exact Match 10 | ########### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.ExactMatch 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | MulticlassExactMatch 20 | ^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.MulticlassExactMatch 23 | :exclude-members: update, compute 24 | 25 | MultilabelExactMatch 26 | ^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MultilabelExactMatch 29 | :exclude-members: update, compute 30 | 31 | 32 | Functional Interface 33 | ____________________ 34 | 35 | exact_match 36 | ^^^^^^^^^^^ 37 | 38 | .. autofunction:: torchmetrics.functional.classification.exact_match 39 | 40 | multiclass_exact_match 41 | ^^^^^^^^^^^^^^^^^^^^^^ 42 | 43 | .. autofunction:: torchmetrics.functional.classification.multiclass_exact_match 44 | 45 | multilabel_exact_match 46 | ^^^^^^^^^^^^^^^^^^^^^^ 47 | 48 | .. autofunction:: torchmetrics.functional.classification.multilabel_exact_match 49 | -------------------------------------------------------------------------------- /docs/source/classification/f1_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: F-1 Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ######### 9 | F-1 Score 10 | ######### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.F1Score 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryF1Score 20 | ^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryF1Score 23 | :exclude-members: update, compute 24 | 25 | MulticlassF1Score 26 | ^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassF1Score 29 | :exclude-members: update, compute 30 | 31 | MultilabelF1Score 32 | ^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelF1Score 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | f1_score 41 | ^^^^^^^^ 42 | 43 | .. autofunction:: torchmetrics.functional.f1_score 44 | 45 | binary_f1_score 46 | ^^^^^^^^^^^^^^^ 47 | 48 | .. autofunction:: torchmetrics.functional.classification.binary_f1_score 49 | 50 | multiclass_f1_score 51 | ^^^^^^^^^^^^^^^^^^^ 52 | 53 | .. autofunction:: torchmetrics.functional.classification.multiclass_f1_score 54 | 55 | multilabel_f1_score 56 | ^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. autofunction:: torchmetrics.functional.classification.multilabel_f1_score 59 | -------------------------------------------------------------------------------- /docs/source/classification/fbeta_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: F-Beta Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ############ 9 | F-Beta Score 10 | ############ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.FBetaScore 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryFBetaScore 20 | ^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryFBetaScore 23 | :exclude-members: update, compute 24 | 25 | MulticlassFBetaScore 26 | ^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassFBetaScore 29 | :exclude-members: update, compute 30 | 31 | MultilabelFBetaScore 32 | ^^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelFBetaScore 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | fbeta_score 41 | ^^^^^^^^^^^ 42 | 43 | .. autofunction:: torchmetrics.functional.fbeta_score 44 | 45 | binary_fbeta_score 46 | ^^^^^^^^^^^^^^^^^^ 47 | 48 | .. autofunction:: torchmetrics.functional.classification.binary_fbeta_score 49 | 50 | multiclass_fbeta_score 51 | ^^^^^^^^^^^^^^^^^^^^^^ 52 | 53 | .. autofunction:: torchmetrics.functional.classification.multiclass_fbeta_score 54 | 55 | multilabel_fbeta_score 56 | ^^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. autofunction:: torchmetrics.functional.classification.multilabel_fbeta_score 59 | -------------------------------------------------------------------------------- /docs/source/classification/group_fairness.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Group Fairness 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ############## 9 | Group Fairness 10 | ############## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | BinaryFairness 16 | ^^^^^^^^^^^^^^ 17 | 18 | .. autoclass:: torchmetrics.classification.BinaryFairness 19 | :exclude-members: update, compute 20 | 21 | BinaryGroupStatRates 22 | ^^^^^^^^^^^^^^^^^^^^ 23 | 24 | .. autoclass:: torchmetrics.classification.BinaryGroupStatRates 25 | :exclude-members: update, compute 26 | 27 | Functional Interface 28 | ____________________ 29 | 30 | binary_fairness 31 | ^^^^^^^^^^^^^^^ 32 | 33 | .. autofunction:: torchmetrics.functional.classification.binary_fairness 34 | 35 | demographic_parity 36 | ^^^^^^^^^^^^^^^^^^ 37 | 38 | .. autofunction:: torchmetrics.functional.classification.demographic_parity 39 | 40 | equal_opportunity 41 | ^^^^^^^^^^^^^^^^^ 42 | 43 | .. autofunction:: torchmetrics.functional.classification.equal_opportunity 44 | 45 | binary_groups_stat_rates 46 | ^^^^^^^^^^^^^^^^^^^^^^^^ 47 | 48 | .. autofunction:: torchmetrics.functional.classification.binary_groups_stat_rates 49 | -------------------------------------------------------------------------------- /docs/source/classification/hamming_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Hamming Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Hamming Distance 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.HammingDistance 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryHammingDistance 20 | ^^^^^^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryHammingDistance 23 | :exclude-members: update, compute 24 | 25 | MulticlassHammingDistance 26 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassHammingDistance 29 | :exclude-members: update, compute 30 | 31 | MultilabelHammingDistance 32 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelHammingDistance 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | hamming_distance 41 | ^^^^^^^^^^^^^^^^ 42 | 43 | .. autofunction:: torchmetrics.functional.hamming_distance 44 | 45 | binary_hamming_distance 46 | ^^^^^^^^^^^^^^^^^^^^^^^ 47 | 48 | .. autofunction:: torchmetrics.functional.classification.binary_hamming_distance 49 | 50 | multiclass_hamming_distance 51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 52 | 53 | .. autofunction:: torchmetrics.functional.classification.multiclass_hamming_distance 54 | 55 | multilabel_hamming_distance 56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. autofunction:: torchmetrics.functional.classification.multilabel_hamming_distance 59 | -------------------------------------------------------------------------------- /docs/source/classification/hinge_loss.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Hinge Loss 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | Hinge Loss 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.HingeLoss 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryHingeLoss 20 | ^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryHingeLoss 23 | :exclude-members: update, compute 24 | 25 | MulticlassHingeLoss 26 | ^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassHingeLoss 29 | :exclude-members: update, compute 30 | 31 | Functional Interface 32 | ____________________ 33 | 34 | .. autofunction:: torchmetrics.functional.hinge_loss 35 | 36 | binary_hinge_loss 37 | ^^^^^^^^^^^^^^^^^ 38 | 39 | .. autofunction:: torchmetrics.functional.classification.binary_hinge_loss 40 | 41 | multiclass_hinge_loss 42 | ^^^^^^^^^^^^^^^^^^^^^ 43 | 44 | .. autofunction:: torchmetrics.functional.classification.multiclass_hinge_loss 45 | -------------------------------------------------------------------------------- /docs/source/classification/jaccard_index.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Jaccard Index 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ############# 9 | Jaccard Index 10 | ############# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.JaccardIndex 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryJaccardIndex 20 | ^^^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryJaccardIndex 23 | :exclude-members: update, compute 24 | 25 | MulticlassJaccardIndex 26 | ^^^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassJaccardIndex 29 | :exclude-members: update, compute 30 | 31 | MultilabelJaccardIndex 32 | ^^^^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelJaccardIndex 35 | :exclude-members: update, compute 36 | 37 | 38 | Functional Interface 39 | ____________________ 40 | 41 | jaccard_index 42 | ^^^^^^^^^^^^^ 43 | 44 | .. autofunction:: torchmetrics.functional.jaccard_index 45 | 46 | binary_jaccard_index 47 | ^^^^^^^^^^^^^^^^^^^^ 48 | 49 | .. autofunction:: torchmetrics.functional.classification.binary_jaccard_index 50 | 51 | multiclass_jaccard_index 52 | ^^^^^^^^^^^^^^^^^^^^^^^^ 53 | 54 | .. autofunction:: torchmetrics.functional.classification.multiclass_jaccard_index 55 | 56 | multilabel_jaccard_index 57 | ^^^^^^^^^^^^^^^^^^^^^^^^ 58 | 59 | .. autofunction:: torchmetrics.functional.classification.multilabel_jaccard_index 60 | -------------------------------------------------------------------------------- /docs/source/classification/label_ranking_average_precision.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Label Ranking Average Precision 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################### 9 | Label Ranking Average Precision 10 | ############################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.classification.MultilabelRankingAveragePrecision 16 | :exclude-members: update, compute 17 | 18 | 19 | Functional Interface 20 | ____________________ 21 | 22 | .. autofunction:: torchmetrics.functional.classification.multilabel_ranking_average_precision 23 | -------------------------------------------------------------------------------- /docs/source/classification/label_ranking_loss.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Label Ranking Loss 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Label Ranking Loss 10 | ################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.classification.MultilabelRankingLoss 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.classification.multilabel_ranking_loss 22 | -------------------------------------------------------------------------------- /docs/source/classification/logauc.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Log Area Receiver Operating Characteristic (LogAUC) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ####### 9 | Log AUC 10 | ####### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.LogAUC 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryLogAUC 20 | ^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryLogAUC 23 | :exclude-members: update, compute 24 | 25 | MulticlassLogAUC 26 | ^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassLogAUC 29 | :exclude-members: update, compute 30 | 31 | MultilabelLogAUC 32 | ^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelLogAUC 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.logauc 41 | 42 | binary_logauc 43 | ^^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_logauc 46 | 47 | multiclass_logauc 48 | ^^^^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_logauc 51 | 52 | multilabel_logauc 53 | ^^^^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_logauc 56 | -------------------------------------------------------------------------------- /docs/source/classification/precision.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Precision 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ######### 9 | Precision 10 | ######### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.Precision 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryPrecision 20 | ^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryPrecision 23 | :exclude-members: update, compute 24 | 25 | MulticlassPrecision 26 | ^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassPrecision 29 | :exclude-members: update, compute 30 | 31 | MultilabelPrecision 32 | ^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelPrecision 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.precision 41 | 42 | binary_precision 43 | ^^^^^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_precision 46 | 47 | multiclass_precision 48 | ^^^^^^^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_precision 51 | 52 | multilabel_precision 53 | ^^^^^^^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_precision 56 | -------------------------------------------------------------------------------- /docs/source/classification/recall.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Recall 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ###### 9 | Recall 10 | ###### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.Recall 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryRecall 20 | ^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryRecall 23 | :exclude-members: update, compute 24 | 25 | MulticlassRecall 26 | ^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassRecall 29 | :exclude-members: update, compute 30 | 31 | MultilabelRecall 32 | ^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelRecall 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.recall 41 | 42 | binary_recall 43 | ^^^^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_recall 46 | 47 | multiclass_recall 48 | ^^^^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_recall 51 | 52 | multilabel_recall 53 | ^^^^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_recall 56 | -------------------------------------------------------------------------------- /docs/source/classification/roc.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Receiver Operating Characteristic Curve (ROC) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ### 9 | ROC 10 | ### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.ROC 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryROC 20 | ^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryROC 23 | :exclude-members: update, compute 24 | 25 | MulticlassROC 26 | ^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassROC 29 | :exclude-members: update, compute 30 | 31 | MultilabelROC 32 | ^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelROC 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | .. autofunction:: torchmetrics.functional.roc 41 | 42 | binary_roc 43 | ^^^^^^^^^^ 44 | 45 | .. autofunction:: torchmetrics.functional.classification.binary_roc 46 | 47 | multiclass_roc 48 | ^^^^^^^^^^^^^^ 49 | 50 | .. autofunction:: torchmetrics.functional.classification.multiclass_roc 51 | 52 | multilabel_roc 53 | ^^^^^^^^^^^^^^ 54 | 55 | .. autofunction:: torchmetrics.functional.classification.multilabel_roc 56 | -------------------------------------------------------------------------------- /docs/source/classification/specificity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Specificity 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ########### 9 | Specificity 10 | ########### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.Specificity 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinarySpecificity 20 | ^^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinarySpecificity 23 | :exclude-members: update, compute 24 | 25 | MulticlassSpecificity 26 | ^^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassSpecificity 29 | :exclude-members: update, compute 30 | 31 | MultilabelSpecificity 32 | ^^^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelSpecificity 35 | :exclude-members: update, compute 36 | 37 | 38 | Functional Interface 39 | ____________________ 40 | 41 | .. autofunction:: torchmetrics.functional.specificity 42 | 43 | binary_specificity 44 | ^^^^^^^^^^^^^^^^^^ 45 | 46 | .. autofunction:: torchmetrics.functional.classification.binary_specificity 47 | 48 | multiclass_specificity 49 | ^^^^^^^^^^^^^^^^^^^^^^ 50 | 51 | .. autofunction:: torchmetrics.functional.classification.multiclass_specificity 52 | 53 | multilabel_specificity 54 | ^^^^^^^^^^^^^^^^^^^^^^ 55 | 56 | .. autofunction:: torchmetrics.functional.classification.multilabel_specificity 57 | -------------------------------------------------------------------------------- /docs/source/classification/stat_scores.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Stat Scores 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Classification 5 | 6 | .. include:: ../links.rst 7 | 8 | ########### 9 | Stat Scores 10 | ########### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.StatScores 16 | :exclude-members: update, compute 17 | :special-members: __new__ 18 | 19 | BinaryStatScores 20 | ^^^^^^^^^^^^^^^^ 21 | 22 | .. autoclass:: torchmetrics.classification.BinaryStatScores 23 | :exclude-members: update, compute 24 | 25 | MulticlassStatScores 26 | ^^^^^^^^^^^^^^^^^^^^ 27 | 28 | .. autoclass:: torchmetrics.classification.MulticlassStatScores 29 | :exclude-members: update, compute 30 | 31 | MultilabelStatScores 32 | ^^^^^^^^^^^^^^^^^^^^ 33 | 34 | .. autoclass:: torchmetrics.classification.MultilabelStatScores 35 | :exclude-members: update, compute 36 | 37 | Functional Interface 38 | ____________________ 39 | 40 | stat_scores 41 | ^^^^^^^^^^^ 42 | 43 | .. autofunction:: torchmetrics.functional.stat_scores 44 | 45 | binary_stat_scores 46 | ^^^^^^^^^^^^^^^^^^ 47 | 48 | .. autofunction:: torchmetrics.functional.classification.binary_stat_scores 49 | 50 | multiclass_stat_scores 51 | ^^^^^^^^^^^^^^^^^^^^^^ 52 | 53 | .. autofunction:: torchmetrics.functional.classification.multiclass_stat_scores 54 | 55 | multilabel_stat_scores 56 | ^^^^^^^^^^^^^^^^^^^^^^ 57 | 58 | .. autofunction:: torchmetrics.functional.classification.multilabel_stat_scores 59 | -------------------------------------------------------------------------------- /docs/source/clustering/adjusted_mutual_info_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Adjusted Mutual Information Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################# 9 | Adjusted Mutual Information Score 10 | ################################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.AdjustedMutualInfoScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.adjusted_mutual_info_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/adjusted_rand_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Adjusted Rand Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ################### 9 | Adjusted Rand Score 10 | ################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.AdjustedRandScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.adjusted_rand_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/calinski_harabasz_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Calinski Harabasz Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ####################### 9 | Calinski Harabasz Score 10 | ####################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.CalinskiHarabaszScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.calinski_harabasz_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/cluster_accuracy.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Cluster Accuracy 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Cluster Accuracy 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.ClusterAccuracy 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.cluster_accuracy 22 | -------------------------------------------------------------------------------- /docs/source/clustering/completeness_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Completeness Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Completeness Score 10 | ################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.CompletenessScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.completeness_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/davies_bouldin_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Davies Bouldin Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | #################### 9 | Davies Bouldin Score 10 | #################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.DaviesBouldinScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.davies_bouldin_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/dunn_index.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Dunn Index 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/clustering.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | Dunn Index 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.DunnIndex 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.dunn_index 22 | -------------------------------------------------------------------------------- /docs/source/clustering/fowlkes_mallows_index.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Fowlkes Mallows Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ##################### 9 | Fowlkes-Mallows Index 10 | ##################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.FowlkesMallowsIndex 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.fowlkes_mallows_index 22 | -------------------------------------------------------------------------------- /docs/source/clustering/homogeneity_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Homogeneity Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ################# 9 | Homogeneity Score 10 | ################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.HomogeneityScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.homogeneity_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/mutual_info_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mutual Information Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################## 9 | Mutual Information Score 10 | ######################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.MutualInfoScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.mutual_info_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/normalized_mutual_info_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Normalized Mutual Information Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################### 9 | Normalized Mutual Information Score 10 | ################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.NormalizedMutualInfoScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.normalized_mutual_info_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/rand_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Rand Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | Rand Score 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.RandScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.rand_score 22 | -------------------------------------------------------------------------------- /docs/source/clustering/v_measure_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: V-Measure Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/default.svg 4 | :tags: Clustering 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | V-Measure Score 10 | ############### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.clustering.VMeasureScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.clustering.v_measure_score 22 | -------------------------------------------------------------------------------- /docs/source/detection/complete_intersection_over_union.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Complete Intersection Over Union (cIoU) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/object_detection.svg 4 | :tags: Detection 5 | 6 | .. include:: ../links.rst 7 | 8 | ####################################### 9 | Complete Intersection Over Union (cIoU) 10 | ####################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.detection.ciou.CompleteIntersectionOverUnion 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.detection.ciou.complete_intersection_over_union 22 | -------------------------------------------------------------------------------- /docs/source/detection/distance_intersection_over_union.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Distance Intersection Over Union (dIoU) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/object_detection.svg 4 | :tags: Detection 5 | 6 | .. include:: ../links.rst 7 | 8 | ####################################### 9 | Distance Intersection Over Union (dIoU) 10 | ####################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.detection.diou.DistanceIntersectionOverUnion 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.detection.diou.distance_intersection_over_union 22 | -------------------------------------------------------------------------------- /docs/source/detection/generalized_intersection_over_union.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Generalized Intersection Over Union (gIoU) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/object_detection.svg 4 | :tags: Detection 5 | 6 | .. include:: ../links.rst 7 | 8 | ########################################## 9 | Generalized Intersection Over Union (gIoU) 10 | ########################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.detection.giou.GeneralizedIntersectionOverUnion 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.detection.giou.generalized_intersection_over_union 22 | -------------------------------------------------------------------------------- /docs/source/detection/intersection_over_union.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Intersection Over Union (IoU) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/object_detection.svg 4 | :tags: Detection 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################# 9 | Intersection Over Union (IoU) 10 | ############################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.detection.iou.IntersectionOverUnion 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.detection.iou.intersection_over_union 22 | -------------------------------------------------------------------------------- /docs/source/detection/mean_average_precision.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean-Average-Precision (mAP) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/object_detection.svg 4 | :tags: Detection 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################ 9 | Mean-Average-Precision (mAP) 10 | ############################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.detection.mean_ap.MeanAveragePrecision 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.detection.mean_average_precision 22 | -------------------------------------------------------------------------------- /docs/source/detection/modified_panoptic_quality.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Modified Panoptic Quality 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Detection 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################### 9 | Modified Panoptic Quality 10 | ######################### 11 | 12 | .. include:: ../links.rst 13 | 14 | Module Interface 15 | ________________ 16 | 17 | .. autoclass:: torchmetrics.detection.ModifiedPanopticQuality 18 | :exclude-members: update, compute 19 | 20 | Functional Interface 21 | ____________________ 22 | 23 | .. autofunction:: torchmetrics.functional.detection.modified_panoptic_quality 24 | -------------------------------------------------------------------------------- /docs/source/detection/panoptic_quality.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Panoptic Quality 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Detection 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Panoptic Quality 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.detection.PanopticQuality 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.detection.panoptic_quality 22 | -------------------------------------------------------------------------------- /docs/source/image/arniqa.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: ARNIQA 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ###### 9 | ARNIQA 10 | ###### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.arniqa.ARNIQA 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.arniqa 22 | -------------------------------------------------------------------------------- /docs/source/image/dists.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Deep Image Structure And Texture Similarity (DISTS) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################################### 9 | Deep Image Structure And Texture Similarity (DISTS) 10 | ################################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.dists.DeepImageStructureAndTextureSimilarity 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.dists.deep_image_structure_and_texture_similarity 22 | -------------------------------------------------------------------------------- /docs/source/image/error_relative_global_dimensionless_synthesis.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Error Relative Global Dimensionless Synthesis (ERGAS) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################################ 9 | Error Relative Global Dim. Synthesis (ERGAS) 10 | ############################################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.ErrorRelativeGlobalDimensionlessSynthesis 16 | :exclude-members: update, compute 17 | 18 | 19 | Functional Interface 20 | ____________________ 21 | 22 | .. autofunction:: torchmetrics.functional.image.error_relative_global_dimensionless_synthesis 23 | -------------------------------------------------------------------------------- /docs/source/image/frechet_inception_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Frechet Inception Distance (FID) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################ 9 | Frechet Inception Distance (FID) 10 | ################################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.fid.FrechetInceptionDistance 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/image/image_gradients.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Image Gradients 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Image Gradients 10 | ############### 11 | 12 | Functional Interface 13 | ____________________ 14 | 15 | .. autofunction:: torchmetrics.functional.image.image_gradients 16 | -------------------------------------------------------------------------------- /docs/source/image/inception_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Inception Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Inception Score 10 | ############### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.inception.InceptionScore 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/image/kernel_inception_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Kernel Inception Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################### 9 | Kernel Inception Distance 10 | ######################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.kid.KernelInceptionDistance 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/image/learned_perceptual_image_patch_similarity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Learned Perceptual Image Patch Similarity (LPIPS) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################################# 9 | Learned Perceptual Image Patch Similarity (LPIPS) 10 | ################################################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.lpip.LearnedPerceptualImagePatchSimilarity 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.learned_perceptual_image_patch_similarity 22 | -------------------------------------------------------------------------------- /docs/source/image/mifid.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Memorization-Informed Frechet Inception Distance (MiFID) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################################################## 9 | Memorization-Informed Frechet Inception Distance (MiFID) 10 | ######################################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.mifid.MemorizationInformedFrechetInceptionDistance 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/image/multi_scale_structural_similarity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Multi-Scale Structural Similarity Index Measure 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Multi-Scale SSIM 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.MultiScaleStructuralSimilarityIndexMeasure 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.multiscale_structural_similarity_index_measure 22 | -------------------------------------------------------------------------------- /docs/source/image/peak_signal_noise_ratio.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Peak Signal-to-Noise Ratio (PSNR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################# 9 | Peak Signal-to-Noise Ratio (PSNR) 10 | ################################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.PeakSignalNoiseRatio 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.peak_signal_noise_ratio 22 | -------------------------------------------------------------------------------- /docs/source/image/peak_signal_to_noise_with_block.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Peak Signal To Noise Ratio With Blocked Effect 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################################## 9 | Peak Signal To Noise Ratio With Blocked Effect 10 | ############################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.PeakSignalNoiseRatioWithBlockedEffect 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.peak_signal_noise_ratio_with_blocked_effect 22 | -------------------------------------------------------------------------------- /docs/source/image/perceptual_path_length.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Perceptual Path Length 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################ 9 | Perceptual Path Length (PPL) 10 | ############################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.perceptual_path_length.PerceptualPathLength 16 | :exclude-members: update, compute 17 | 18 | .. autoclass:: torchmetrics.image.perceptual_path_length.GeneratorType 19 | 20 | Functional Interface 21 | ____________________ 22 | 23 | .. autofunction:: torchmetrics.functional.image.perceptual_path_length.perceptual_path_length 24 | -------------------------------------------------------------------------------- /docs/source/image/quality_with_no_reference.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Quality with No Reference 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################### 9 | Quality with No Reference 10 | ######################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.QualityWithNoReference 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.quality_with_no_reference 22 | -------------------------------------------------------------------------------- /docs/source/image/relative_average_spectral_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Relative Average Spectral Error (RASE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ###################################### 9 | Relative Average Spectral Error (RASE) 10 | ###################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.RelativeAverageSpectralError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.relative_average_spectral_error 22 | -------------------------------------------------------------------------------- /docs/source/image/root_mean_squared_error_using_sliding_window.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Root Mean Squared Error Using Sliding Window 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################################ 9 | Root Mean Squared Error Using Sliding Window 10 | ############################################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.RootMeanSquaredErrorUsingSlidingWindow 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.root_mean_squared_error_using_sliding_window 22 | -------------------------------------------------------------------------------- /docs/source/image/spatial_correlation_coefficient.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Spatial Correlation Coefficient (SCC) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ##################################### 9 | Spatial Correlation Coefficient (SCC) 10 | ##################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.SpatialCorrelationCoefficient 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.spatial_correlation_coefficient 22 | -------------------------------------------------------------------------------- /docs/source/image/spatial_distortion_index.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Spatial Distortion Index 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################## 9 | Spatial Distortion Index 10 | ######################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.SpatialDistortionIndex 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.spatial_distortion_index 22 | -------------------------------------------------------------------------------- /docs/source/image/spectral_angle_mapper.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Spectral Angle Mapper 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ##################### 9 | Spectral Angle Mapper 10 | ##################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.SpectralAngleMapper 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.spectral_angle_mapper 22 | -------------------------------------------------------------------------------- /docs/source/image/spectral_distortion_index.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Spectral Distortion Index 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################### 9 | Spectral Distortion Index 10 | ######################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.SpectralDistortionIndex 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.spectral_distortion_index 22 | -------------------------------------------------------------------------------- /docs/source/image/structural_similarity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Structural Similarity Index Measure (SSIM) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ########################################## 9 | Structural Similarity Index Measure (SSIM) 10 | ########################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.StructuralSimilarityIndexMeasure 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.structural_similarity_index_measure 22 | -------------------------------------------------------------------------------- /docs/source/image/total_variation.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Total Variation (TV) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | #################### 9 | Total Variation (TV) 10 | #################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.TotalVariation 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.total_variation 22 | -------------------------------------------------------------------------------- /docs/source/image/universal_image_quality_index.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Universal Image Quality Index 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################# 9 | Universal Image Quality Index 10 | ############################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.UniversalImageQualityIndex 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.universal_image_quality_index 22 | -------------------------------------------------------------------------------- /docs/source/image/visual_information_fidelity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Visual Information Fidelity (VIF) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Image 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################# 9 | Visual Information Fidelity (VIF) 10 | ################################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.image.VisualInformationFidelity 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.image.visual_information_fidelity 22 | -------------------------------------------------------------------------------- /docs/source/multimodal/clip_iqa.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: CLIP IQA 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Multimodal 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################################## 9 | CLIP Image Quality Assessment (CLIP-IQA) 10 | ######################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.multimodal.CLIPImageQualityAssessment 16 | :noindex: 17 | :exclude-members: update, compute 18 | 19 | 20 | Functional Interface 21 | ____________________ 22 | 23 | .. autofunction:: torchmetrics.functional.multimodal.clip_image_quality_assessment 24 | :noindex: 25 | -------------------------------------------------------------------------------- /docs/source/multimodal/clip_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: CLIP Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Multimodal 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | CLIP Score 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.multimodal.clip_score.CLIPScore 16 | 17 | Functional Interface 18 | ____________________ 19 | 20 | .. autofunction:: torchmetrics.functional.multimodal.clip_score.clip_score 21 | -------------------------------------------------------------------------------- /docs/source/multimodal/lve.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Lip Vertex Error 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Multimodal 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Lip Vertex Error 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.multimodal.lve.LipVertexError 16 | 17 | Functional Interface 18 | ____________________ 19 | 20 | .. autofunction:: torchmetrics.functional.multimodal.lve.lip_vertex_error 21 | -------------------------------------------------------------------------------- /docs/source/nominal/cramers_v.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Cramer's V 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Nominal 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | Cramer's V 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.nominal.CramersV 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.nominal.cramers_v 22 | 23 | cramers_v_matrix 24 | ^^^^^^^^^^^^^^^^ 25 | 26 | .. autofunction:: torchmetrics.functional.nominal.cramers_v_matrix 27 | -------------------------------------------------------------------------------- /docs/source/nominal/fleiss_kappa.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Fleiss Kappa 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Nominal 5 | 6 | .. include:: ../links.rst 7 | 8 | ############ 9 | Fleiss Kappa 10 | ############ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.nominal.FleissKappa 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.nominal.fleiss_kappa 22 | -------------------------------------------------------------------------------- /docs/source/nominal/pearsons_contingency_coefficient.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Pearson's Contingency Coefficient 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Nominal 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################# 9 | Pearson's Contingency Coefficient 10 | ################################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.nominal.PearsonsContingencyCoefficient 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.nominal.pearsons_contingency_coefficient 22 | 23 | pearsons_contingency_coefficient_matrix 24 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 25 | 26 | .. autofunction:: torchmetrics.functional.nominal.pearsons_contingency_coefficient_matrix 27 | -------------------------------------------------------------------------------- /docs/source/nominal/theils_u.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Theil's U 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Nominal 5 | 6 | .. include:: ../links.rst 7 | 8 | ######### 9 | Theil's U 10 | ######### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.nominal.TheilsU 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.nominal.theils_u 22 | 23 | theils_u_matrix 24 | ^^^^^^^^^^^^^^^ 25 | 26 | .. autofunction:: torchmetrics.functional.nominal.theils_u_matrix 27 | -------------------------------------------------------------------------------- /docs/source/nominal/tschuprows_t.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Tschuprow's T 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Nominal 5 | 6 | .. include:: ../links.rst 7 | 8 | ############# 9 | Tschuprow's T 10 | ############# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.nominal.TschuprowsT 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.nominal.tschuprows_t 22 | 23 | tschuprows_t_matrix 24 | ^^^^^^^^^^^^^^^^^^^ 25 | 26 | .. autofunction:: torchmetrics.functional.nominal.tschuprows_t_matrix 27 | -------------------------------------------------------------------------------- /docs/source/pairwise/cosine_similarity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Pairwise Cosine Similarity 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/translation.svg 4 | :tags: Pairwise 5 | 6 | .. include:: ../links.rst 7 | 8 | ################# 9 | Cosine Similarity 10 | ################# 11 | 12 | Functional Interface 13 | ____________________ 14 | 15 | .. autofunction:: torchmetrics.functional.pairwise_cosine_similarity 16 | -------------------------------------------------------------------------------- /docs/source/pairwise/euclidean_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Pairwise Euclidean Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/translation.svg 4 | :tags: Pairwise 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Euclidean Distance 10 | ################## 11 | 12 | Functional Interface 13 | ____________________ 14 | 15 | .. autofunction:: torchmetrics.functional.pairwise_euclidean_distance 16 | -------------------------------------------------------------------------------- /docs/source/pairwise/linear_similarity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Pairwise Linear Similarity 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/translation.svg 4 | :tags: Pairwise 5 | 6 | .. include:: ../links.rst 7 | 8 | ################# 9 | Linear Similarity 10 | ################# 11 | 12 | Functional Interface 13 | ____________________ 14 | 15 | .. autofunction:: torchmetrics.functional.pairwise_linear_similarity 16 | -------------------------------------------------------------------------------- /docs/source/pairwise/manhattan_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Pairwise Manhattan Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/translation.svg 4 | :tags: Pairwise 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Manhattan Distance 10 | ################## 11 | 12 | Functional Interface 13 | ____________________ 14 | 15 | .. autofunction:: torchmetrics.functional.pairwise_manhattan_distance 16 | -------------------------------------------------------------------------------- /docs/source/pairwise/minkowski_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Pairwise Minkowski Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/translation.svg 4 | :tags: Pairwise 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Minkowski Distance 10 | ################## 11 | 12 | Functional Interface 13 | ____________________ 14 | 15 | .. autofunction:: torchmetrics.functional.pairwise_minkowski_distance 16 | -------------------------------------------------------------------------------- /docs/source/pyplots/binary_accuracy.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import torch 3 | 4 | import torchmetrics 5 | 6 | N = 10 7 | num_updates = 10 8 | num_steps = 5 9 | 10 | fig, ax = plt.subplots(1, 1, figsize=(6.8, 4.8), dpi=500) 11 | metric = torchmetrics.Accuracy(task="binary") 12 | for _ in range(N): 13 | metric.update(torch.rand(10), torch.randint(2, (10,))) 14 | metric.plot(ax=ax) 15 | fig.show() 16 | -------------------------------------------------------------------------------- /docs/source/pyplots/binary_accuracy_multistep.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import torch 3 | 4 | import torchmetrics 5 | 6 | N = 10 7 | num_updates = 10 8 | num_steps = 5 9 | 10 | w = torch.tensor([0.2, 0.8]) 11 | target = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) 12 | preds = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) 13 | 14 | fig, ax = plt.subplots(1, 1, figsize=(6.8, 4.8), dpi=500) 15 | 16 | metric = torchmetrics.Accuracy(task="binary") 17 | values = [] 18 | for step in range(num_steps): 19 | for _ in range(N): 20 | metric.update(preds(step), target(step)) 21 | values.append(metric.compute()) # save value 22 | metric.reset() 23 | metric.plot(values, ax=ax) 24 | fig.show() 25 | -------------------------------------------------------------------------------- /docs/source/pyplots/collection_binary.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import torch 3 | 4 | import torchmetrics 5 | 6 | N = 10 7 | num_updates = 10 8 | num_steps = 5 9 | 10 | w = torch.tensor([0.2, 0.8]) 11 | target = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) 12 | preds = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) 13 | 14 | collection = torchmetrics.MetricCollection( 15 | torchmetrics.Accuracy(task="binary"), 16 | torchmetrics.Recall(task="binary"), 17 | torchmetrics.Precision(task="binary"), 18 | ) 19 | 20 | fig, ax = plt.subplots(nrows=1, ncols=3, figsize=(6.8, 4.8), dpi=500) 21 | values = [] 22 | for step in range(num_steps): 23 | for _ in range(N): 24 | collection.update(preds(step), target(step)) 25 | values.append(collection.compute()) 26 | collection.reset() 27 | collection.plot(val=values, ax=ax) 28 | fig.tight_layout() 29 | fig.show() 30 | -------------------------------------------------------------------------------- /docs/source/pyplots/collection_binary_together.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import torch 3 | 4 | import torchmetrics 5 | 6 | N = 10 7 | num_updates = 10 8 | num_steps = 5 9 | 10 | w = torch.tensor([0.2, 0.8]) 11 | target = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) 12 | preds = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) 13 | 14 | collection = torchmetrics.MetricCollection( 15 | torchmetrics.Accuracy(task="binary"), 16 | torchmetrics.Recall(task="binary"), 17 | torchmetrics.Precision(task="binary"), 18 | ) 19 | 20 | values = [] 21 | fig, ax = plt.subplots(1, 1, figsize=(6.8, 4.8), dpi=500) 22 | for step in range(num_steps): 23 | for _ in range(N): 24 | collection.update(preds(step), target(step)) 25 | values.append(collection.compute()) 26 | collection.reset() 27 | collection.plot(val=values, ax=ax, together=True) 28 | fig.tight_layout() 29 | fig.show() 30 | -------------------------------------------------------------------------------- /docs/source/pyplots/confusion_matrix.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import torch 3 | 4 | import torchmetrics 5 | 6 | N = 10 7 | num_updates = 10 8 | num_steps = 5 9 | 10 | fig, ax = plt.subplots(1, 1, figsize=(6.8, 4.8), dpi=500) 11 | 12 | metric = torchmetrics.ConfusionMatrix(task="multiclass", num_classes=3) 13 | for _ in range(N): 14 | metric.update(torch.randint(3, (10,)), torch.randint(3, (10,))) 15 | metric.plot(ax=ax) 16 | fig.show() 17 | -------------------------------------------------------------------------------- /docs/source/pyplots/multiclass_accuracy.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import torch 3 | 4 | import torchmetrics 5 | 6 | N = 10 7 | num_updates = 10 8 | num_steps = 5 9 | 10 | fig, ax = plt.subplots(1, 1, figsize=(6.8, 4.8), dpi=500) 11 | 12 | metric = torchmetrics.Accuracy(task="multiclass", num_classes=3, average=None) 13 | for _ in range(N): 14 | metric.update(torch.randint(3, (10,)), torch.randint(3, (10,))) 15 | metric.plot(ax=ax) 16 | fig.show() 17 | -------------------------------------------------------------------------------- /docs/source/pyplots/tracker_binary.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | import torch 3 | 4 | import torchmetrics 5 | 6 | N = 10 7 | num_updates = 10 8 | num_steps = 5 9 | 10 | w = torch.tensor([0.2, 0.8]) 11 | target = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) 12 | preds = lambda it: (it * torch.randn(100)).sigmoid() 13 | 14 | confmat = torchmetrics.ConfusionMatrix(task="binary") 15 | roc = torchmetrics.ROC(task="binary") 16 | tracker = torchmetrics.wrappers.MetricTracker( 17 | torchmetrics.MetricCollection( 18 | torchmetrics.Accuracy(task="binary"), 19 | torchmetrics.Recall(task="binary"), 20 | torchmetrics.Precision(task="binary"), 21 | confmat, 22 | roc, 23 | ), 24 | maximize=True, 25 | ) 26 | 27 | fig = plt.figure(layout="constrained", figsize=(6.8, 4.8), dpi=500) 28 | ax1 = plt.subplot(2, 2, 1) 29 | ax2 = plt.subplot(2, 2, 2) 30 | ax3 = plt.subplot(2, 2, (3, 4)) 31 | 32 | for step in range(num_steps): 33 | tracker.increment() 34 | for _ in range(N): 35 | tracker.update(preds(step), target(step)) 36 | 37 | # get the results from all steps and extract for confusion matrix and roc 38 | all_results = tracker.compute_all() 39 | confmat.plot(val=all_results[-1]["BinaryConfusionMatrix"], ax=ax1) 40 | roc.plot(all_results[-1]["BinaryROC"], ax=ax2) 41 | 42 | scalar_results = [{k: v for k, v in ar.items() if isinstance(v, torch.Tensor) and v.numel() == 1} for ar in all_results] 43 | 44 | tracker.plot(val=scalar_results, ax=ax3) 45 | fig.show() 46 | -------------------------------------------------------------------------------- /docs/source/references/metric.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | ################### 5 | torchmetrics.Metric 6 | ################### 7 | 8 | The base ``Metric`` class is an abstract base class that are used as the building block for all other Module 9 | metrics. 10 | 11 | .. autoclass:: torchmetrics.Metric 12 | -------------------------------------------------------------------------------- /docs/source/regression/concordance_corr_coef.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Concordance Correlation Coefficient 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ####################### 9 | Concordance Corr. Coef. 10 | ####################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.ConcordanceCorrCoef 16 | :exclude-members: update, compute 17 | 18 | 19 | Functional Interface 20 | ____________________ 21 | 22 | .. autofunction:: torchmetrics.functional.concordance_corrcoef 23 | -------------------------------------------------------------------------------- /docs/source/regression/cosine_similarity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Cosine Similarity 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ################# 9 | Cosine Similarity 10 | ################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.CosineSimilarity 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.cosine_similarity 22 | -------------------------------------------------------------------------------- /docs/source/regression/critical_success_index.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Critical Success Index (CSI) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################ 9 | Critical Success Index (CSI) 10 | ############################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.regression.CriticalSuccessIndex 16 | :exclude-members: update, compute 17 | 18 | 19 | Functional Interface 20 | ____________________ 21 | 22 | .. autofunction:: torchmetrics.functional.regression.critical_success_index 23 | -------------------------------------------------------------------------------- /docs/source/regression/crps.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Continuous Ranked Probability Score (CRPS) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ########################################## 9 | Continuous Ranked Probability Score (CRPS) 10 | ########################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.regression.crps.ContinuousRankedProbabilityScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.regression.continuous_ranked_probability_score 22 | -------------------------------------------------------------------------------- /docs/source/regression/explained_variance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Explained Variance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Explained Variance 10 | ################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.ExplainedVariance 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.explained_variance 22 | -------------------------------------------------------------------------------- /docs/source/regression/js_divergence.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Jensen-Shannon Divergence 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################### 9 | Jensen-Shannon Divergence 10 | ######################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.regression.JensenShannonDivergence 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.regression.jensen_shannon_divergence 22 | -------------------------------------------------------------------------------- /docs/source/regression/kendall_rank_corr_coef.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Kendall Rank Correlation Coefficient 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################## 9 | Kendall Rank Corr. Coef. 10 | ######################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.KendallRankCorrCoef 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.kendall_rank_corrcoef 22 | -------------------------------------------------------------------------------- /docs/source/regression/kl_divergence.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: KL Divergence 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ############# 9 | KL Divergence 10 | ############# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.KLDivergence 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.kl_divergence 22 | -------------------------------------------------------------------------------- /docs/source/regression/log_cosh_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Log Cosh Error 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ############## 9 | Log Cosh Error 10 | ############## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.LogCoshError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.log_cosh_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/mean_absolute_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean Absolute Error (MAE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################### 9 | Mean Absolute Error (MAE) 10 | ######################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.MeanAbsoluteError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.mean_absolute_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/mean_absolute_percentage_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean Absolute Percentage Error (MAPE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ##################################### 9 | Mean Absolute Percentage Error (MAPE) 10 | ##################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.MeanAbsolutePercentageError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.mean_absolute_percentage_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/mean_squared_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean Squared Error (MSE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################## 9 | Mean Squared Error (MSE) 10 | ######################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.MeanSquaredError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.mean_squared_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/mean_squared_log_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean Squared Log Error (MSLE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################# 9 | Mean Squared Log Error (MSLE) 10 | ############################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.MeanSquaredLogError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.mean_squared_log_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/minkowski_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Minkowski Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Minkowski Distance 10 | ################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.MinkowskiDistance 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.minkowski_distance 22 | -------------------------------------------------------------------------------- /docs/source/regression/normalized_root_mean_squared_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Normalized Root Mean Squared Error (NRMSE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ########################################## 9 | Normalized Root Mean Squared Error (NRMSE) 10 | ########################################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.NormalizedRootMeanSquaredError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.normalized_root_mean_squared_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/pearson_corr_coef.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Pearson Correlation Coefficient 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ################### 9 | Pearson Corr. Coef. 10 | ################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.PearsonCorrCoef 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.pearson_corrcoef 22 | -------------------------------------------------------------------------------- /docs/source/regression/r2_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: R2 Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ######## 9 | R2 Score 10 | ######## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.R2Score 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.r2_score 22 | -------------------------------------------------------------------------------- /docs/source/regression/rse.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Relative Squared Error 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ############################ 9 | Relative Squared Error (RSE) 10 | ############################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.RelativeSquaredError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.relative_squared_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/spearman_corr_coef.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Spearman Correlation Coefficient 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | #################### 9 | Spearman Corr. Coef. 10 | #################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.SpearmanCorrCoef 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.spearman_corrcoef 22 | -------------------------------------------------------------------------------- /docs/source/regression/symmetric_mean_absolute_percentage_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Symmetric Mean Absolute Percentage Error (SMAPE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################################ 9 | Symmetric Mean Absolute Percentage Error (SMAPE) 10 | ################################################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.SymmetricMeanAbsolutePercentageError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.symmetric_mean_absolute_percentage_error 22 | -------------------------------------------------------------------------------- /docs/source/regression/tweedie_deviance_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Tweedie Deviance Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ###################### 9 | Tweedie Deviance Score 10 | ###################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.TweedieDevianceScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.tweedie_deviance_score 22 | -------------------------------------------------------------------------------- /docs/source/regression/weighted_mean_absolute_percentage_error.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Weighted Mean Absolute Percentage Error (WMAPE) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Regression 5 | 6 | .. include:: ../links.rst 7 | 8 | ############# 9 | Weighted MAPE 10 | ############# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.WeightedMeanAbsolutePercentageError 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.weighted_mean_absolute_percentage_error 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/auroc.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval AUROC 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Retrieval AUROC 10 | ############### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalAUROC 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_auroc 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/fall_out.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Fall-Out 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Retrieval Fall-Out 10 | ################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalFallOut 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_fall_out 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/hit_rate.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Hit Rate 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Retrieval Hit Rate 10 | ################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalHitRate 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_hit_rate 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/map.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Mean Average Precision (MAP) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ###################################### 9 | Retrieval Mean Average Precision (MAP) 10 | ###################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalMAP 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_average_precision 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/mrr.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Mean Reciprocal Rank (MRR) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | #################################### 9 | Retrieval Mean Reciprocal Rank (MRR) 10 | #################################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalMRR 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_reciprocal_rank 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/normalized_dcg.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Normalized Discounted Cumulative Gain (DCG) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ######################## 9 | Retrieval Normalized DCG 10 | ######################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalNormalizedDCG 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_normalized_dcg 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/precision.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Precision 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ################### 9 | Retrieval Precision 10 | ################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalPrecision 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_precision 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/precision_recall_curve.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Precision Recall Curve 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ################################ 9 | Retrieval Precision Recall Curve 10 | ################################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalPrecisionRecallCurve 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_precision_recall_curve 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/r_precision.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval R-Precision 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ##################### 9 | Retrieval R-Precision 10 | ##################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalRPrecision 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_r_precision 22 | -------------------------------------------------------------------------------- /docs/source/retrieval/recall.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Retrieval Recall 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: Retrieval 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Retrieval Recall 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.retrieval.RetrievalRecall 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.retrieval.retrieval_recall 22 | -------------------------------------------------------------------------------- /docs/source/segmentation/dice.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Segmentation 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | Dice Score 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.segmentation.DiceScore 16 | :noindex: 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.segmentation.dice_score 22 | :noindex: 23 | -------------------------------------------------------------------------------- /docs/source/segmentation/generalized_dice.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Generalized Dice Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: Segmentation 5 | 6 | .. include:: ../links.rst 7 | 8 | ###################### 9 | Generalized Dice Score 10 | ###################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.segmentation.GeneralizedDiceScore 16 | :noindex: 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.segmentation.generalized_dice_score 22 | :noindex: 23 | -------------------------------------------------------------------------------- /docs/source/segmentation/hausdorff_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Hausdorff Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg 4 | :tags: segmentation 5 | 6 | .. include:: ../links.rst 7 | 8 | ################## 9 | Hausdorff Distance 10 | ################## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.segmentation.HausdorffDistance 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.segmentation.hausdorff_distance 22 | -------------------------------------------------------------------------------- /docs/source/segmentation/mean_iou.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Mean Intersection over Union (mIoU) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/object_detection.svg 4 | :tags: Segmentation 5 | 6 | ################################### 7 | Mean Intersection over Union (mIoU) 8 | ################################### 9 | 10 | Module Interface 11 | ________________ 12 | 13 | .. autoclass:: torchmetrics.segmentation.MeanIoU 14 | :exclude-members: update, compute 15 | 16 | Functional Interface 17 | ____________________ 18 | 19 | .. autofunction:: torchmetrics.functional.segmentation.mean_iou 20 | -------------------------------------------------------------------------------- /docs/source/shape/procrustes.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Procrustes Disparity 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg 4 | :tags: shape 5 | 6 | .. include:: ../links.rst 7 | 8 | #################### 9 | Procrustes Disparity 10 | #################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.shape.ProcrustesDisparity 16 | :exclude-members: update, compute 17 | 18 | 19 | Functional Interface 20 | ____________________ 21 | 22 | .. autofunction:: torchmetrics.functional.shape.procrustes_disparity 23 | -------------------------------------------------------------------------------- /docs/source/text/bert_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: BERT Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | BERT Score 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.bert.BERTScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.bert.bert_score 22 | -------------------------------------------------------------------------------- /docs/source/text/bleu_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: BLEU Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | BLEU Score 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.BLEUScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.bleu_score 22 | -------------------------------------------------------------------------------- /docs/source/text/char_error_rate.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Character Error Rate 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Char Error Rate 10 | ############### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.CharErrorRate 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.char_error_rate 22 | -------------------------------------------------------------------------------- /docs/source/text/chrf_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: ChrF Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | ChrF Score 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.CHRFScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.chrf_score 22 | -------------------------------------------------------------------------------- /docs/source/text/edit.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Edit Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ############# 9 | Edit Distance 10 | ############# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.EditDistance 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.edit_distance 22 | -------------------------------------------------------------------------------- /docs/source/text/extended_edit_distance.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Extended Edit Distance 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ###################### 9 | Extended Edit Distance 10 | ###################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.ExtendedEditDistance 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.extended_edit_distance 22 | -------------------------------------------------------------------------------- /docs/source/text/infolm.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: InfoLM 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ###### 9 | InfoLM 10 | ###### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.infolm.InfoLM 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.infolm.infolm 22 | -------------------------------------------------------------------------------- /docs/source/text/match_error_rate.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Match Error Rate 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Match Error Rate 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.MatchErrorRate 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.match_error_rate 22 | -------------------------------------------------------------------------------- /docs/source/text/perplexity.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Perplexity 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ########## 9 | Perplexity 10 | ########## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.perplexity.Perplexity 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.perplexity.perplexity 22 | -------------------------------------------------------------------------------- /docs/source/text/rouge_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: ROUGE Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ########### 9 | ROUGE Score 10 | ########### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.rouge.ROUGEScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.rouge.rouge_score 22 | -------------------------------------------------------------------------------- /docs/source/text/sacre_bleu_score.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Sacre BLEU Score 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ################ 9 | Sacre BLEU Score 10 | ################ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.SacreBLEUScore 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.sacre_bleu_score 22 | -------------------------------------------------------------------------------- /docs/source/text/squad.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: SQuAD 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ##### 9 | SQuAD 10 | ##### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.SQuAD 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.squad 22 | -------------------------------------------------------------------------------- /docs/source/text/translation_edit_rate.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Translation Edit Rate (TER) 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ########################### 9 | Translation Edit Rate (TER) 10 | ########################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.TranslationEditRate 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.translation_edit_rate 22 | -------------------------------------------------------------------------------- /docs/source/text/word_error_rate.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Word Error Rate 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Word Error Rate 10 | ############### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.WordErrorRate 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.word_error_rate 22 | -------------------------------------------------------------------------------- /docs/source/text/word_info_lost.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Word Information Lost 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Word Info. Lost 10 | ############### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.WordInfoLost 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.word_information_lost 22 | -------------------------------------------------------------------------------- /docs/source/text/word_info_preserved.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Word Information Preserved 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg 4 | :tags: Text 5 | 6 | .. include:: ../links.rst 7 | 8 | #################### 9 | Word Info. Preserved 10 | #################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.text.WordInfoPreserved 16 | :exclude-members: update, compute 17 | 18 | Functional Interface 19 | ____________________ 20 | 21 | .. autofunction:: torchmetrics.functional.text.word_information_preserved 22 | -------------------------------------------------------------------------------- /docs/source/wrappers/bootstrapper.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Bootstrapper 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | ############ 9 | Bootstrapper 10 | ############ 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.BootStrapper 16 | -------------------------------------------------------------------------------- /docs/source/wrappers/classwise_wrapper.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Classwise Wrapper 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | ################# 9 | Classwise Wrapper 10 | ################# 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.ClasswiseWrapper 16 | -------------------------------------------------------------------------------- /docs/source/wrappers/feature_share.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Feature Sharing 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Feature Sharing 10 | ############### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.FeatureShare 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/wrappers/metric_tracker.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Metric Tracker 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | ############## 9 | Metric Tracker 10 | ############## 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.MetricTracker 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/wrappers/min_max.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Min / Max 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | ######### 9 | Min / Max 10 | ######### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.MinMaxMetric 16 | -------------------------------------------------------------------------------- /docs/source/wrappers/multi_output_wrapper.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Multi-output Wrapper 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | #################### 9 | Multi-output Wrapper 10 | #################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.MultioutputWrapper 16 | -------------------------------------------------------------------------------- /docs/source/wrappers/multi_task_wrapper.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Multi-task Wrapper 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | #################### 9 | Multi-task Wrapper 10 | #################### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.MultitaskWrapper 16 | -------------------------------------------------------------------------------- /docs/source/wrappers/running.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Running 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | ####### 9 | Running 10 | ####### 11 | 12 | Module Interface 13 | ________________ 14 | 15 | .. autoclass:: torchmetrics.wrappers.Running 16 | :exclude-members: update, compute 17 | -------------------------------------------------------------------------------- /docs/source/wrappers/transformations.rst: -------------------------------------------------------------------------------- 1 | .. customcarditem:: 2 | :header: Transformations 3 | :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg 4 | :tags: Wrappers 5 | 6 | .. include:: ../links.rst 7 | 8 | ############### 9 | Transformations 10 | ############### 11 | 12 | Transformations allow for modifications to the input a metric receives by wrapping its `pred` and `target` arguments. 13 | Transformations can be implemented by either subclassing the ``MetricInputTransformer`` base class and overriding the ``.transform_pred()`` and/or ``transform_target()`` functions, or by supplying a lambda function via the ``LambdaInputTransformer``. 14 | A ``BinaryTargetTransformer`` which casts target labels to 0/1 given a threshold is provided for convenience. 15 | 16 | Module Interface 17 | ________________ 18 | 19 | .. autoclass:: torchmetrics.wrappers.MetricInputTransformer 20 | 21 | .. autoclass:: torchmetrics.wrappers.LambdaInputTransformer 22 | 23 | .. autoclass:: torchmetrics.wrappers.BinaryTargetTransformer 24 | -------------------------------------------------------------------------------- /examples/README.rst: -------------------------------------------------------------------------------- 1 | TorchMetrics' gallery 2 | ===================== 3 | 4 | Welcome to a comprehensive guide on leveraging TorchMetrics, that facilitates the precise and consistent evaluation of machine learning models. As an integral tool for developers and researchers, TorchMetrics offers an array of metrics critical for assessing model performance across a variety of applications. Whether you are fine-tuning a neural network, comparing model iterations, or tracking performance improvements, this page provides a gallery of real-world applications where Torch Metrics can be effectively implemented. 5 | 6 | By touring through this application gallery, users can gain insights into how TorchMetrics is utilized across different sectors and scale settings, empowering them with the knowledge to implement metrics effectively in their own projects. Whether your interest lies in academic research or commercial product development, the examples provided here will help demonstrate the versatility and utility of Torch Metrics in enhancing machine learning model assessment. 7 | -------------------------------------------------------------------------------- /examples/audio/README.rst: -------------------------------------------------------------------------------- 1 | Audio domain 2 | ============ 3 | 4 | Audio-domain metrics are essential for assessing the performance of models in tasks such as speech recognition, audio classification, and sound event detection. TorchMetrics offers a comprehensive set of specialized metrics tailored for these audio-specific purposes. Utilizing these metrics from TorchMetrics aids in the development of more accurate and resilient audio-based models, ensuring that performance evaluations are both meaningful and directly applicable to real-world audio tasks. 5 | -------------------------------------------------------------------------------- /examples/image/README.rst: -------------------------------------------------------------------------------- 1 | Image domain 2 | ============ 3 | 4 | Image-domain metrics are pivotal for gauging the performance of models in tasks like object detection, and segmentation. TorchMetrics provides a suite of specialized metrics designed for these purposes. Using these image-specific metrics from Torch Metrics helps in developing more precise and robust image-based models, ensuring that performance evaluations are both meaningful and directly applicable to practical vision tasks. 5 | -------------------------------------------------------------------------------- /examples/text/README.rst: -------------------------------------------------------------------------------- 1 | Text domain 2 | ============ 3 | 4 | Text-domain metrics are essential for evaluating the performance of models in tasks like text classification, summarization, and translation. TorchMetrics provides a suite of specialized metrics designed for these purposes. Using these text-specific metrics from Torch Metrics helps in developing more precise and robust text-based models, ensuring that performance evaluations are both meaningful and directly applicable to practical NLP tasks. 5 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -r requirements/base.txt 2 | -------------------------------------------------------------------------------- /requirements/README.md: -------------------------------------------------------------------------------- 1 | # Project Requirements 2 | 3 | This folder contains all requirements files for the project. The base requirements are located in the `base.txt` file. 4 | Files prefixed with `_` are only meant for development and testing purposes. In general, each subdomain of the project 5 | has a `.txt` file that contains the necessary requirements for using that subdomain and a `_test.txt` 6 | file that contains the necessary requirements for testing that subdomain. 7 | 8 | To install all extra requirements such that all tests can be run, use the following command: 9 | 10 | ```bash 11 | pip install -r requirements/_devel.txt # unittests 12 | pip install -r requiremnets/_integrate.txt # integration tests 13 | 14 | ``` 15 | 16 | To install all extra requirements so that the documentation can be built, use the following command: 17 | 18 | ```bash 19 | pip install -r requirements/_docs.txt 20 | # OR just run `make docs` 21 | ``` 22 | 23 | ## CI/CD upper bounds automation 24 | 25 | For CI stability, we have set for all package versions' upper bounds (the latest version), so with any sudden release, 26 | we won't put our development on fire. Dependabot manages the continuous updates of these upper bounds. 27 | Note that these upper bounds are lifters when installing a package from the source or as a package. 28 | If you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment. 29 | -------------------------------------------------------------------------------- /requirements/_devel.txt: -------------------------------------------------------------------------------- 1 | # use mandatory dependencies 2 | -r base.txt 3 | 4 | # add the testing dependencies 5 | -r _tests.txt 6 | 7 | # add extra requirements 8 | -r audio.txt 9 | -r detection.txt 10 | -r image.txt 11 | -r text.txt 12 | -r multimodal.txt 13 | -r visual.txt 14 | 15 | # add extra testing 16 | -r audio_test.txt 17 | -r classification_test.txt 18 | -r clustering_test.txt 19 | -r detection_test.txt 20 | -r image_test.txt 21 | -r nominal_test.txt 22 | -r regression_test.txt 23 | -r segmentation_test.txt 24 | -r text_test.txt 25 | -------------------------------------------------------------------------------- /requirements/_docs.txt: -------------------------------------------------------------------------------- 1 | sphinx ==5.3.0 2 | myst-parser ==1.0.0 3 | pandoc ==2.4 4 | docutils ==0.19 5 | sphinxcontrib-fulltoc >=1.0 6 | sphinxcontrib-mockautodoc 7 | lai-sphinx-theme # need to be downloaded from s3://sphinx-packages/ 8 | sphinx-autodoc-typehints ==1.23.0 9 | sphinx-paramlinks ==0.6.0 10 | sphinx-togglebutton ==0.3.2 11 | sphinx-copybutton ==0.5.2 12 | sphinx-autobuild ==2024.10.3 13 | sphinx-gallery ==0.19.0 14 | 15 | lightning >=1.8.0, <2.6.0 16 | lightning-utilities ==0.14.3 17 | pydantic > 1.0.0, < 3.0.0 18 | 19 | # integrations 20 | -r _integrate.txt 21 | -r audio.txt 22 | -r clustering.txt 23 | -r detection.txt 24 | -r image.txt 25 | -r multimodal.txt 26 | -r text.txt 27 | -r visual.txt 28 | 29 | # Gallery extra requirements 30 | # -------------------------- 31 | # todo: until this has resolution - https://github.com/sphinx-gallery/sphinx-gallery/issues/1290 32 | # Image 33 | scikit-image ~=0.22; python_version < "3.10" 34 | scikit-image ~=0.25; python_version > "3.9" # we do not use `> =` because of oldest replcement 35 | -------------------------------------------------------------------------------- /requirements/_doctest.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | pytest >=8.0, <9.0 5 | pytest-doctestplus >=1.0, <1.5 6 | pytest-rerunfailures >=13.0, <16.0 7 | -------------------------------------------------------------------------------- /requirements/_integrate.txt: -------------------------------------------------------------------------------- 1 | # contentiously validated integration with these expected ranges 2 | 3 | # ToDo: investigate and add validation with 2.0+ on GPU 4 | pytorch-lightning >=1.9.0, <2.6.0 5 | -------------------------------------------------------------------------------- /requirements/_tests.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | codecov ==2.1.13 5 | coverage ==7.8.* 6 | codecov ==2.1.13 7 | pytest ==8.3.* 8 | pytest-cov ==6.1.1 9 | pytest-doctestplus ==1.4.0 10 | pytest-rerunfailures ==15.1 11 | pytest-timeout ==2.4.0 12 | pytest-xdist ==3.7.0 13 | phmdoctest ==1.4.0 14 | 15 | psutil ==7.* 16 | pyGithub >2.0.0, <2.7.0 17 | fire ==0.7.* 18 | 19 | cloudpickle >1.3, <=3.1.1 20 | scikit-learn>1.5.0 21 | cachier ==3.1.2 22 | -------------------------------------------------------------------------------- /requirements/audio.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | # this need to be the same as used inside speechmetrics 5 | pesq >=0.0.4, <0.0.5 6 | pystoi >=0.4.0, <0.5.0 7 | torchaudio >=2.0.1, <2.8.0 8 | gammatone >=1.0.0, <1.1.0 9 | librosa >=0.10.0, <0.11.0 10 | onnxruntime >=1.12.0, <1.23 # installing onnxruntime_gpu-gpu failed on macos 11 | requests >=2.19.0, <2.33.0 12 | -------------------------------------------------------------------------------- /requirements/audio_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | mir-eval >=0.6, <=0.8.2 5 | fast-bss-eval >=0.1.0, <0.1.5 6 | torch_complex <0.5.0 # needed for fast-bss-eval 7 | srmrpy @ git+https://github.com/Lightning-Sandbox/SRMRpy 8 | -------------------------------------------------------------------------------- /requirements/base.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | numpy >1.20.0, <2.3.0 5 | packaging >17.1 6 | torch >=2.0.0, <2.8.0 7 | lightning-utilities >=0.8.0, <0.15.0 8 | -------------------------------------------------------------------------------- /requirements/classification_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | pandas >1.4.0, <=2.2.3 5 | netcal >1.0.0, <1.4.0 # calibration_error 6 | numpy <2.3.0 7 | fairlearn # group_fairness 8 | PyTDC ==0.4.1 ; python_version <"3.12" # locauc, temporal_dependency 9 | -------------------------------------------------------------------------------- /requirements/clustering.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | torch_linear_assignment >=0.0.2, <0.0.4 5 | -------------------------------------------------------------------------------- /requirements/clustering_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | aeon >= 1.0.0, < 1.2.0; python_version >"3.10" # cluster accuracy 5 | -------------------------------------------------------------------------------- /requirements/debug.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | -------------------------------------------------------------------------------- /requirements/detection.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | torchvision >=0.15.1, <0.23.0 5 | pycocotools >2.0.0, <2.1.0 6 | -------------------------------------------------------------------------------- /requirements/detection_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | faster-coco-eval >=1.6.3, <1.7.0 5 | -------------------------------------------------------------------------------- /requirements/image.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | scipy >1.0.0, <1.16.0 5 | torchvision >=0.15.1, <0.23.0 6 | torch-fidelity <=0.4.0 # bumping to allow install version from master, now used in testing 7 | -------------------------------------------------------------------------------- /requirements/image_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | scikit-image >=0.19.0, <0.26.0 5 | kornia >=0.6.7, <0.9.0 6 | pytorch-msssim ==1.0.0 7 | sewar >=0.4.4, <=0.4.6 8 | numpy <2.3.0 9 | torch-fidelity @ git+https://github.com/toshas/torch-fidelity@master 10 | lpips <=0.1.4 11 | dists-pytorch ==0.1 12 | -------------------------------------------------------------------------------- /requirements/integrate.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/requirements/integrate.txt -------------------------------------------------------------------------------- /requirements/multimodal.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | transformers >=4.42.3, <4.50.0 5 | piq <=0.8.0 6 | einops >=0.7.0, <=0.8.1 # CLIP dependency 7 | timm >=0.9.0, <1.1.0 # CLIP: needed for transformers/models--jinaai--jina-clip-implementation 8 | -------------------------------------------------------------------------------- /requirements/nominal_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | pandas >1.4.0, <=2.2.3 # cannot pin version due to numpy version incompatibility 5 | dython ==0.7.9 6 | scipy >1.0.0, <1.16.0 # cannot pin version due to some version conflicts with `oldest` CI configuration 7 | statsmodels >0.13.5, <0.15.0 8 | -------------------------------------------------------------------------------- /requirements/regression_test.txt: -------------------------------------------------------------------------------- 1 | permetrics==2.0.0 2 | properscoring ==0.1 3 | -------------------------------------------------------------------------------- /requirements/segmentation_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | scipy >1.0.0, <1.16.0 5 | monai ==1.4.0 6 | -------------------------------------------------------------------------------- /requirements/text.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | nltk >3.8.1, <=3.9.1 5 | tqdm <4.68.0 6 | regex >=2021.9.24, <=2024.11.6 7 | transformers >4.4.0, <4.50.0 8 | mecab-python3 >=1.0.6, <1.1.0 9 | ipadic >=1.0.0, <1.1.0 10 | sentencepiece >=0.2.0, <0.3.0 11 | -------------------------------------------------------------------------------- /requirements/text_test.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | jiwer >=2.3.0, <3.2.0 5 | rouge-score >0.1.0, <=0.1.2 6 | bert_score ==0.3.13 7 | huggingface-hub <0.33 8 | sacrebleu >=2.3.0, <2.6.0 9 | 10 | mecab-ko >=1.0.0, <1.1.0 ; python_version < "3.12" # strict # todo: unpin python_version 11 | mecab-ko-dic >=1.0.0, <1.1.0 ; python_version < "3.12" # todo: unpin python_version 12 | -------------------------------------------------------------------------------- /requirements/typing.txt: -------------------------------------------------------------------------------- 1 | mypy ==1.15.0 2 | torch ==2.7.0 3 | 4 | types-PyYAML 5 | types-emoji 6 | types-protobuf 7 | types-requests 8 | types-setuptools 9 | types-six 10 | types-tabulate 11 | types-protobuf 12 | -------------------------------------------------------------------------------- /requirements/visual.txt: -------------------------------------------------------------------------------- 1 | # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package 2 | # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment 3 | 4 | matplotlib >=3.6.0, <3.11.0 5 | SciencePlots >= 2.0.0, <2.2.0 6 | -------------------------------------------------------------------------------- /src/conftest.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | from typing import Optional 3 | 4 | from lightning_utilities.core.imports import package_available 5 | 6 | if package_available("pytest") and package_available("doctest"): 7 | import doctest 8 | 9 | import pytest 10 | 11 | MANUAL_SEED = doctest.register_optionflag("MANUAL_SEED") 12 | 13 | @pytest.fixture(autouse=True) 14 | def reset_random_seed(seed: int = 42) -> None: 15 | """Reset the random seed before running each doctest.""" 16 | import random 17 | 18 | import numpy as np 19 | import torch 20 | 21 | random.seed(seed) 22 | np.random.seed(seed) 23 | torch.manual_seed(seed) 24 | torch.cuda.manual_seed_all(seed) 25 | 26 | class DoctestModule(pytest.Module): 27 | """A custom module class that augments collected doctests with the reset_random_seed fixture.""" 28 | 29 | def collect(self) -> GeneratorExit: 30 | """Augment collected doctests with the reset_random_seed fixture.""" 31 | for item in super().collect(): 32 | if isinstance(item, pytest.DoctestItem): 33 | item.add_marker(pytest.mark.usefixtures("reset_random_seed")) 34 | yield item 35 | 36 | def pytest_collect_file(parent: Path, path: Path) -> Optional[DoctestModule]: 37 | """Collect doctests and add the reset_random_seed fixture.""" 38 | if path.ext == ".py": 39 | return DoctestModule.from_parent(parent, path=Path(path)) 40 | return None 41 | -------------------------------------------------------------------------------- /src/torchmetrics/__about__.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.8.0dev" 2 | __author__ = "Lightning-AI et al." 3 | __author_email__ = "name@pytorchlightning.ai" 4 | __license__ = "Apache-2.0" 5 | __copyright__ = f"Copyright (c) 2020-2024, {__author__}." 6 | __homepage__ = "https://github.com/Lightning-AI/torchmetrics" 7 | __docs__ = "PyTorch native Metrics" 8 | __docs_url__ = "https://lightning.ai/docs/torchmetrics/stable/" 9 | __long_doc__ = """ 10 | Torchmetrics is a metrics API created for easy metric development and usage in both PyTorch and 11 | [PyTorch Lightning](https://lightning.ai/docs/pytorch/stable/). It was originally a part of 12 | Pytorch Lightning, but got split off so users could take advantage of the large collection of metrics 13 | implemented without having to install Pytorch Lightning (even though we would love for you to try it out). 14 | We currently have around 100+ metrics implemented and we continuously are adding more metrics, both within 15 | already covered domains (classification, regression etc.) but also new domains (object detection etc.). 16 | We make sure that all our metrics are rigorously tested such that you can trust them. 17 | """ 18 | 19 | __all__ = [ 20 | "__author__", 21 | "__author_email__", 22 | "__copyright__", 23 | "__docs__", 24 | "__docs_url__", 25 | "__homepage__", 26 | "__license__", 27 | "__version__", 28 | ] 29 | -------------------------------------------------------------------------------- /src/torchmetrics/classification/base.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from typing import Any 15 | 16 | from torchmetrics.metric import Metric 17 | 18 | 19 | class _ClassificationTaskWrapper(Metric): 20 | """Base class for wrapper metrics for classification tasks.""" 21 | 22 | def update(self, *args: Any, **kwargs: Any) -> None: 23 | """Update metric state.""" 24 | raise NotImplementedError( 25 | f"{self.__class__.__name__} metric does not have a global `update` method. Use the task specific metric." 26 | ) 27 | 28 | def compute(self) -> None: 29 | """Compute metric.""" 30 | raise NotImplementedError( 31 | f"{self.__class__.__name__} metric does not have a global `compute` method. Use the task specific metric." 32 | ) 33 | -------------------------------------------------------------------------------- /src/torchmetrics/detection/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.detection.panoptic_qualities import ModifiedPanopticQuality, PanopticQuality 15 | from torchmetrics.utilities.imports import _TORCHVISION_AVAILABLE 16 | 17 | __all__ = ["ModifiedPanopticQuality", "PanopticQuality"] 18 | 19 | if _TORCHVISION_AVAILABLE: 20 | from torchmetrics.detection.ciou import CompleteIntersectionOverUnion 21 | from torchmetrics.detection.diou import DistanceIntersectionOverUnion 22 | from torchmetrics.detection.giou import GeneralizedIntersectionOverUnion 23 | from torchmetrics.detection.iou import IntersectionOverUnion 24 | from torchmetrics.detection.mean_ap import MeanAveragePrecision 25 | 26 | __all__ += [ 27 | "CompleteIntersectionOverUnion", 28 | "DistanceIntersectionOverUnion", 29 | "GeneralizedIntersectionOverUnion", 30 | "IntersectionOverUnion", 31 | "MeanAveragePrecision", 32 | ] 33 | -------------------------------------------------------------------------------- /src/torchmetrics/functional/detection/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The PyTorch Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from torchmetrics.functional.detection.panoptic_qualities import modified_panoptic_quality, panoptic_quality 16 | from torchmetrics.utilities.imports import ( 17 | _TORCHVISION_AVAILABLE, 18 | ) 19 | 20 | __all__ = ["modified_panoptic_quality", "panoptic_quality"] 21 | 22 | if _TORCHVISION_AVAILABLE: 23 | from torchmetrics.functional.detection.ciou import complete_intersection_over_union 24 | from torchmetrics.functional.detection.diou import distance_intersection_over_union 25 | from torchmetrics.functional.detection.giou import generalized_intersection_over_union 26 | from torchmetrics.functional.detection.iou import intersection_over_union 27 | from torchmetrics.functional.detection.map import mean_average_precision 28 | 29 | __all__ += [ 30 | "complete_intersection_over_union", 31 | "distance_intersection_over_union", 32 | "generalized_intersection_over_union", 33 | "intersection_over_union", 34 | "mean_average_precision", 35 | ] 36 | -------------------------------------------------------------------------------- /src/torchmetrics/functional/image/dists_models/weights.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/src/torchmetrics/functional/image/dists_models/weights.pt -------------------------------------------------------------------------------- /src/torchmetrics/functional/image/lpips_models/alex.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/src/torchmetrics/functional/image/lpips_models/alex.pth -------------------------------------------------------------------------------- /src/torchmetrics/functional/image/lpips_models/squeeze.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/src/torchmetrics/functional/image/lpips_models/squeeze.pth -------------------------------------------------------------------------------- /src/torchmetrics/functional/image/lpips_models/vgg.pth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/src/torchmetrics/functional/image/lpips_models/vgg.pth -------------------------------------------------------------------------------- /src/torchmetrics/functional/multimodal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.functional.multimodal.lve import lip_vertex_error 15 | from torchmetrics.utilities.imports import _TRANSFORMERS_GREATER_EQUAL_4_10 16 | 17 | __all__ = ["lip_vertex_error"] 18 | 19 | if _TRANSFORMERS_GREATER_EQUAL_4_10: 20 | from torchmetrics.functional.multimodal.clip_iqa import clip_image_quality_assessment 21 | from torchmetrics.functional.multimodal.clip_score import clip_score 22 | 23 | __all__ += ["clip_image_quality_assessment", "clip_score"] 24 | -------------------------------------------------------------------------------- /src/torchmetrics/functional/nominal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from torchmetrics.functional.nominal.cramers import cramers_v, cramers_v_matrix 16 | from torchmetrics.functional.nominal.fleiss_kappa import fleiss_kappa 17 | from torchmetrics.functional.nominal.pearson import ( 18 | pearsons_contingency_coefficient, 19 | pearsons_contingency_coefficient_matrix, 20 | ) 21 | from torchmetrics.functional.nominal.theils_u import theils_u, theils_u_matrix 22 | from torchmetrics.functional.nominal.tschuprows import tschuprows_t, tschuprows_t_matrix 23 | 24 | __all__ = [ 25 | "cramers_v", 26 | "cramers_v_matrix", 27 | "fleiss_kappa", 28 | "pearsons_contingency_coefficient", 29 | "pearsons_contingency_coefficient_matrix", 30 | "theils_u", 31 | "theils_u_matrix", 32 | "tschuprows_t", 33 | "tschuprows_t_matrix", 34 | ] 35 | -------------------------------------------------------------------------------- /src/torchmetrics/functional/pairwise/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.functional.pairwise.cosine import pairwise_cosine_similarity 15 | from torchmetrics.functional.pairwise.euclidean import pairwise_euclidean_distance 16 | from torchmetrics.functional.pairwise.linear import pairwise_linear_similarity 17 | from torchmetrics.functional.pairwise.manhattan import pairwise_manhattan_distance 18 | from torchmetrics.functional.pairwise.minkowski import pairwise_minkowski_distance 19 | 20 | __all__ = [ 21 | "pairwise_cosine_similarity", 22 | "pairwise_euclidean_distance", 23 | "pairwise_linear_similarity", 24 | "pairwise_manhattan_distance", 25 | "pairwise_minkowski_distance", 26 | ] 27 | -------------------------------------------------------------------------------- /src/torchmetrics/functional/segmentation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.functional.segmentation.dice import dice_score 15 | from torchmetrics.functional.segmentation.generalized_dice import generalized_dice_score 16 | from torchmetrics.functional.segmentation.hausdorff_distance import hausdorff_distance 17 | from torchmetrics.functional.segmentation.mean_iou import mean_iou 18 | 19 | __all__ = ["dice_score", "generalized_dice_score", "hausdorff_distance", "mean_iou"] 20 | -------------------------------------------------------------------------------- /src/torchmetrics/functional/shape/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.functional.shape.procrustes import procrustes_disparity 15 | 16 | __all__ = ["procrustes_disparity"] 17 | -------------------------------------------------------------------------------- /src/torchmetrics/multimodal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.multimodal.lve import LipVertexError 15 | from torchmetrics.utilities.imports import _TRANSFORMERS_GREATER_EQUAL_4_10 16 | 17 | __all__ = ["LipVertexError"] 18 | 19 | if _TRANSFORMERS_GREATER_EQUAL_4_10: 20 | from torchmetrics.multimodal.clip_iqa import CLIPImageQualityAssessment 21 | from torchmetrics.multimodal.clip_score import CLIPScore 22 | 23 | __all__ += ["CLIPImageQualityAssessment", "CLIPScore"] 24 | -------------------------------------------------------------------------------- /src/torchmetrics/nominal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from torchmetrics.nominal.cramers import CramersV 16 | from torchmetrics.nominal.fleiss_kappa import FleissKappa 17 | from torchmetrics.nominal.pearson import PearsonsContingencyCoefficient 18 | from torchmetrics.nominal.theils_u import TheilsU 19 | from torchmetrics.nominal.tschuprows import TschuprowsT 20 | 21 | __all__ = [ 22 | "CramersV", 23 | "FleissKappa", 24 | "PearsonsContingencyCoefficient", 25 | "TheilsU", 26 | "TschuprowsT", 27 | ] 28 | -------------------------------------------------------------------------------- /src/torchmetrics/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/src/torchmetrics/py.typed -------------------------------------------------------------------------------- /src/torchmetrics/segmentation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.segmentation.dice import DiceScore 15 | from torchmetrics.segmentation.generalized_dice import GeneralizedDiceScore 16 | from torchmetrics.segmentation.hausdorff_distance import HausdorffDistance 17 | from torchmetrics.segmentation.mean_iou import MeanIoU 18 | 19 | __all__ = ["DiceScore", "GeneralizedDiceScore", "HausdorffDistance", "MeanIoU"] 20 | -------------------------------------------------------------------------------- /src/torchmetrics/shape/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.shape.procrustes import ProcrustesDisparity 15 | 16 | __all__ = ["ProcrustesDisparity"] 17 | -------------------------------------------------------------------------------- /src/torchmetrics/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.utilities.checks import check_forward_full_state_property 15 | from torchmetrics.utilities.data import ( 16 | dim_zero_cat, 17 | dim_zero_max, 18 | dim_zero_mean, 19 | dim_zero_min, 20 | dim_zero_sum, 21 | ) 22 | from torchmetrics.utilities.distributed import class_reduce, reduce 23 | from torchmetrics.utilities.prints import rank_zero_debug, rank_zero_info, rank_zero_warn 24 | 25 | __all__ = [ 26 | "check_forward_full_state_property", 27 | "class_reduce", 28 | "dim_zero_cat", 29 | "dim_zero_max", 30 | "dim_zero_mean", 31 | "dim_zero_min", 32 | "dim_zero_sum", 33 | "rank_zero_debug", 34 | "rank_zero_info", 35 | "rank_zero_warn", 36 | "reduce", 37 | ] 38 | -------------------------------------------------------------------------------- /src/torchmetrics/utilities/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | class TorchMetricsUserError(Exception): 17 | """Error used to inform users of a wrong combination of Metric API calls.""" 18 | 19 | 20 | class TorchMetricsUserWarning(Warning): 21 | """Error used to inform users of specific warnings due to the torchmetrics API.""" 22 | -------------------------------------------------------------------------------- /src/torchmetrics/wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from torchmetrics.wrappers.bootstrapping import BootStrapper 15 | from torchmetrics.wrappers.classwise import ClasswiseWrapper 16 | from torchmetrics.wrappers.feature_share import FeatureShare 17 | from torchmetrics.wrappers.minmax import MinMaxMetric 18 | from torchmetrics.wrappers.multioutput import MultioutputWrapper 19 | from torchmetrics.wrappers.multitask import MultitaskWrapper 20 | from torchmetrics.wrappers.running import Running 21 | from torchmetrics.wrappers.tracker import MetricTracker 22 | from torchmetrics.wrappers.transformations import ( 23 | BinaryTargetTransformer, 24 | LambdaInputTransformer, 25 | MetricInputTransformer, 26 | ) 27 | 28 | __all__ = [ 29 | "BinaryTargetTransformer", 30 | "BootStrapper", 31 | "ClasswiseWrapper", 32 | "FeatureShare", 33 | "LambdaInputTransformer", 34 | "MetricInputTransformer", 35 | "MetricTracker", 36 | "MinMaxMetric", 37 | "MultioutputWrapper", 38 | "MultitaskWrapper", 39 | "Running", 40 | ] 41 | -------------------------------------------------------------------------------- /tests/integrations/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | _INTEGRATION_ROOT = os.path.realpath(os.path.dirname(__file__)) 4 | _PACKAGE_ROOT = os.path.dirname(_INTEGRATION_ROOT) 5 | _PATH_DATASETS = os.path.join(_PACKAGE_ROOT, "datasets") 6 | -------------------------------------------------------------------------------- /tests/integrations/conftest.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from pathlib import Path 15 | 16 | import pytest 17 | 18 | # GitHub Actions use this path to cache datasets. 19 | # Use `datadir` fixture where possible and use `DATASETS_PATH` in 20 | # `pytest.mark.parametrize()` where you cannot use `datadir`. 21 | # https://github.com/pytest-dev/pytest/issues/349 22 | from integrations import _PATH_DATASETS 23 | 24 | 25 | @pytest.fixture(scope="session") 26 | def datadir(): 27 | """Global data dir for location of datasets.""" 28 | return Path(_PATH_DATASETS) 29 | 30 | 31 | def pytest_configure(config): 32 | """Local configuration of pytest.""" 33 | config.addinivalue_line("markers", "spawn: spawn test in a separate process using torch.multiprocessing.spawn") 34 | -------------------------------------------------------------------------------- /tests/integrations/lightning/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/integrations/lightning/__init__.py -------------------------------------------------------------------------------- /tests/unittests/_helpers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import random 15 | 16 | import numpy 17 | import torch 18 | 19 | from unittests._helpers.wrappers import skip_on_connection_issues, skip_on_cuda_oom, skip_on_running_out_of_memory 20 | 21 | 22 | def seed_all(seed): 23 | """Set the seed of all computational frameworks.""" 24 | random.seed(seed) 25 | numpy.random.seed(seed) 26 | torch.manual_seed(seed) 27 | torch.cuda.manual_seed_all(seed) 28 | 29 | 30 | __all__ = ["seed_all", "skip_on_connection_issues", "skip_on_cuda_oom", "skip_on_running_out_of_memory"] 31 | -------------------------------------------------------------------------------- /tests/unittests/audio/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from typing import Callable, Optional 3 | 4 | from torch import Tensor 5 | 6 | from unittests import _PATH_ALL_TESTS 7 | 8 | _SAMPLE_AUDIO_SPEECH = os.path.join(_PATH_ALL_TESTS, "_data", "audio", "audio_speech.wav") 9 | _SAMPLE_AUDIO_SPEECH_BAB_DB = os.path.join(_PATH_ALL_TESTS, "_data", "audio", "audio_speech_bab_0dB.wav") 10 | _SAMPLE_NUMPY_ISSUE_895 = os.path.join(_PATH_ALL_TESTS, "_data", "audio", "issue_895.npz") 11 | 12 | 13 | def _average_metric_wrapper( 14 | preds: Tensor, target: Tensor, metric_func: Callable, res_index: Optional[int] = None 15 | ) -> Tensor: 16 | """Average the metric values. 17 | 18 | Args: 19 | preds: predictions, shape[batch, spk, time] 20 | target: targets, shape[batch, spk, time] 21 | metric_func: a function which return best_metric and best_perm 22 | res_index: if not None, return best_metric[res_index] 23 | 24 | Returns: 25 | the average of best_metric 26 | 27 | """ 28 | if res_index is not None: 29 | return metric_func(preds, target)[res_index].mean() 30 | return metric_func(preds, target).mean() 31 | -------------------------------------------------------------------------------- /tests/unittests/bases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/bases/__init__.py -------------------------------------------------------------------------------- /tests/unittests/bases/test_hashing.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from unittests._helpers.testers import DummyListMetric, DummyMetric 4 | 5 | 6 | @pytest.mark.parametrize( 7 | "metric_cls", 8 | [ 9 | DummyMetric, 10 | DummyListMetric, 11 | ], 12 | ) 13 | def test_metric_hashing(metric_cls): 14 | """Tests that hashes are different. 15 | 16 | See the Metric's hash function for details on why this is required. 17 | 18 | """ 19 | instance_1 = metric_cls() 20 | instance_2 = metric_cls() 21 | 22 | assert hash(instance_1) != hash(instance_2) 23 | assert id(instance_1) != id(instance_2) 24 | -------------------------------------------------------------------------------- /tests/unittests/classification/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/classification/__init__.py -------------------------------------------------------------------------------- /tests/unittests/clustering/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/clustering/__init__.py -------------------------------------------------------------------------------- /tests/unittests/deprecations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/deprecations/__init__.py -------------------------------------------------------------------------------- /tests/unittests/detection/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from unittests import _PATH_ALL_TESTS 4 | 5 | _SAMPLE_DETECTION_SEGMENTATION = os.path.join( 6 | _PATH_ALL_TESTS, "_data", "detection", "instance_segmentation_inputs.json" 7 | ) 8 | _DETECTION_VAL = os.path.join(_PATH_ALL_TESTS, "_data", "detection", "instances_val2014_100.json") 9 | _DETECTION_BBOX = os.path.join(_PATH_ALL_TESTS, "_data", "detection", "instances_val2014_fakebbox100_results.json") 10 | _DETECTION_SEGM = os.path.join(_PATH_ALL_TESTS, "_data", "detection", "instances_val2014_fakesegm100_results.json") 11 | -------------------------------------------------------------------------------- /tests/unittests/image/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The PyTorch Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import os 15 | 16 | from unittests import _PATH_ALL_TESTS 17 | 18 | _SAMPLE_IMAGE = os.path.join(_PATH_ALL_TESTS, "_data", "image", "i01_01_5.bmp") 19 | -------------------------------------------------------------------------------- /tests/unittests/multimodal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/multimodal/__init__.py -------------------------------------------------------------------------------- /tests/unittests/nominal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/nominal/__init__.py -------------------------------------------------------------------------------- /tests/unittests/pairwise/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/pairwise/__init__.py -------------------------------------------------------------------------------- /tests/unittests/regression/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/regression/__init__.py -------------------------------------------------------------------------------- /tests/unittests/retrieval/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/retrieval/__init__.py -------------------------------------------------------------------------------- /tests/unittests/segmentation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unittests/shape/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright The Lightning team. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unittests/text/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/text/__init__.py -------------------------------------------------------------------------------- /tests/unittests/wrappers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lightning-AI/torchmetrics/5b8b757c71d1b0f0f056c0df63e3fd772974e8b0/tests/unittests/wrappers/__init__.py --------------------------------------------------------------------------------