Saravanan666/pypi-org huggingface dataset:
Package: torch4keras
Documentation|Bert4torch|Examples|Source code1. 下载安装安装稳定版pipinstalltorch4keras安装最新版pipinstallgit+https://github.com/Tongjilibo/torch4keras.git2. 功能简述：抽象出来的Trainer，适用于一般神经网络的训练，仅需关注网络结构代码特色：进度条展示训练过程，自定义metric，自带Evaluator, Checkpoint, Tensorboard, Logger等Callback，也可自定义Callback初衷：前期功能是作为bert4torch和rec4torch的Trainer训练：2022-10-28 23:16:10 - Start Training
2022-10-28 23:16:10 - Epoch: 1/5
5000/5000 [==============================] - 13s 3ms/step - loss: 0.1351 - acc: 0.9601
Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 798.09it/s] 
test_acc: 0.98045. best_test_acc: 0.98045

2022-10-28 23:16:27 - Epoch: 2/5
5000/5000 [==============================] - 13s 3ms/step - loss: 0.0465 - acc: 0.9862
Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 635.78it/s] 
test_acc: 0.98280. best_test_acc: 0.98280

2022-10-28 23:16:44 - Epoch: 3/5
5000/5000 [==============================] - 15s 3ms/step - loss: 0.0284 - acc: 0.9915
Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 673.60it/s] 
test_acc: 0.98365. best_test_acc: 0.98365

2022-10-28 23:17:03 - Epoch: 4/5
5000/5000 [==============================] - 15s 3ms/step - loss: 0.0179 - acc: 0.9948
Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 692.34it/s] 
test_acc: 0.98265. best_test_acc: 0.98365

2022-10-28 23:17:21 - Epoch: 5/5
5000/5000 [==============================] - 14s 3ms/step - loss: 0.0129 - acc: 0.9958
Evaluate: 100%|██████████████████████████████████████████████████| 2500/2500 [00:03<00:00, 701.77it/s] 
test_acc: 0.98585. best_test_acc: 0.98585

2022-10-28 23:17:37 - Finish Training3. 快速上手参考bert4torch的训练过程简单示例:turorials_mnist4. 版本历史更新日期版本版本说明20240221v0.2.0fit中修改.train()逻辑较少耗时20240204v0.1.9增加Timeit, Timeit2, timeit等时间/速度监控20240116v0.1.8重新整理snippets, 重写save_pretrained更多版本5. 更新历史：更多历史
Package: torch4nlp
torch4nlputils for nlp.在思想上，排除所有干扰，尤其是家庭的。你会选择体面的穷，还是放下面子的富。警惕打工陷阱。正确目标是自己当老板。不要追求工资的稳定。财富不是积累，而是看清趋势后的一次性蓄力爆发。看清世界，理解交易。尊重
Package: torchact
torchactTorchAct, collection of activation function for PyTorch.Quick Startimporttorchimporttorch.nnasnnimporttorchact.nnasactnnmodel=nn.Sequential(nn.Linear(5,3),actnn.ReLU(),nn.Linear(3,1),nn.Sigmoid())dummy=torch.rand(1,5)print(model(dummy))InstallationpipinstalltorchactHow to ContributeThanks for your contribution!There are several steps for contributing.Fork this repo (you can work dev branch.)Install library usingrequirements.txtWrite your code in torchact folder.Add your module in__init__.py(__version__cannot be changed. It will be decided later.)For example.from.your_moduleimportYour_Module__all__=("ReLU","SinLU","Softmax","Your_Module")If you want to test case, Write test case.For example.deftest_has_attr():foractivation_namein__all__:ifactivation_name=="Softmax":asserthasattr(str_to_class(activation_name)(),"dim")else:passRun black style.black .Send a PR. Code testing happens automatically. (PYPI is upgraded by the admin himself.)Citing TorchActTo cite this repository:@article{hantorchact,
  title={TorchAct, collection of activation function for PyTorch.},
  author={Seungwoo Han},
  publisher={Engineering Archive},
  doi={10.31224/2988},
  url={https://engrxiv.org/preprint/view/2988}
  year={2023}
}
Package: torch-activation
PyTorch ActivationsPyTorch Activations is a collection of activation functions for the PyTorch library. This project aims to provide an easy-to-use solution for experimenting with different activation functions or simply adding variety to your models.InstallationYou can install PyTorch Activations using pip:$pipinstalltorch-activationUsageTo use the activation functions, import them from torch_activation. Here's an example:importtorch_activationastacm=tac.ShiLU(inplace=True)x=torch.rand(16,3,384,384)m(x)Or innn.Sequential:importtorchimporttorch.nnasnnimporttorch_activationastacclassNet(nn.Module):def__init__(self):super(Net,self).__init__()self.net=nn.Sequential(nn.Conv2d(64,32,2),tac.DELU(),nn.ConvTranspose2d(32,64,2),tac.ReLU(inplace=True),)defforward(self,x):returnself.net(x)Activation functions can be imported directly from the package, such astorch_activation.CoLU, or from submodules, such astorch_activation.non_linear.CoLU.For a comprehensive list of available functions, please refer to theLIST_OF_FUNCTIONfile.To learn more about usage, please refer toDocumentationWe hope you find PyTorch Activations useful for your experimentation and model development. Enjoy exploring different activation functions!ContactAlan Huynh -LinkedIn-hdmquan@outlook.comProject Link:https://github.com/alan191006/torch_activationDocumentation Link:https://torch-activation.readthedocs.ioPyPI Link:https://pypi.org/project/torch-activation/
Package: torch-adapters
Torch AdaptersIntroductionSmall Library of Torch Adaptation modulesSupported MethodsLoRAPrompt TuningBottleneck AdapterPrefix TuningP-TuningInstallationYou can install torch-adapters using:$ pip install torch-adaptersUsagefromtorch_adapters.utilsimportadd_lora# Add lora to the modeladd_lora(model,["key","value"],{"alpha":8,"r":8})
Package: torch-adata
CreatePyTorch DatasetsfromAnnDataInstallationInstall from PYPI (current version:0.0.24):pipinstalltorch-adataInstall the developer version:gitclonehttps://github.com/mvinyard/torch-adata.git;cdtorch-adata;pipinstall-e.The main APIThe primary class is theAnnDataset. This is a subclass of the widely-usedtorch.utils.data.Dataset. The PyTorchDatasetmodule enables us to take advantage of built-in multiprocessing and other organizational tricks that ultimately standardize workflows and enable reproducibility.importanndataasaimporttorch_adataadata=a.read_h5ad("/path/to/data.h5ad")dataset=torch_adata.AnnDataset(adata,use_key="X_pca",groupby="time",obs_keys=["affinity"])[ torch-adata ]: AnnDataset object with 7131 samples
----------------------------------------------------
Grouped by: 'time' with attributes:
 - X (use_key = 'X_pca') torch.Size([3, 7131, 50])
 - obs: affinity: torch.Size([3, 7131, 1])There is an additional approach to this dubbedAnnLoader, highlighted bySergei RybakovinInterfacing pytorch models with anndataFor more information, please visit thedocumentation!Problem?Open anissue
Package: torch-adf
torch-adfprovides implementations for probabilisticPyTorchneural network layers,
which are based on assumed density filtering.
Assumed density filtering (ADF) is a general concept from Bayesian inference, but in the case of feed-forward neural networks that we consider here
it is a way to approximately propagate a random distribution through the neural network.The layers in this package have the same names and arguments as their corresponding
PyTorch versions. We use Gaussian distributions for our ADF approximations, which are
described by their means and (co-)variances. So unlike the standard PyTorch layers,
eachtorch-adflayer takes two inputs and produces two outputs (one for the means
and one for the (co-)variances).torch-adflayers can be used exactly like the corresponding PyTorch
layers within a model. However, as mentioned above, ADF layers take two inputs and produce two outputs
instead of one, so it is not possible to simply mix ADF and standard layers within the same model.fromtorch.nnimportSequentialfromtorchadf.nnimportLinearin_dim,out_dim=64,32adflayer=Linear(in_dim,out_dim)model=Sequential(adflayer)TheOverviewandExamplessections
of our documentation provide more realistic and complete examples.Project Informationtorch-adfis released under theMIT license,
its documentation lives atRead the Docs,
the code onGitHub,
and the latest release can be found onPyPI.
It’s tested on Python 3.6+.If you’d like to contribute totorch-adfyou’re most welcome.
We have written ashort guideto help you get you started!Further ReadingAdditional information on the algorithmic aspects oftorch-adfcan be found
in the following works:Jochen Gast, Stefan Roth,
“Lightweight Probabilistic Deep Networks”,
2018Jan Macdonald, Stephan Wäldchen, Sascha Hauch, Gitta Kutyniok,
“A Rate-Distortion Framework for Explaining Neural Network Decisions”,
2019AcknowledgmentsDuring the setup of this project we were heavily influenced and inspired by
the works ofHynek Schlawackand in particular hisattrspackage and blog posts ontesting and packainganddeploying to PyPI.
Thank you for sharing your experiences and insights.
Package: torchadversarial
Torch adversarialOptimizing inputs to modelsInstallationTo install this small tool from the source codepip install git+https://github.com/cat-claws/torchadversarial/AdvantagesYou can use these attack codes for more tasks than classification. For example, FGSM can be used to attack object detection etc.How to useimporttorchfromtorchadversarialimportFgsmx=torch.rand(4,3,112,112)z=x.clone()z.requires_grad=Trueopt=Fgsm([z],epsilon=0.1)y=z.sum()y.backward()opt.step()To use as an adversarial attackimporttorchfromtorchadversarialimportFgsm,Attackx=torch.rand(4,3,112,112)forx_inAttack(Fgsm,[x],epsilon=0.1,foreach=False,maximize=True):y=torch.sum(x_[0])y.backward()# print(x_[0])Note thatx_[0]will be your adversarial example. Like other optimizers intorch.optim, the input parameters,e.g.,[x]must be an iterable containing tensors. Thus, we must takex_[0]as our output in this example above.
Package: torch-agents
Torch-AgentsIn early development. Inspired by TF-Agents, I hope to make a similar library for PyTorch - simple enough for me to understand, and powerful enough to express all my crazy ideas.Currently supported: (Double) Deep Q Networks and Open AI Gym environments.ResultsDDQN Learning Pong after 13 hours (2500 games):https://user-images.githubusercontent.com/10812888/172884861-843fb7b5-8823-4017-9042-25c5aff88438.mp4DDQN Learning Breakout after 16 hours (10k games):https://user-images.githubusercontent.com/10812888/173042669-0029ad6b-4c67-4661-81e0-3c6fa1f86211.mp4DDQN Learning Space Invaders after 10k games:https://user-images.githubusercontent.com/10812888/173040244-69920778-4644-4dec-9e49-bf617cd038cc.mp4Installation
Package: torchani
Accurate Neural Network Potential on PyTorchMetrics:Checks:Deploy:We only provide compatibility with nightly PyTorch, but you can check if stable PyTorch happens to be supported by looking at the following badge:TorchANI is a pytorch implementation of ANI. It is currently under alpha release, which means, the API is not stable yet. If you find a bug of TorchANI, or have some feature request, feel free to open an issue on GitHub, or send us a pull request.InstallTorchANI requires the latest preview version of PyTorch. Please install PyTorch before installing TorchANI.Please seePyTorch's official sitefor instructions of installing latest preview version of PyTorch.Note that if you updated TorchANI, you may also need to update PyTorch.After installing the correct PyTorch, you can install TorchANI bypiporconda:pipinstalltorchaniorcondainstall-cconda-forgetorchaniSeehttps://github.com/conda-forge/torchani-feedstockfor more information about the conda package.To run the tests and examples, you must manually download a data package./download.shCUAEV(Optional)To install AEV CUDA Extension (speedup for AEV forward and backward), please follow the instruction attorchani/cuaev.CitationPlease cite the following paper if you use TorchANIXiang Gao, Farhad Ramezanghorbani, Olexandr Isayev, Justin S. Smith, and Adrian E. Roitberg.TorchANI: A Free and Open Source PyTorch Based Deep Learning Implementation of the ANI Neural Network Potentials. Journal of Chemical Information and Modeling 2020 60 (7), 3408-3415,Please refer toisayev/ASE_ANIfor ANI model references.ANI model parametersAll the ANI model parameters including (ANI2x, ANI1x, and ANI1ccx) are accessible from the following repositories:isayev/ASE_ANIaiqm/ani-model-zooDevelopTo install TorchANI from GitHub:gitclonehttps://github.com/aiqm/torchani.gitcdtorchani
pipinstall-e.After TorchANI has been installed, you can build the documents by runningsphinx-build docs build. But make sure you
install dependencies:pipinstall-rdocs_requirements.txtTo manually run unit tests, dopytest-vIf you opened a pull request, you could see your generated documents athttps://aiqm.github.io/torchani-test-docs/after youdocscheck succeed.
Keep in mind that this repository is only for the purpose of convenience of development, and only keeps the latest push.
The CI runing for other pull requests might overwrite this repository. You could rerun thedocscheck to overwrite this repo to your build.Note to TorchANI developersNever commit to the master branch directly. If you need to change something, create a new branch, submit a PR on GitHub.You must pass all the tests on GitHub before your PR can be merged.Code review is required before merging pull request.
Package: torchani-step
SEAMM TorchANI Plug-inA SEAMM plug-in for TorchANIFree software: BSD-3-ClauseDocumentation:https://molssi-seamm.github.io/torchani_step/index.htmlCode:https://github.com/molssi-seamm/torchani_stepFeaturesPlease edit this section!AcknowledgementsThis package was created with themolssi-seamm/cookiecutter-seamm-plugintool, which
is based on the excellentCookiecutter.Developed by the Molecular Sciences Software Institute (MolSSI),
which receives funding from theNational Science Foundationunder
award CHE-2136142.History2023.2.28 – Initial version!Handles energy and optimization.ANI-1x, ANI-1ccx, and ANI-2x models2023.1.17 (2023-01-17)Plug-in created using the SEAMM plug-in cookiecutter.
Package: torchapply
torchapplyApply a torch model to some datapoints.Here's an example:importtorchfromtorchimporttensorclassMain(torch.nn.Module):def__init__(self,model_0,model_1):super().__init__()self.model_0=model_0self.model_1=model_1self.dictionary={'apple':0,'orange':1,'pear':2}defpreprocess(self,arg):return[{'a':{'b':self.dictionary[arg[0]['a']['b']]},'c':self.dictionary[arg[0]['c']]},torch.tensor([self.dictionary[x]forxinarg[1]])]defforward(self,args):returnself.model_0(args[0]),self.model_1(args[1])defpostprocess(self,arg):total=[arg[0]['a']['b'].sum(),arg[0]['c'].sum(),arg[1].sum()]return{'score':sum(total),'decision':sum(total)>0}classModelA(torch.nn.Module):defforward(self,args):return{'b':torch.randn(args['b'].shape[0],10)}classModelC(torch.nn.Module):defforward(self,args):returntorch.randn(args.shape[0],10)classModel1(torch.nn.Module):defforward(self,args):returntorch.randn(args.shape[0],10)classModel0(torch.nn.Module):def__init__(self,model_a,model_c):super().__init__()self.model_a=model_aself.model_c=model_cdefforward(self,args):return{'a':self.model_a(args['a']),'c':self.model_c(args['c'])}model=Main(model_0=Model0(model_a=ModelA(),model_c=ModelC()),model_1=Model1())Apply to a single datapoint:fromtorchapplyimportapply_modelapply_model(model,({'a':{'b':'orange'},'c':'pear'},('apple','apple')),single=True)Apply to multiple datapoints:fromtorchapplyimportapply_modelapply_model(model,[({'a':{'b':'orange'},'c':'pear'},('apple','apple'))for_inrange(10)],single=False)
Package: torch-assimilate
docspipelinecoveragequalitypackageData assimilation based on PyTorchtorch-assimilate is a python package for data assimilation of meteorological
observations into numerical weather model data.This package is constructed for efficient and parallelized data assimilation in
python. The central entity of this package are the data assimilation methods
optimized in PyTorch[1]. Furthermore, some
algorithms are parallelized with dask[2]and allow a distributed computing
with many cores. For data in-  and output xarray[3]is
used. Originally, this package is designed for offline data assimilation via
io-operations.In the future, different data assimilation methods, like ensemble Kalman
filters, particle filters, variational data assimilation and neural assimilation
will be added.This package is developed for a PhD-thesis about nonlinear methods in
coupled data assimilation at the “Universität Hamburg”, “Universität Bonn”
and the Max Planck Institute for Meteorology.InstallationWe highly recommend to create a virtual environment for this package to prevent
package collisions.
At the moment this package is only available at pypi-test.This package is programmed in python 3.6 and should be working with allpython
versions > 3.3. Additional requirements are pytorch and xarray.PyTorch needs to be additionally installed because of different possible versions. In following CPU-based installation for linux is shown.via conda (recommended):gitclonegit@gitlab.com:tobifinn/torch-assimilate.gitcdtorch-assimilatecondaenvcreate-fenvironment.ymlsourceactivatepytassimcondainstallpytorchtorchvisioncpuonly-cpytorchpipinstall.via pip (latest pypi-test):pipinstall--index-urlhttps://test.pypi.org/simple/torch-assimilatepipinstalltorch==1.6.0+cputorchvision==0.7.0+cpu-fhttps://download.pytorch.org/whl/torch_stable.htmlAuthorsTobias Finn-Initial creator-tobifinnLicenseThis project is licensed under the GPL3 License - see thelicensefile for details.References[1]PyTorch,https://pytorch.org[2]Dask,https://dask.org[3]xarray,http://xarray.pydata.org
Package: torchassistant
IntroductionTorchAssistantis a deep learning framework built on top ofPyTorch.
It provides a set of tools to automate the training and evaluation of models.
It also reduces the amount of trivial code one usually needs to write.Just create a specification file configuring the training session and let
the framework do everything else for you.Main features:scripts for training, evaluation, and inferenceautomatically calculating metricsautomatically saving training sessionresuming the interrupted training sessionautomatically saving metrics history to CSV filesnicely formatted information about the training session: epoch, iteration, loss, metrics, etc.highly flexible and customizablesupport for building complex training pipelinesStatus: Early development stageThis project is in the early stage of development.
Features and functionality provided here are subject to change.
Furthermore, the code is not yet extensively tested and may contain bugs.PrerequisitesThis project has dependencies that require separate installation:PyTorch (version >= 1.10.1, < 2.0)Torchvision (version >= 0.11.2, < 0.12)TorchMetrics (version >= 0.7.2 < 0.8)When possible, try to follow the recommended version range specified in parentheses.You can install PyTorch and Torchvision together fromhere.
And you can install TorchMetrics fromhere.Installationpip install torchassistantExamplesThe examples directory contains projects that demonstrate how to use
TorchAssistant to train different kinds of neural networks.DocumentationYou can find all the documentation for the projecthere.LicenseThis project has an MIT license.
Package: torch-attention
This codebase is a PyTorch implementation of various attention mechanisms, CNNs, Vision Transformers and MLP-Like models.If it is helpful for your work, please⭐Updating...Attention mechanismsSqueeze-and-Excitation Networks (CVPR 2018)pdfCBAM: convolutional block attention module (ECCV 2018)pdfBam: Bottleneck attention module(BMVC 2018)pdfA2-nets: Double attention networks (NeurIPS 2018)pdfSrm : A style-based recalibration module for convolutional neural networks (ICCV 2019)pdfGcnet: Non-local networks meet squeeze-excitation networks and beyond (ICCVW 2019)pdfSelective Kernel Networks (CVPR 2019)pdfLinear Context Transform Block (AAAI 2020)pdfGated Channel Transformation for Visual Recognition (CVPR 2020)pdfEcanet: Efficient channel attention for deep convolutional neural networks (CVPR 2020)pdfRotate to Attend: Convolutional Triplet Attention Module (WACV 2021)pdfGaussian Context Transformer (CVPR 2021)pdfCoordinate Attention for Efficient Mobile Network Design (CVPR 2021)pdfSimAM: A Simple, Parameter-Free Attention Module for Convolutional Neural Networks (ICML 2021)pdfVision TransformersAn image is worth 16x16 words: Transformers for image recognition at scale (ICLR 2021)pdfXCiT: Cross-Covariance Image Transformer (NeurIPS 2021)pdfRethinking Spatial Dimensions of Vision Transformers (ICCV 2021)pdfCvT: Introducing Convolutions to Vision Transformers (ICCV 2021)pdfCMT: Convolutional Neural Networks Meet Vision Transformers (CVPR 2022)pdfMetaFormer is Actually What You Need for Vision (CVPR 2022)pdfMobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer (ICLR 2022)pdfDilateFormer: Multi-Scale Dilated Transformer for Visual Recognition (TMM 2023)pdfBViT: Broad Attention based Vision Transformer (TNNLS 2023)pdfConvolutional Neural Networks(CNNs)Network In Network (ICLR 2014)pdfDeep Residual Learning for Image Recognition (CVPR 2016)pdfWide Residual Networks (BMVC 2016)pdfDensely Connected Convolutional Networks (CVPR 2017)pdfDeep Pyramidal Residual Networks (CVPR 2017)pdfMobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications (CVPR 2017)pdfMobileNetV2: Inverted Residuals and Linear Bottlenecks (CVPR 2018)pdfSearching for MobileNetV3 (ICCV 2019)pdfRes2Net: A New Multi-scale Backbone Architecture (TPAMI 2019)pdfGhostNet: More Features from Cheap Operations (CVPR 2020)pdfA ConvNet for the 2020s (CVPR 2022)pdfMLP-Like ModelsMLP-Mixer: An all-MLP Architecture for Vision (NeurIPS 2021)pdfPay Attention to MLPs (NeurIPS 2021)pdfGlobal Filter Networks for Image Classification (NeurIPS 2021)pdfSparse MLP for Image Recognition: Is Self-Attention Really Necessary? (AAAI 2022)pdfDynaMixer: A Vision MLP Architecture with Dynamic Mixing (ICML 2022)pdfPatches Are All You Need? (TMLR 2022)pdfVision Permutator: A Permutable MLP-Like Architecture for Visual Recognition (TPAMI 2022)pdfCycleMLP: A MLP-like Architecture for Dense Prediction (ICLR 2022)pdf