Search is not available for this dataset
repo_id
stringlengths
12
110
file_path
stringlengths
24
164
content
stringlengths
3
89.3M
__index_level_0__
int64
0
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pyplots/tracker_binary.py
import matplotlib.pyplot as plt import torch import torchmetrics N = 10 num_updates = 10 num_steps = 5 w = torch.tensor([0.2, 0.8]) target = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) preds = lambda it: (it * torch.randn(100)).sigmoid() confmat = torchmetrics.ConfusionMatrix(task=...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pyplots/collection_binary_together.py
import matplotlib.pyplot as plt import torch import torchmetrics N = 10 num_updates = 10 num_steps = 5 w = torch.tensor([0.2, 0.8]) target = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) preds = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) collection ...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pyplots/binary_accuracy_multistep.py
import matplotlib.pyplot as plt import torch import torchmetrics N = 10 num_updates = 10 num_steps = 5 w = torch.tensor([0.2, 0.8]) target = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) preds = lambda it: torch.multinomial((it * w).softmax(dim=-1), 100, replacement=True) fig, ax = p...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/_templates/theme_variables.jinja
{%- set external_urls = { 'github': 'https://github.com/Lightning-AI/torchmetrics', 'github_issues': 'https://github.com/Lightning-AI/torchmetrics/issues', 'contributing': 'https://github.com/Lightning-AI/torchmetrics/blob/master/.github/CONTRIBUTING.md', 'docs': 'https://lightning.ai/docs/torchmetrics/latest',...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/_templates/classtemplate.rst
.. role:: hidden :class: hidden-section .. currentmodule:: {{ module }} {{ name | underline}} .. autoclass:: {{ name }} :members: .. autogenerated from source/_templates/classtemplate.rst note it does not have :inherited-members:
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/_templates/layout.html
{% extends "!layout.html" %} <link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html" /> {% block footer %} {{ super() }} <script script type="text/javascript"> var collapsedSections = [ "Audio", "Classification", "Image", "Detection", "Pairwise", "Regression", "Retrieval...
0
public_repos/torchmetrics/docs/source/_templates
public_repos/torchmetrics/docs/source/_templates/autosummary/module.rst
{{ name | escape | underline }} .. currentmodule:: {{ fullname }} {% block functions %} {% if functions %} .. rubric:: Functions .. autosummary:: :nosignatures: {% for item in functions %} {{ item }} {%- endfor %} {% endif %} {% endblock %} {% block classes %} {% if classes %} .. rubric:: Classes .. autosu...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/_static/copybutton.js
/* Copied from the official Python docs: https://docs.python.org/3/_static/copybutton.js */ $(document).ready(function () { /* Add a [>>>] button on the top-right corner of code samples to hide * the >>> and ... prompts and the output and thus make the code * copyable. */ var div = $( ".highlight-python ....
0
public_repos/torchmetrics/docs/source/_static
public_repos/torchmetrics/docs/source/_static/images/logo.svg
<svg width="390" height="100" viewBox="0 0 390 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_402_94)"> <path d="M41.5646 0.591703L1.76872 23.6686C1.17915 23.9645 0.88437 24.5562 0.294801 25.1479C0.0547165 25.7069 -0.0464476 26.3161 1.54153e-05 26.9231V73.0769C0.0610756 73.7056 0.262599 7...
0
public_repos/torchmetrics/docs/source/_static
public_repos/torchmetrics/docs/source/_static/images/logo_light.svg
<svg width="202" height="42" viewBox="0 0 202 42" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M0 10.5L17.9393 0L35.88 10.5V31.5L17.94 42L0 31.5V10.5ZM17 15V26H15L15 15H17ZM26 27H10V29H26V27ZM25 13V26H23V13H25ZM13 26V21H11V26H13ZM19 26V17H21V26H19Z" fill="#792EE5"/> <...
0
public_repos/torchmetrics/docs/source/_static
public_repos/torchmetrics/docs/source/_static/images/icon.svg
<svg width="87" height="101" viewBox="0 0 87 101" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_4_50)"> <path d="M41.5884 0.710874L1.79245 23.7878C1.20288 24.0837 0.908094 24.6754 0.318525 25.2671C0.0784401 25.8261 -0.022724 26.4353 0.023739 27.0422V73.1961C0.0847992 73.8248 0.286322 74.4315 ...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/word_info_preserved.rst
.. customcarditem:: :header: Word Information Preserved :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst #################### Word Info. Preserved #################### Module Interface ________________ .. autoclass:: torchmetrics.text....
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/edit.rst
.. customcarditem:: :header: Edit Distance :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ############# Edit Distance ############# Module Interface ________________ .. autoclass:: torchmetrics.text.EditDistance :exclude-members:...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/char_error_rate.rst
.. customcarditem:: :header: Character Error Rate :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ############### Char Error Rate ############### Module Interface ________________ .. autoclass:: torchmetrics.text.CharErrorRate :ex...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/word_info_lost.rst
.. customcarditem:: :header: Word Information Lost :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ############### Word Info. Lost ############### Module Interface ________________ .. autoclass:: torchmetrics.text.WordInfoLost :ex...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/squad.rst
.. customcarditem:: :header: SQuAD :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ##### SQuAD ##### Module Interface ________________ .. autoclass:: torchmetrics.text.SQuAD :exclude-members: update, compute Functional Interface ...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/rouge_score.rst
.. customcarditem:: :header: ROUGE Score :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ########### ROUGE Score ########### Module Interface ________________ .. autoclass:: torchmetrics.text.rouge.ROUGEScore :exclude-members: upd...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/translation_edit_rate.rst
.. customcarditem:: :header: Translation Edit Rate (TER) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ########################### Translation Edit Rate (TER) ########################### Module Interface ________________ .. autoclas...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/bert_score.rst
.. customcarditem:: :header: BERT Score :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ########## BERT Score ########## Module Interface ________________ .. autoclass:: torchmetrics.text.bert.BERTScore :exclude-members: update, c...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/perplexity.rst
.. customcarditem:: :header: Perplexity :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ########## Perplexity ########## Module Interface ________________ .. autoclass:: torchmetrics.text.perplexity.Perplexity :exclude-members: up...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/extended_edit_distance.rst
.. customcarditem:: :header: Extended Edit Distance :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ###################### Extended Edit Distance ###################### Module Interface ________________ .. autoclass:: torchmetrics.tex...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/bleu_score.rst
.. customcarditem:: :header: BLEU Score :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ########## BLEU Score ########## Module Interface ________________ .. autoclass:: torchmetrics.text.BLEUScore :exclude-members: update, comput...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/sacre_bleu_score.rst
.. customcarditem:: :header: Sacre BLEU Score :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ################ Sacre BLEU Score ################ Module Interface ________________ .. autoclass:: torchmetrics.text.SacreBLEUScore :ex...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/infolm.rst
.. customcarditem:: :header: InfoLM :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ###### InfoLM ###### Module Interface ________________ .. autoclass:: torchmetrics.text.infolm.InfoLM :exclude-members: update, compute Functiona...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/match_error_rate.rst
.. customcarditem:: :header: Match Error Rate :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ################ Match Error Rate ################ Module Interface ________________ .. autoclass:: torchmetrics.text.MatchErrorRate :ex...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/chrf_score.rst
.. customcarditem:: :header: ChrF Score :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ########## ChrF Score ########## Module Interface ________________ .. autoclass:: torchmetrics.text.CHRFScore :exclude-members: update, comput...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/text/word_error_rate.rst
.. customcarditem:: :header: Word Error Rate :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/summarization.svg :tags: Text .. include:: ../links.rst ############### Word Error Rate ############### Module Interface ________________ .. autoclass:: torchmetrics.text.WordErrorRate :exclude...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/wrappers/running.rst
.. customcarditem:: :header: Running :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg :tags: Wrappers .. include:: ../links.rst ####### Running ####### Module Interface ________________ .. autoclass:: torchmetrics.wrappers.Running :exclude-members: update, compu...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/wrappers/classwise_wrapper.rst
.. customcarditem:: :header: Classwise Wrapper :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg :tags: Wrappers .. include:: ../links.rst ################# Classwise Wrapper ################# Module Interface ________________ .. autoclass:: torchmetrics.wrappers.Cla...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/wrappers/min_max.rst
.. customcarditem:: :header: Min / Max :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg :tags: Wrappers .. include:: ../links.rst ######### Min / Max ######### Module Interface ________________ .. autoclass:: torchmetrics.wrappers.MinMaxMetric
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/wrappers/bootstrapper.rst
.. customcarditem:: :header: Bootstrapper :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg :tags: Wrappers .. include:: ../links.rst ############ Bootstrapper ############ Module Interface ________________ .. autoclass:: torchmetrics.wrappers.BootStrapper
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/wrappers/metric_tracker.rst
.. customcarditem:: :header: Metric Tracker :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg :tags: Wrappers .. include:: ../links.rst ############## Metric Tracker ############## Module Interface ________________ .. autoclass:: torchmetrics.wrappers.MetricTracker ...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/wrappers/multi_task_wrapper.rst
.. customcarditem:: :header: Multi-task Wrapper :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg :tags: Wrappers .. include:: ../links.rst #################### Multi-task Wrapper #################### Module Interface ________________ .. autoclass:: torchmetrics.wrap...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/wrappers/multi_output_wrapper.rst
.. customcarditem:: :header: Multi-output Wrapper :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/graph_classification.svg :tags: Wrappers .. include:: ../links.rst #################### Multi-output Wrapper #################### Module Interface ________________ .. autoclass:: torchmetrics....
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/complex_scale_invariant_signal_noise_ratio.rst
.. customcarditem:: :header: Complex Scale-Invariant Signal-to-Noise Ratio (C-SI-SNR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ######################################################## Complex Scale-Invariant Signal-to-Noi...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/signal_noise_ratio.rst
.. customcarditem:: :header: Signal-to-Noise Ratio (SNR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ########################### Signal-to-Noise Ratio (SNR) ########################### Module Interface ________________ .. ...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/scale_invariant_signal_noise_ratio.rst
.. customcarditem:: :header: Scale-Invariant Signal-to-Noise Ratio (SI-SNR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ############################################## Scale-Invariant Signal-to-Noise Ratio (SI-SNR) ##########...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/speech_reverberation_modulation_energy_ratio.rst
.. customcarditem:: :header: Speech-to-Reverberation Modulation Energy Ratio (SRMR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ###################################################### Speech-to-Reverberation Modulation Energy...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/scale_invariant_signal_distortion_ratio.rst
.. customcarditem:: :header: Scale-Invariant Signal-to-Distortion Ratio (SI-SDR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ################################################### Scale-Invariant Signal-to-Distortion Ratio (SI-...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/permutation_invariant_training.rst
.. customcarditem:: :header: Permutation Invariant Training (PIT) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst #################################### Permutation Invariant Training (PIT) #################################### Mo...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/signal_distortion_ratio.rst
.. customcarditem:: :header: Signal to Distortion Ratio (SDR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ################################ Signal to Distortion Ratio (SDR) ################################ Module Interface _...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/short_time_objective_intelligibility.rst
.. customcarditem:: :header: Short-Time Objective Intelligibility (STOI) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ########################################### Short-Time Objective Intelligibility (STOI) ###################...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/source_aggregated_signal_distortion_ratio.rst
.. customcarditem:: :header: Source Aggregated Signal-to-Distortion Ratio (SA-SDR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ##################################################### Source Aggregated Signal-to-Distortion Rati...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/audio/perceptual_evaluation_speech_quality.rst
.. customcarditem:: :header: Perceptual Evaluation of Speech Quality (PESQ) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/audio_classification.svg :tags: Audio .. include:: ../links.rst ############################################## Perceptual Evaluation of Speech Quality (PESQ) ##########...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/references/utilities.rst
.. role:: hidden :class: hidden-section ###################### torchmetrics.utilities ###################### In the following is listed public utility functions that may be beneficial to use in your own code. These functions are not part of the public API and may change at any time. *************************** t...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/references/metric.rst
.. role:: hidden :class: hidden-section ################### torchmetrics.Metric ################### The base ``Metric`` class is an abstract base class that are used as the building block for all other Module metrics. .. autoclass:: torchmetrics.Metric
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/r_precision.rst
.. customcarditem:: :header: Retrieval R-Precision :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ##################### Retrieval R-Precision ##################### Module Interface ________________ .. autoclass:: torchmetr...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/mrr.rst
.. customcarditem:: :header: Retrieval Mean Reciprocal Rank (MRR) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst #################################### Retrieval Mean Reciprocal Rank (MRR) #################################### ...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/map.rst
.. customcarditem:: :header: Retrieval Mean Average Precision (MAP) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ###################################### Retrieval Mean Average Precision (MAP) ###############################...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/fall_out.rst
.. customcarditem:: :header: Retrieval Fall-Out :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ################## Retrieval Fall-Out ################## Module Interface ________________ .. autoclass:: torchmetrics.retrieva...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/recall.rst
.. customcarditem:: :header: Retrieval Recall :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ################ Retrieval Recall ################ Module Interface ________________ .. autoclass:: torchmetrics.retrieval.Retrie...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/hit_rate.rst
.. customcarditem:: :header: Retrieval Hit Rate :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ################## Retrieval Hit Rate ################## Module Interface ________________ .. autoclass:: torchmetrics.retrieva...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/precision.rst
.. customcarditem:: :header: Retrieval Precision :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ################### Retrieval Precision ################### Module Interface ________________ .. autoclass:: torchmetrics.retr...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/normalized_dcg.rst
.. customcarditem:: :header: Retrieval Normalized Discounted Cumulative Gain (DCG) :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ######################## Retrieval Normalized DCG ######################## Module Interface _...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/retrieval/precision_recall_curve.rst
.. customcarditem:: :header: Precision Recall Curve :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/text_classification.svg :tags: Retrieval .. include:: ../links.rst ###################### Precision Recall Curve ###################### Module Interface ________________ .. autoclass:: torch...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/multimodal/clip_score.rst
.. customcarditem:: :header: CLIP Score :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg :tags: Image .. include:: ../links.rst ########## CLIP Score ########## Module Interface ________________ .. autoclass:: torchmetrics.multimodal.clip_score.CLIPScore Functional...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/multimodal/clip_iqa.rst
.. customcarditem:: :header: CLIP IQA :image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/image_classification.svg :tags: Image .. include:: ../links.rst ######################################## CLIP Image Quality Assessment (CLIP-IQA) ######################################## Module Interface _...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pages/lightning.rst
.. testsetup:: * import torch from torch.nn import Module from lightning.pytorch import LightningModule from torchmetrics import Metric ################################# TorchMetrics in PyTorch Lightning ################################# TorchMetrics was originally created as part of `PyTorch Lightni...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pages/quickstart.rst
########### Quick Start ########### TorchMetrics is a collection of 100+ PyTorch metrics implementations and an easy-to-use API to create custom metrics. It offers: * A standardized interface to increase reproducibility * Reduces Boilerplate * Distributed-training compatible * Rigorously tested * Automatic accumulati...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pages/overview.rst
.. testsetup:: * import torch from lightning.pytorch import LightningModule ################## Structure Overview ################## TorchMetrics is a Metrics API created for easy metric development and usage in PyTorch and PyTorch Lightning. It is rigorously tested for all edge cases and includes a growing ...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pages/implement.rst
.. _implement: .. testsetup:: * from typing import Optional, Sequence, Union from torch import Tensor ##################### Implementing a Metric ##################### While we strive to include as many metrics as possible in ``torchmetrics``, we cannot include them all. Therefore, we have made it easy to i...
0
public_repos/torchmetrics/docs/source
public_repos/torchmetrics/docs/source/pages/plotting.rst
.. _plotting: .. testsetup:: * import torch import matplotlib import matplotlib.pyplot as plt import torchmetrics ######## Plotting ######## .. note:: The visualization/plotting interface of Torchmetrics requires ``matplotlib`` to be installed. Install with either ``pip install matplotlib`` ...
0
public_repos/torchmetrics/docs
public_repos/torchmetrics/docs/paper_JOSS/paper.md
--- title: TorchMetrics - Measuring Reproducibility in PyTorch tags: - python - deep learning - pytorch authors: - name: Nicki Skafte Detlefsen affiliation: '1,2' orcid: 0000-0002-8133-682X - name: Jiri Borovec affiliation: '1' orcid: 0000-0001-7437-824X - name: Justus Schock affiliation...
0
public_repos/torchmetrics/docs
public_repos/torchmetrics/docs/paper_JOSS/paper.bib
@misc{reproducibility, title={Enabling End-To-End Machine Learning Replicability: A Case Study in Educational Data Mining}, author={Josh Gardner and Yuming Yang and Ryan Baker and Christopher Brooks}, year={2018}, eprint={1806.05208}, archivePrefix={arXiv}, primaryClass={cs.CY} } @inproceedings...
0
public_repos
public_repos/twitter-finetune/app.py
import langchain import streamlit as st from langchain.prompts import ChatPromptTemplate from langchain.chat_models import ChatOpenAI from langchain.schema.output_parser import StrOutputParser from langchain.callbacks.tracers.langchain import wait_for_all_tracers from langchain.callbacks.tracers.run_collector import Ru...
0
public_repos
public_repos/twitter-finetune/requirements.txt
openai langchain streamlit streamlit_feedback
0
public_repos
public_repos/twitter-finetune/README.md
# Twitter Finetune This repo shows how to finetune GPT-3.5-Turbo on tweets. Specifically, Elon Musk's tweets. In this example, data is first exported from Twitter using [Apify](https://apify.com/). A copy of this data can be found in [dataset_twitter-scraper_2023-08-23_22-13-19-740.json](dataset_twitter-scraper_2023-...
0
public_repos
public_repos/twitter-finetune/dataset_twitter-scraper_2023-08-23_22-13-19-740.json
[{ "username": "elonmusk", "user_id": "44196397", "id": "1519480761749016577", "conversation_id": "1519480761749016577", "full_text": "Next I’m buying Coca-Cola to put the cocaine back in", "reply_count": 187291, "retweet_count": 648962, "favorite_count": 4596262, "hashtags": [], "symbols": [], "u...
0
public_repos
public_repos/twitter-finetune/ingest.py
import json from langchain.schema import AIMessage from langchain.adapters.openai import convert_message_to_dict import time import openai from io import BytesIO if __name__ == "__main__": with open('dataset_twitter-scraper_2023-08-23_22-13-19-740.json') as f: data = json.load(f) tweets = [d["full_te...
0
public_repos
public_repos/numpy-stubs/.flake8
# Some PEP8 deviations are considered irrelevant to stub files: # (error counts as of 2017-05-22) # 17952 E704 multiple statements on one line (def) # 12197 E301 expected 1 blank line # 7155 E302 expected 2 blank lines # 1463 F401 imported but unused # 967 E701 multiple statements on one line (colon) # 457 F811 r...
0
public_repos
public_repos/numpy-stubs/setup.cfg
# Ignore the following errors (for stubs): # E301 expected 1 blank line, found 0 # E302 expected 2 blank lines, found 1 # E305 expected 2 blank lines after class or function definition, found 1 # E701 multiple statements on one line (colon) # E704 multiple statements on one line (def) [flake8] ignore = E301,...
0
public_repos
public_repos/numpy-stubs/setup.py
from setuptools import setup import os def find_stubs(package): stubs = [] for root, dirs, files in os.walk(package): for file in files: path = os.path.join(root, file).replace(package + os.sep, "", 1) stubs.append(path) return {package: stubs} setup( name="numpy-stub...
0
public_repos
public_repos/numpy-stubs/.travis.yml
language: python matrix: include: - python: 3.8 dist: xenial - python: 3.7 dist: xenial - python: 3.6 dist: xenial notifications: email: false install: - pip install -r test-requirements.txt - pip install . script: - flake8 - black --check . - py.test cache: directories: - "$HO...
0
public_repos
public_repos/numpy-stubs/runtests.py
#!/usr/bin/env python import argparse import ast import importlib import os import subprocess import sys import pytest STUBS_ROOT = os.path.dirname(os.path.abspath(__file__)) # Technically "public" functions (they don't start with an underscore) # that we don't want to include. BLACKLIST = { "numpy": { #...
0
public_repos
public_repos/numpy-stubs/test-requirements.txt
black==18.9b0 flake8==3.7.9 flake8-pyi==18.3.1 pytest==4.0.0 mypy==0.770
0
public_repos
public_repos/numpy-stubs/README.md
**These stubs have been merged into NumPy, and all further development will happen in the NumPy main repo. We welcome your contributions there!**
0
public_repos
public_repos/numpy-stubs/LICENSE
Copyright (c) 2005-2017, NumPy Developers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and...
0
public_repos/numpy-stubs
public_repos/numpy-stubs/numpy-stubs/__init__.pyi
import builtins import sys import datetime as dt from abc import abstractmethod from numpy.core._internal import _ctypes from numpy.typing import ArrayLike, DtypeLike, _Shape, _ShapeLike from typing import ( Any, ByteString, Callable, Container, Callable, Dict, Generic, IO, Iterabl...
0
public_repos/numpy-stubs
public_repos/numpy-stubs/numpy-stubs/typing.pyi
import sys from typing import Any, Dict, List, overload, Sequence, Text, Tuple, Union from numpy import dtype, ndarray if sys.version_info >= (3, 8): from typing import Protocol else: from typing_extensions import Protocol _Shape = Tuple[int, ...] # Anything that can be coerced to a shape tuple _ShapeLike =...
0
public_repos/numpy-stubs/numpy-stubs
public_repos/numpy-stubs/numpy-stubs/core/_internal.pyi
from typing import Any # TODO: add better annotations when ctypes is stubbed out class _ctypes: @property def data(self) -> int: ... @property def shape(self) -> Any: ... @property def strides(self) -> Any: ... def data_as(self, obj: Any) -> Any: ... def shape_as(self, obj: Any) -> Any...
0
public_repos/numpy-stubs
public_repos/numpy-stubs/tests/test_stubs.py
import importlib.util import itertools import os import re from collections import defaultdict import pytest from mypy import api TESTS_DIR = os.path.dirname(__file__) PASS_DIR = os.path.join(TESTS_DIR, "pass") FAIL_DIR = os.path.join(TESTS_DIR, "fail") REVEAL_DIR = os.path.join(TESTS_DIR, "reveal") def get_test_ca...
0
public_repos/numpy-stubs
public_repos/numpy-stubs/tests/README.md
Testing ======= There are three main directories of tests right now: - `pass/` which contain Python files that must pass `mypy` checking with no type errors - `fail/` which contain Python files that must *fail* `mypy` checking with the annotated errors - `reveal/` which contain Python files that must output the c...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/numerictypes.py
import numpy as np # Techincally this works, but probably shouldn't. See # # https://github.com/numpy/numpy/issues/16366 # np.maximum_sctype(1) # E: incompatible type "int" np.issubsctype(1, np.int64) # E: incompatible type "int" np.issubdtype(1, np.int64) # E: incompatible type "int" np.find_common_type(np.int6...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/scalars.py
import numpy as np # Construction np.float32(3j) # E: incompatible type # Technically the following examples are valid NumPy code. But they # are not considered a best practice, and people who wish to use the # stubs should instead do # # np.array([1.0, 0.0, 0.0], dtype=np.float32) # np.array([], dtype=np.complex64...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/simple.py
"""Simple expression that should fail with mypy.""" import numpy as np # Array creation routines checks np.zeros("test") # E: incompatible type np.zeros() # E: Too few arguments np.ones("test") # E: incompatible type np.ones() # E: Too few arguments
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/warnings_and_errors.py
import numpy as np np.AxisError(1.0) # E: Argument 1 to "AxisError" has incompatible type np.AxisError(1, ndim=2.0) # E: Argument "ndim" to "AxisError" has incompatible type np.AxisError( 2, msg_prefix=404 # E: Argument "msg_prefix" to "AxisError" has incompatible type )
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/ufuncs.py
import numpy as np np.sin.nin + "foo" # E: Unsupported operand types np.sin(1, foo="bar") # E: Unexpected keyword argument np.sin(1, extobj=["foo", "foo", "foo"]) # E: incompatible type
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/fromnumeric.py
"""Tests for :mod:`numpy.core.fromnumeric`.""" import numpy as np A = np.array(True, ndmin=2, dtype=bool) A.setflags(write=False) a = np.bool_(True) np.take(a, None) # E: No overload variant of "take" matches argument type np.take(a, axis=1.0) # E: No overload variant of "take" matches argument type np.take(A, ou...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/ndarray.py
import numpy as np # Ban setting dtype since mutating the type of the array in place # makes having ndarray be generic over dtype impossible. Generally # users should use `ndarray.view` in this situation anyway. See # # https://github.com/numpy/numpy-stubs/issues/7 # # for more context. float_array = np.array([1.0]) f...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/fail/array_like.py
from typing import Any, TYPE_CHECKING import numpy as np if TYPE_CHECKING: from numpy.typing import ArrayLike else: ArrayLike = Any class A: pass x1: ArrayLike = (i for i in range(10)) # E: Incompatible types in assignment x2: ArrayLike = A() # E: Incompatible types in assignment x3: ArrayLike = {1:...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/numerictypes.py
import numpy as np np.maximum_sctype("S8") np.maximum_sctype(object) np.issctype(object) np.issctype("S8") np.obj2sctype(list) np.obj2sctype(list, default=None) np.obj2sctype(list, default=np.string_) np.issubclass_(np.int32, int) np.issubclass_(np.float64, float) np.issubclass_(np.float64, (int, float)) np.issubs...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/scalars.py
import numpy as np # Construction class C: def __complex__(self): return 3j class B: def __int__(self): return 4 class A: def __float__(self): return 4.0 np.complex64(3j) np.complex64(C()) np.complex128(3j) np.complex128(C()) np.int8(4) np.int16(3.4) np.int32(4) np.int64(-1)...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/simple.py
"""Simple expression that should pass with mypy.""" import operator import numpy as np from typing import Iterable # noqa: F401 # Basic checks array = np.array([1, 2]) def ndarray_func(x): # type: (np.ndarray) -> np.ndarray return x ndarray_func(np.array([1, 2])) array == 1 array.dtype == float # Array ...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/warnings_and_errors.py
import numpy as np np.AxisError(1) np.AxisError(1, ndim=2) np.AxisError(1, ndim=None) np.AxisError(1, ndim=2, msg_prefix="error") np.AxisError(1, ndim=2, msg_prefix=None)
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/ufuncs.py
import numpy as np np.sin(1) np.sin([1, 2, 3]) np.sin(1, out=np.empty(1)) np.matmul(np.ones((2, 2, 2)), np.ones((2, 2, 2)), axes=[(0, 1), (0, 1), (0, 1)]) np.sin(1, signature="D") np.sin(1, extobj=[16, 1, lambda: None]) np.sin(1) + np.sin(1) np.sin.types[0] np.sin.__name__
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/fromnumeric.py
"""Tests for :mod:`numpy.core.fromnumeric`.""" import numpy as np A = np.array(True, ndmin=2, dtype=bool) B = np.array(1.0, ndmin=2, dtype=np.float32) A.setflags(write=False) B.setflags(write=False) a = np.bool_(True) b = np.float32(1.0) c = 1.0 np.take(a, 0) np.take(b, 0) np.take(c, 0) np.take(A, 0) np.take(B, 0) ...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/simple_py3.py
import numpy as np array = np.array([1, 2]) # The @ operator is not in python 2 array @ array
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/ndarray_shape_manipulation.py
import numpy as np nd1 = np.array([[1, 2], [3, 4]]) # reshape nd1.reshape(4) nd1.reshape(2, 2) nd1.reshape((2, 2)) nd1.reshape((2, 2), order="C") nd1.reshape(4, order="C") # resize nd1.resize() nd1.resize(4) nd1.resize(2, 2) nd1.resize((2, 2)) nd1.resize((2, 2), refcheck=True) nd1.resize(4, refcheck=True) nd2 = n...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/ndarray_conversion.py
import os import tempfile import numpy as np nd = np.array([[1, 2], [3, 4]]) scalar_array = np.array(1) # item scalar_array.item() nd.item(1) nd.item(0, 1) nd.item((0, 1)) # tolist is pretty simple # itemset scalar_array.itemset(3) nd.itemset(3, 0) nd.itemset((0, 0), 3) # tostring/tobytes nd.tostring() nd.tostrin...
0
public_repos/numpy-stubs/tests
public_repos/numpy-stubs/tests/pass/array_like.py
from typing import Any, List, Optional, TYPE_CHECKING import numpy as np if TYPE_CHECKING: from numpy.typing import ArrayLike, DtypeLike, _SupportsArray else: ArrayLike = Any DtypeLike = Any _SupportsArray = Any x1: ArrayLike = True x2: ArrayLike = 5 x3: ArrayLike = 1.0 x4: ArrayLike = 1 + 1j x5: Arr...
0