Saravanan666/pypi-org huggingface dataset:
Package: info-chunks-to-embeddings
info_chunks_to_embeddings.pyinfo_chunks_to_embeddings.py 是一個將 JSON 檔案轉換為語句嵌入的工具。它使用 SentenceTransformer 模型將 JSON 文件中的內容轉換為相應的語句嵌入，然後將這些嵌入保存到指定的資料夾中。🐔動機: 
. 如果只有 .txt 純文字與 .pt 文字向量彼此對照的話，將來自然語言 query 會丟失試算表名稱與 worksheet 名稱
. 我們發明了把 .csv 每一行都轉一個檔案 info_chunk.json 這種格式
. info_chunk.json 可以最大程度保留試算表名稱、worksheet名稱、第幾 row 的訊息
. 進行「語境探索」自然語言搜尋時，可以抓出 info_chunk.json 所有資訊而不是只有當初的 .txt 片段文字而已
. 試算表類型的文字知識庫，甚至可以根據 row 上下順序來調閱更多相關資訊
. info_chunk.json 不只是可以吃 .csv 而已, 也包括 .pdf .docx .xlsx 也都可以轉 info_chunk.json
. 因為 1 row 1 info_chunk.json, 很方便就可以把一堆 info_chunk.json 切割 20 份 .zip 做分散運算
. info_chunks_to_embeddings.py 本身尚未分散運算, 但可擴充 dist_info_chunks_to_embeddings.py
. 我們刻意把輸入與輸出檔案名稱可以直接對照方便透過.pt調閱.json:
  doc-id_1H0NTLvF0oyURCw_YWBQJ8CkcL7pij5D_8zO_1gXMc5k_sha_0f813133_row_7.json
  doc-id_1H0NTLvF0oyURCw_YWBQJ8CkcL7pij5D_8zO_1gXMc5k_sha_0f813133_row_7.pt

💣地雷: 
. 要注意 info_chunk.json 裡面必須包含有 content 欄位才能轉 embeddings .pt 檔案安裝要安裝 info_chunks_to_embeddings，請使用以下命令：python3 -m pip install info-chunks-to-embeddings使用方法將 JSON 檔案轉換為嵌入（embeddings）：首先，確保您的系統中已安裝了sentence-transformers庫。 如果尚未安装，请运行以下命令进行安装：pip install sentence-transformers運行以下命令將指定資料夾中的 JSON 檔案轉換為嵌入並保存到嵌入資料夾中：python info_chunks_to_embeddings.py --input-folder <json_files_path> --embeddings-folder <embeddings_folder_path>其中，<json_files_path>是要轉換的 JSON 檔案所在的資料夾，<embeddings_folder_path>是要保存生成的嵌入的資料夾。若要覆蓋已經存在的嵌入文件，可以使用--force選項：python info_chunks_to_embeddings.py --input-folder <json_files_path> --embeddings-folder <embeddings_folder_path> --force示例例如，如果您的 JSON 檔案位於~/my_json_files資料夾中，並希望將生成的嵌入存儲在~/my_embeddings資料夾中，則可以運行以下命令：python info_chunks_to_embeddings.py --input-folder ~/my_json_files --embeddings-folder ~/my_embeddings輸入資料檔案 info_chunk.json 舉例（需要有 content 欄位）{
    "uuid4": "f0dd55f0-229b-46d8-92af-e3c5e7275c52",
    "time": "2023-06-18T01:02:35.411700Z",
    "content": "青春痘 青春痘是最常見的皮膚問題，是皮脂腺發炎所致，表面上可能是細菌感染、黴菌感染、蟎蟲寄生，但更深層來看，是性荷爾蒙代謝不良、腸道菌叢失衡、胰島素太高、肝臟代謝受阻造成。12-24歲青少年盛行率80%，25歲以上青年也高達50%，因為此階段的睪固酮和雌激素分泌最多。熬夜、高醣飲食、加工食物（尤其是垃圾食物）、臉部衛生習慣不好或過度清潔，都會引起青春痘。所以，要徹底解決青春痘並不難，但需要探討自己到底是哪個環節出問題。",
    "type": "google_sheet",
    "sheet_id": "1H0NTLvF0oyURCw_YWBQJ8CkcL7pij5D_8zO_1gXMc5k",
    "sheet_name": "健康百科問答知識庫",
    "worksheet_name": "工作表1",
    "download_time": "2023-06-18T00:57:05.222819Z",
    "download_filepath": "./data/users/boh/bohachu_gmail_com/google_sheet_downloader/2023-06-18/doc-id_1H0NTLvF0oyURCw_YWBQJ8CkcL7pij5D_8zO_1gXMc5k_sha_0f813133.csv",
    "row": 13
}
Package: info-cluster
info-clusteringUsagepipinstallinfo-clusterAfter installinginfo-clusterpackage, you can use it as follows:frominfo_clusterimportInfoClusterimportnetworkxasnxg=nx.Graph()# undirected graphg.add_edge(0,1,weight=1)g.add_edge(1,2,weight=1)g.add_edge(0,2,weight=5)ic=InfoCluster(affinity='precomputed')# use precomputed graph structureic.fit(g)ic.print_hierarchical_tree()The output is like/-0/-|--|\-2|\-1
Package: infocyteapiquery
Infocyte API QueryDescription:Python module | Used to get API data from Infocyte Cloud Instances into the pandas DataFrame | Defaults to 90 daysRequired Modules (Installed as prerequisite)requests (Addition)pandas (Addition)paginateit (Addition)tqdm (Addition)jsonsubprocessreInstallationpip install --upgrade infocyteapiqueryHow to use API Query?Takes 3 arguments:cname --> Cloud Instance Name <cname.infocyte.com>apikey --> APIKEY or the API Tokenapiquery --> API GET Method>>> from infocyteapiquery import infocyteapiquery as ic
 >>> cname = "m...n"
 >>> apikey = "J8ARPa3iQR6...8HGUkElBBXra4mdEq"
 >>> apiquery = "ModuleDetails"
 >>>
 >>> icdata = ic.query(cname, apikey, apiquery)
 Loading ModuleDetails:  100%|█████████████████████████████████████████████████████████████ | 9/9 Loop(s)
 >>>
 >>> icdata.shape
 (9183, 37)
 >>>
 >>> icdata.columns
 Index(['size', 'signatureType', 'serialNumber', 'subjectName', 'issuerName', 'timestampIssuer', 'timestampSubject', 'id', 'fileRepId', 'staticAnalysis', 'dynamicAnalysis', 'localBlacklist', 'localWhitelist', 'blacklist', 'whitelist',
'malicious', 'notMalicious', 'suspicious', 'unknown', 'threatScore', 'threatName', 'threatWeight', 'compromised', 'failed', 'hasAvScan', 'avPositives', 'avTotal', 'synapse', 'flagId', 'flagName', 'flagColor', 'flagWeight',
'name', 'path', 'managed', 'signed', 'md5', 'sha1', 'sha256', 'ssdeep'],
 (dtype='object')How to use PowerShell Query?Takes 3 arguments:cname --> Cloud Instance Name <cname.infocyte.com>apikey --> APIKEY or the API Tokenpscmd --> PowerShell Script Commands>>> from infocyteapiquery import infocyteapiquery as ic
 >>> cname = "m...n"
 >>> apikey = "J8ARPa3iQR6...8HGUkElBBXra4mdEq"
 >>> 
 >>>pscmd = '''
 ... $psvariable = Get-ICAlert
 ... ($psvariable).name
 ... '''
 >>> psdata = ic.ps(cname, apikey, pscmd)
 Loading : 100%|███████████████████████████████████████████████████████████████████████ | 1/1 Line(s)
 >>>
 >>> print(psdata)
 rdpwrap.dll
 calculator.exe
 rundll32.exe
 ...
 ...
 cmd.exe
 python.exe
 cmd.exeHow to use Encoded PowerShell Query?Takes 3 arguments:cname --> Cloud Instance Name <cname.infocyte.com>apikey --> APIKEY or the API Tokenpsecmd --> PowerShell Script Commands Support Pipe and Complex filters>>> from infocyteapiquery import infocyteapiquery as ic
 >>> cname = "m...n"
 >>> apikey = "J8ARPa3iQR6...8HGUkElBBXra4mdEq"
 >>> 
 >>>psecmd = '$man = Get-ICAlert;($man).name|Sort-Object|Get-Unique'
 >>> psedata = ic.pse(cname, apikey, psecmd)
 Loading : 100%|███████████████████████████████████████████████████████████████████████ | 1/1 Line(s)
 >>>
 >>> print(psedata)
 BitComet_1.74_setup.exe
 bitcomet_setup_EBTmD-1.exe
 calc.exe
 Calculator.exe
 calculator.exe
 Calculator.exe
 ...
 ...
 cmd.exe
 python.exeNote: PowerShell output is extracted in string format (Refer PowerShell "ConvertTo" feature for more details)Query and PowerShell Tips & TricksPlease refer Wiki Section of Github for details.Wiki hereLicense© 2021 Manjesh NThis repository is licensed under the Apache 2.0 license. See LICENSE for more details.
Package: info-gain
info_gainImplementation of information gain algorithm. There seems to be a debate about how the information gain metric is defined. Whether to use theKullback-Leibler divergenceor theMutual informationas an algorithm to define information gain. This implementation uses theinformation gain calculationas defined below:Information gain definitionsInformation gain calculationDefinition frominformation gain calculation(retrieved 2018-07-13).
LetAttrbe the set of all attributes andExthe set of all training examples,value(x, a)withxinExdefines the value of a specific examplexfor attributeainAttr,Hspecifies the entropy. Thevalues(a)function denotes the set of all possible values of attributeainAttr. The information gain for an attributeainAttris defined as follows:Intrinsic value calculationDefinition frominformation gain calculation(retrieved 2018-07-13).Information gain ratio calculationDefinition frominformation gain calculation(retrieved 2018-07-13).InstallationTo install the package via pip use:pip install info_gainTo clone the package from the git repository use:git clone https://github.com/Thijsvanede/info_gain.gitUsageImport theinfo_gainmodule with:from info_gain import info_gainThe imported module has supports three methods:info_gain.info_gain(Ex, a)to compute the information gain.info_gain.intrinsic_value(Ex, a)to compute the intrinsic value.info_gain.info_gain_ratio(Ex, a)to compute the information gain ratio.Examplefrominfo_gainimportinfo_gain# Example of color to indicate whether something is fruit or vegatableproduce=['apple','apple','apple','strawberry','eggplant']fruit=[True,True,True,True,False]colour=['green','green','red','red','purple']ig=info_gain.info_gain(fruit,colour)iv=info_gain.intrinsic_value(fruit,colour)igr=info_gain.info_gain_ratio(fruit,colour)print(ig,iv,igr)
Package: infogenomics
Advanced framework for informational genomics in python3This library collects a list of useful methods to solve informational genomic problems.
Please use the command "pip install infogenomics" to install the library.
To use the library you have to type import infogenomics in the python3 shell and then you can use all the methods typing infogenomics.methodName.
Use dir(infogenomics) to have a list of all the methods of the library and use the function "help(method)" for a detailed description.
Package: info.gianlucacosta.eos.core
Eos-coreType-checked, dependency-free utility library for modern PythonIntroductionMy voyage through the vast and fascinating universe ofPythonstarted back in 2004 - whenPython 2.3was still the latest, exciting release... 😊Since then, both the language and its ecosystem have evolved a lot: in particular, I feel thattype hintsmake Python even more robust, without sacrificing its charming syntax - just like another language I'm fond of:TypeScript.Consequently, theEoslibrary is designed to provide a set of shared utilities and patterns emerged during the creation of my open source projects with modern, type-checked Python - and thiscorepackage only builds upon the standard library, with no additional runtime dependencies.For further details, please refer to the sections below, to the documentation within each module, and even to the tests - whose coverage is more than 97%! ^__^InstallationTo installeos.core, just run:pip install info.gianlucacosta.eos.coreor, if you prefer using Poetry:poetry add info.gianlucacosta.eos.coreThen, you'll be able to access theinfo.gianlucacosta.eos.corepackage and its subpackages.Highlightseos.coreprovides a wide variety of patterns - including:higher-order functional abstractions, such as functions returningadaptable queue writersandreaders- whose timeouts vary according to the queue statea disposableTemporaryPath- and aUuid4TemporaryPathstring subclass that perform advanced cleanup, no matter whether you create a file or a whole directory tree upon itaBufferedDbSerializer- using advanced but simple decorators to serialize objects of different types via dedicated SQL statements, but actually writing to DB only when the internal buffer is fullanInThreadPoolclass having the same interface as Python'sPool- but running within the very same thread: definitely handful when debugging and testingaCancelableThreadand the relatedCancelableThreadHandle- enabling the client to send a cancelation requestanAtomicclass, to read and update arbitrary values atomicallyafunctionalmodule, with expressive type aliases for functions - with ideas borrowed from other languages such as C#, Java and Rust...and more! ^__^ It's definitely not easy to mention everything in a README file, so please feel free to browse the modules and explore how they are used in the tests!
Package: info.gianlucacosta.iris
IrisGeneral-purpose library for PythonDeprecation & namespace warningPlease, note: Iris is now deprecated and should be used only to support ancient projects.Furthermore, for compatibility with Python's modern packaging system, pleasedelete from the file system every reference to its 3.x versionand use version 4.x instead.IntroductionIris is a general-purpose, object-oriented and open source library for Python 3.ModulesAll the modules reside within theinfo.gianlucacosta.irispackage and subpackages.In particular:ioc, featuring a simple IoC container, that supports transient and singleton objects out of the box and can be extended via OOP by introducing new registration kindsversioning, introducing a Version class and a VersionDirectory, that, for example, can return the file having the latest version in a directorymaven, dealing with MavenArtifact (which describes the Maven properties of an artifact) and MavenRepository, to query a Maven repository using the concepts introduced in the versioning modulerenderingabstracts the templating process by providing a Model class that can be easily reused with different rendering technologiesvarsenables developers to create boolean variables (instances of Flag) whose value depends on the existence of underlying files - which can be useful in some situations where multiple technologies are involvedio.utils, contains generic I/O utilitiesio.treedefines objects for operating on file treesInstallationIris can be installed viapip:pip install info.gianlucacosta.iris
Package: infogram
infogram-python======Unofficial Python library for infogr.am APIInstallation------------::$ pip install infogramUsage-----::from infogram import Infogram# Initialize connection with the api, providing api_key and api_secretclient = Infogram(api_key, api_secret)client.themes_list()client.infographics_create({"content": [{"type":"h1","text":"Hello infogr.am"}],"publish": False,"theme_id": 45,"title": "Hello",})API Methods------------Themes-----::client.themes_list()Infographics-----::client.infographics_list()client.infographics_get(infographic_id)client.infographics_create(params)client.infographics_update(infographic_id, params)client.infographics_destroy(infographic_id)Users-----::client.users_get(user_id)client.users_get_infographics(user_id)
Package: info-gtk
Info GTK CLICLI / SDK pythoninfo-gtk.Fitur yang akan datangBerikut fitur yang akan direncanakan untuk aplikasi ini.Export data ke excelDownload / Print masalDonasiJika anda ingin melakukan donasi untuk kami, bisa menghubungi kami melaluiWhatsAppataupunTelegram.Legal / HukumKode ini sama sekali tidak berafiliasi dengan, diizinkan, dipelihara, disponsori atau didukung oleh Kemdikbud atau afiliasi atau anak organisasinya. Ini adalah perangkat lunak yang independen dan tidak resmi.Gunakan dengan risiko Anda sendiri.
Package: infoicer
infoicerInfoicer is a simple invoice items handler. It can group items by type and tax rate which helps in building the invoice for a customer.FeaturesAll price handling is utilized withDecimaltype to avoid float rounding problemsEasy to group invoice items by type and tax rateImplemented object serializationNo external dependenciesInstallationFrom PyPi:$pipinstallinfoiceror clone repository:$gitclonegit@github.com:edkirin/infoicer.gitBasic usagefrominfoicerimportInvoice,InvoiceItemfromdecimalimportDecimalinvoice=Invoice()invoice.add(InvoiceItem(name="Ham",item_type='food',price=Decimal(10),qty=1,tax_rate=Decimal(5),))invoice.add(InvoiceItem(name="Spam",item_type='food',price=Decimal(15),qty=3,tax_rate=Decimal(5),))print(invoice.serialize(json_output=True))output:{"items":[{"item_type":"food","qty":1,"name":"Ham","price":10.0,"net_price":9.52,"tax_rate":5.0,"sum":10.0,"net_sum":9.52,"tax_sum":0.48},{"item_type":"food","qty":3,"name":"Spam","price":15.0,"net_price":14.29,"tax_rate":5.0,"sum":45.0,"net_sum":42.87,"tax_sum":2.13}],"total":{"price":55.0,"net":52.39,"tax":2.61}}Full demoCheck includeddemo.pyfor some more uses and features.LicenceThe code is available under MIT Licence.
Package: infoip
GeoIp info for your visitors============================This simple plugin connects to the `infoip <https://www.infoip.io>`__API and retrieves the geoip information for the current request/visitor.It works based on view decorators and not middleware to prevent slowingdown your application with unnecessary data.The plugin uses an external API which is battle-tested andenterprise-ready to satisfy any number of requests. Our database isrefreshed every single day in order to respond with up-to-dateinformation. The API offers ``1000`` free requests every day with arate-limiter set at ``1rps`` (one request per second). If you find thatto be too restrictive please consider subscribing to a `premiumplan <https://www.infoip.io/pricing>`__Supported frameworks~~~~~~~~~~~~~~~~~~~~1. DjangoQuick start Django------------------1. Install the package from pip``pip install infoip``2. Import the view decorator and use it to decorate the view where youneed geoip info.. code:: python# django test view that simply prints the geoip data regarding the visitorfrom infoip.django import infoipfrom django.http import JsonResponse@infoipdef index(request):# will respond to the request with user info# you can also use the geoip data in your views for custom processing:#  - request.infoip.country_long#  - request.infoip.country_short#  - ...return JsonResponse(request.infoip)3. Tweak the settings1. (optional) Add your api key to your settings if you are a premiumsubscriber of `infoip <https://www.infoip.io>`__.. code:: pythonINFOIP_API_KEY = "your-api-key"2. (optional) Use ``https`` for communicating with our API (it uses``http`` by default).. code:: pythonINFOIP_USE_HTTPS = TrueYou want to help and contribute? Perfect!=========================================These are some contribution examples------------------------------------- Reporting issues to the bugtracker.- Submitting pull requests from a forked infoip repo.- Extending the documentation.For pull requests, keep this in mind------------------------------------- Add a test which proves your fix and make it pass.- Describe your change in CHANGES.rst- Add yourself to the docs/credits.rst
Package: infokannegara
SC-MoviePython library leveraging REST Countries API to fetch and display country-specific data such as capitals, populations, currencies, and languagesAPIPython Basic API wrapperhttps://restcountries.com/v3.1/InstallationInstall my-project with npmpipinstallinfokannegaraUsageBasic Usage :fromcountryinfo.negaraimportCountryInfocountry_data=CountryInfo()country_name=input("Masukkan nama negara: ")capital=country_data.get_country_capital(country_name)population=country_data.get_country_population(country_name)ifcapitalandpopulation:print(f"Ibu kota dari{country_name}adalah{capital}")print(f"Populasi{country_name}adalah{population}")else:print("Data negara tidak ditemukan.")
Package: infolib
infolibsimple and complete PandasDataframe's stat overviewInstallationOnly through pip at this timehttps://pypi.org/project/infolib/pip install infolibfrom infolib import infoHow to useUsing infolib is very simple:info(pd.DataFarame)inf() takes 1 positional argument and expects pandas DataFrame objectExempleDemo on Colab:https://colab.research.google.com/drive/1KTI7CwP_E7IJod_WiD0PT31MaRBdhiki?usp=sharingCodeGitHub:https://github.com/AntonelloManenti/infolibDevelopment StatusRead well and don't say you didn't know.✔️ Planning✔️ Pre-Alpha✔️ Alpha✔️ Beta❌ Production/Stable❌ Mature❌ InactiveThe beta version (0.2.*) was tested in Colab (py 3.7) and on Jupyter (py 3.10
on Windows)LicenseMIT:https://github.com/AntonelloManenti/infolib/blob/main/LICENSEContactslinkedin:https://www.linkedin.com/in/antonello-manenti/
Package: infomaniakclient
InfomaniakNewsletterClientIntegration of Infomaniak Newsletter API in Pythonhttps://newsletter.infomaniak.com/docs/index.htmlInstallationvirtualenv venv
venv\Scripts\activate

pip install infomaniakclientUsagefrom infomaniakclient import Client
from infomaniakclient import Action

r = Client('API_KEY', 'API_SECRET')You'll find some examples in this repos examples.py file.
Package: infomap
InfomapInfomap is a network clustering algorithm based on theMap equation.For detailed documentation, seemapequation.org/infomap.For a list of recent changes, seeCHANGELOG.mdin the source directory.Getting startedInfomap can be installed either fromPyPIusingpipor by
compiling from source.An experimental Javascript version for browsers is available onNPM.Using pipA pre-compiled version is available for macOS users.Installing on other operating systems requires a
workinggccorclangcompiler.To install, run:pip install infomapTo upgrade, run:pip install --upgrade infomapWhen the Python package is installed, an executable calledinfomap(with lowercase i) is available from any directory.To get started, readInfomap Python API.Using DockerThere are currently two Docker images available onDocker Hub.mapequation/infomapmapequation/infomap:notebookbased onjupyter/scipy-notebookThe imagemapequation/infomapcan be started withdockerrun-it--rm\-v`pwd`:/data\mapequation/infomap[infomaparguments]You can also use the supplieddocker-compose.yml:docker-composerun--rminfomapThe imagemapequation/infomap:notebookcan be started withdockerrun\-v`pwd`:/home/jovyan/work\-p8888:8888\mapequation/infomap:notebook\start.shjupyterlabOr similarly, using docker-compose:docker-composeupnotebookCompiling from sourceInstalling Infomap from source requires a workinggccorclangcompiler.To download and compile the newest version fromGithub, clone the repository
by runninggitclonegit@github.com:mapequation/infomap.gitcdinfomapmakeThis creates the binaryInfomap, run it using:./Infomap [options] network_data destinationFor a list of options, run:./Infomap --helpReadthe documentationto learn more about the different options.Npm packageAn experimental Javascript web worker is available onNPM.To install it, runnpminstall@mapequation/infomapFeedbackIf you have any questions, suggestions or issues regarding the software,
please add them toGitHub issues.AuthorsDaniel Edler, Anton Holmgren, Martin RosvallFor contact information, seemapequation.org/about.html.Terms of useInfomap is released under a dual licence.To give everyone maximum freedom to make use of Infomap
and derivative works, we make the code open source under
the GNU Affero General Public License version 3 or any
later version (seeLICENSE_AGPLv3.txt).For a non-copyleft license, please contact us.
Package: infoml
infomlPython package for bioinformatics analysis and machine learning.InstallationpipinstallinfomlUsageTODOContributingInterested in contributing? Check out the contributing guidelines. Please note
that this project is released with a Code of Conduct. By contributing to this
project, you agree to abide by its terms.Licenseinfomlwas created by Tony Kabilan Okeke. It is licensed under the terms of
the MIT license.Creditsinfomlwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.
Package: info-nce-pytorch
PyTorch implementation of the InfoNCE loss from“Representation Learning with Contrastive Predictive Coding”.
In contrastive learning, we want to learn how to map high dimensional data to a lower dimensional embedding space.
This mapping should place semantically similar samples close together in the embedding space, whilst placing semantically distinct samples further apart.
The InfoNCE loss function can be used for the purpose of contrastive learning.This package isavailable on PyPIand can be installed via:pip install info-nce-pytorchExample usageCan be used without explicit negative keys, whereby each sample is compared with the other samples in the batch.loss=InfoNCE()batch_size,embedding_size=32,128query=torch.randn(batch_size,embedding_size)positive_key=torch.randn(batch_size,embedding_size)output=loss(query,positive_key)Can be used with negative keys, whereby every combination between query and negative key is compared.loss=InfoNCE(negative_mode='unpaired')# negative_mode='unpaired' is the default valuebatch_size,num_negative,embedding_size=32,48,128query=torch.randn(batch_size,embedding_size)positive_key=torch.randn(batch_size,embedding_size)negative_keys=torch.randn(num_negative,embedding_size)output=loss(query,positive_key,negative_keys)Can be used with negative keys, whereby each query sample is compared with only the negative keys it is paired with.loss=InfoNCE(negative_mode='paired')batch_size,num_negative,embedding_size=32,6,128query=torch.randn(batch_size,embedding_size)positive_key=torch.randn(batch_size,embedding_size)negative_keys=torch.randn(batch_size,num_negative,embedding_size)output=loss(query,positive_key,negative_keys)Loss graphSuppose we have some initial mean vectorsµ_q,µ_p,µ_nand a covariance matrixΣ = I/10, then we can plot the value of the InfoNCE loss by sampling from distributions with interpolated mean vectors.
Given interpolation weightsαandβ, we define the distributionQ ~ N(µ_q, Σ)for the query samples, the distributionP_α ~ N(αµ_q +(1-α)µ_p,Σ)for the positive samples
and the distributionN_β ~ N(βµ_q +(1-β)µ_n,Σ)for the negative samples.
Shown below is the value of the loss with inputs sampled from the distributions defined above for different values ofαandβ.