Saravanan666/pypi-org huggingface dataset:
Package: torchphm
phm-feature介绍使用torch torchaudio 构建PHM特征抽取功能层功能层介绍torchphm.layers 将phm固定使用的数据操作，固化为如下层：STFT 离散傅立叶变换Spectrogram 谱图MelFilterbank mel譜过滤AmplitudeToDb 幅度取分贝TimeStretch 变速不变调ComplexNorm 复数输出取模'范数'ApplyFilterbank 过滤器应用应用场景组合上述功能层，实现不同场景:STFT
分帧==>加窗==>短时离散傅立叶变换"变速不变调" Time scale modification
详细见https://zhuanlan.zhihu.com/p/337193578用于声谱图压缩、扩张处理，供后续分析梅尔mel谱转换
对于语谱图进行mel谱转换HPSS
中值滤波，过滤出频率的谐波分量与冲击分量
为什么中值滤波，可以过滤出"数据轮廓"及发现"谐波分量和冲击分量"，参见https://blog.csdn.net/qq_38131594/article/details/80758567软件架构软件结构说明.
├── dist
│   ├── torchphm-1.1.7.tar.gz
│   └── torchphm-1.1.8.tar.gz
├── draw
│   ├── draw_functional.py
│   ├── draw_layers.py
│   ├── draw_torchphm_layers.ipynb
│   ├── torchphm -> ../torchphm
│   └── Untitled.ipynb
├── examples_torchphm.ipynb
├── README.md
├── setup.cfg
├── setup.py
├── tests
│   ├── test_functional.py
│   └── test_layers.py
├── torchphm
│   ├── beta_hpss.py
│   ├── functional.py
│   ├── __init__.py
│   ├── layers.py
└── torchphm.egg-info
    ├── PKG-INFOdist pypi上传包
draw 画图
examples_torchphm.ipynb 应用例程
tests 测试文件
torchphm 实现源码安装教程使用pip进行安装#### 参与贡献

#### 特技
Package: torchpippy
The PiPPy project stands for Pipeline Parallelism for PyTorch. It consists of a
compiler and runtime stack for automated parallelism and scaling of PyTorch
models. PiPPy partitions the code of the model in a pipelined fashion and
enables multiple micro-batches to execute different parts of the model code
concurrently. For details, please visit PiPPy'sGitHub
page.
Package: torch-pitch-shift
Torch Pitch ShiftPitch-shift audio clips quickly with PyTorch (CUDA supported)! Additional utilities for searching efficient transformations are included.View on PyPI/View DocumentationAboutThis package includes two main features:Pitch-shift audio clips quickly using PyTorch (with CUDA support)Calculate efficient pitch-shift targets (useful for augmentation, where speed is more important than precise pitch-shifts)Also check outtorch-time-stretch, a sister project for time-stretching.Installationpipinstalltorch-pitch-shiftUsageExampleCheck outexample.pyto seetorch-pitch-shiftin action!DocumentationSee thedocumentation pagefor detailed documentation!ContributingPlease feel free to submit issues or pull requests!
Package: torch-planck2018-lite
Torch Planck 2018 LiteTorch Planck 2018 Lite is a PyTorch implementation of the Planck 2018 Lite likelihood for the Cosmic Microwave Background (CMB) power spectra. This package provides a convenient and efficient way to compute the log-likelihood of CMB power spectra given a cosmological model.InstallationYou can install Torch Planck 2018 Lite via pip from PyPI:pip install torch-planck2018-liteThis package requires Python 3.6 or later and PyTorch 1.7 or later.UsageTo use the Torch Planck 2018 Lite package, you can import thePlanckLitePyclass and create an instance with the desired settings:fromtorch_planck2018_liteimportPlanckLitePy# Initialize the PlanckLitePy objectplanck=PlanckLitePy(year=2018,spectra="TTTEEE",use_low_ell_bins=False)# Load the power spectraimportnumpyasnpls,Dltt,Dlte,Dlee=np.genfromtxt("path/to/your/data/Dl_planck2015fit.dat",unpack=True)# Compute the log-likelihoodellmin=int(ls[0])loglikelihood=planck.loglike(Dltt,Dlte,Dlee,ellmin)You can customize the behavior of thePlanckLitePyobject by changing its constructor parameters:year: The Planck data release year (2015 or 2018).spectra: The CMB power spectra to use ("TTTEEE" for TT, TE, and EE or "TT" for TT only).use_low_ell_bins: Whether to include low-ell bins in the likelihood calculation (True or False).Running TestsTo run the tests, you can use theunittestmodule:python -m unittest discover teststhis will run all the test cases defined in thetestsdirectory.LicesnseThis project is under the MIT License. See the LICENSE file for more details.CreditThis is a PyTorch implementation of theplanck-lite-pycode byHeather Prince.
Package: torchplite
Torch Planck 2018 Litetorchpliteis a PyTorch implementation of the Planck 2018 Lite likelihood for the Cosmic Microwave Background (CMB) power spectra. This package provides a convenient and efficient way to compute the log-likelihood of CMB power spectra given a cosmological model.InstallationYou can installtorchplitevia pip from PyPI:pip install torchpliteThis package requires Python 3.6 or later and PyTorch 1.7 or later.UsageTo use thetorchplitepackage, you can import thePlanckLitePyclass and create an instance with the desired settings:fromtorchpliteimportPlanckLitePy# Initialize the PlanckLitePy objectplanck=PlanckLitePy(year=2018,spectra="TTTEEE",use_low_ell_bins=False)# Load the power spectraimportnumpyasnpls,Dltt,Dlte,Dlee=np.genfromtxt("path/to/your/data/Dl_planck2015fit.dat",unpack=True)# Compute the log-likelihoodellmin=int(ls[0])loglikelihood=planck.loglike(Dltt,Dlte,Dlee,ellmin)You can customize the behavior of thePlanckLitePyobject by changing its constructor parameters:year: The Planck data release year (2015 or 2018).spectra: The CMB power spectra to use ("TTTEEE" for TT, TE, and EE or "TT" for TT only).use_low_ell_bins: Whether to include low-ell bins in the likelihood calculation (True or False).Running TestsTo run the tests, you can use theunittestmodule:python -m unittest discover teststhis will run all the test cases defined in thetestsdirectory.LicesnseThis project is under the MIT License. See the LICENSE file for more details.CreditThis is a PyTorch implementation of theplanck-lite-pycode byHeather Prince.
Package: torchplot
torchplot - Plotting pytorch tensors made easy!Ask yourself the following:Are you usingmatplotlib.pyplotto plot pytorch tensors?Do you forget to call.cpu().detach().numpy()everytime you want to plot a tensor?Thentorchplotmay be something for you.torchplotis a simple drop-in replacement
for plotting pytorch tensors. We simply override everymatplotlib.pyplotfunction such
that pytorch tensors are automatically converted.Simply just change your defaultmatplotlibimport statement:Instead offrommatplotlib.pyplotimport*usefromtorchplotimport*and instead ofimportmatplotlib.pyplotaspltuseimporttorchplotaspltHerafter, then you can remove every.cpu().detach().numpy()(or variations heroff) from
your code and everything should just work. If you do not want to mix implementations,
we recommend importingtorchplotas seperaly package:importtorchplotastpInstallationSimple aspip install torchplotExample# lets make a scatter plot of two pytorch variables that are stored on gpuimporttorchimporttorchplotaspltx=torch.randn(100,requires_grad=True,device='cuda')y=torch.randn(100,requires_grad=True,device='cuda')plt.plot(x,y,'.')# easy and simpleRequirementsTested usingtorch>=1.6andmatplotlib>=3.3.3but should perfectly work with
both earlier and later versions.LicencePlease observe the Apache 2.0 license that is listed in this repository.BibTeXIf you want to cite the framework feel free to use this (but only if you loved it 😊):@article{detlefsen2021torchplot,title={TorchPlot},author={Detlefsen, Nicki S. and Hauberg, Søren},journal={GitHub. Note: https://github.com/MachineLearningLifeScience/torchplot},year={2021}}
Package: torchplus
torchplusIntroductiontorchplusis a package affiliated to projectPyCTLib. We encapsulated a new type on top ofpytorchtensers, which we call ittorchplus.Tensor. It has the same function astorch.Tensor, but it can automatically select the device it was on and provide batch or channel dimensions. Also, we try to provide more useful module for torch users to make deep learning to be implemented more easily. It reliespython v3.6+withtorch v 1.7.0+.Note thattorch v1.7.0was released in 2020,and it is necessary for this package as the inheritance behavior for this version is different from previous versions.All originaltorchfunctions can be used fortorchplustensors.Special features fortorchplusare still under development. If unknown errors pop our, please use traditionaltorchcode to bypass it and meanwhile it would be very kind of you to let us know if anything is needed: please contact us bye-mail.>>>importtorchplusastp>>>importtorch.nnasnn>>>tp.set_autodevice(False)>>>tp.manual_seed(0)>>>t=tp.randn([3000],400,requires_grad=True)>>>LP=nn.Linear(400,400)>>>a=LP(t)>>>a.sum().backward()>>>print(t.grad)Tensor([[-0.2986,0.0267,0.9059,...,0.4563,-0.1291,0.5702],[-0.2986,0.0267,0.9059,...,0.4563,-0.1291,0.5702],[-0.2986,0.0267,0.9059,...,0.4563,-0.1291,0.5702],...,[-0.2986,0.0267,0.9059,...,0.4563,-0.1291,0.5702],[-0.2986,0.0267,0.9059,...,0.4563,-0.1291,0.5702],[-0.2986,0.0267,0.9059,...,0.4563,-0.1291,0.5702]],shape=torchplus.Size([3000],400))torchplushas all of following appealing features:Auto assignthe tensors to availableGPUdeviceby default.Use[nbatch]or{nchannel}to specifythe batch and channel dimensions. i.e.tp.rand([4], {2}, 20, 30)returns a tensor of $20	imes30$ matrices of channel 2 with batch size 4. One may also usetensor.batch_dimensionto access to batch dimension, channel dimension can be operated likewise.Batch and channel dimension can helpauto matching the sizesof two tensors in operations. For example, tensors of sizes(3, [2], 4)and(3, 4)can be automatically added together with axis of size 3 and 4 matched together. Some methods will also use this information. Sampling, for example, will take the batch dimension as priority.The tensor object iscompatible with alltorchfunctions.InstallationThis package can be installed bypip install torchplusor moving the source code to the directory of python libraries (the source code can be downloaded ongithuborPyPI).pipinstalltorchplusUsagesNot available yet, one may check the codes for usages.Acknowledgment@Yiteng Zhang, Yuncheng Zhou: Developers
Package: torch-points-kernels
3D Point Cloud KernelsPytorch CPU and CUDA kernels for spatial search and interpolation for 3D point clouds.InstallationRequires torchversion 1.0 or higher to be installed before proceeding. Once this is done, simply runpip install torch-points-kernelsor with poetry:poetry add torch-points-kernelsTo force CUDA installation (for example on Docker builds) please use the flagFORCE_CUDAlikepip install torch-points-kernels FORCE_CUDA=1Usageimport torch
import torch_points_kernels.points_cudaBuild and testpython setup.py build_ext --inplace
python -m unittestTroubleshootingCompilation issuesEnsure that at least PyTorch 1.4.0 is installed and verify thatcuda/binandcuda/includeare in your$PATHand$CPATHrespectively, e.g.:$ python -c "import torch; print(torch.__version__)"
>>> 1.4.0

$ echo $PATH
>>> /usr/local/cuda/bin:...

$ echo $CPATH
>>> /usr/local/cuda/include:...On the compilation, if you have this error:error: cannot call member function 'void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable()it means that your nvcc version is too old. The version must be at least 10.1.168.
To check the version:nvcc --version
>>> V10.1.168Windows compilationOn Windows you may have this error when compiling:error: member "torch::jit::detail::ModulePolicy::all_slots" may not be initialized
error: member "torch::jit::detail::ParameterPolicy::all_slots" may not be initialized
error: member "torch::jit::detail::BufferPolicy::all_slots" may not be initialized
error: member "torch::jit::detail::AttributePolicy::all_slots" may not be initializedThis requires you to edit some of your pytorch header files, usethis scriptas a guide.CUDA kernel failed : no kernel image is available for execution on the deviceThis can happen when trying to run the code on a different GPU than the one used to compile thetorch-points-kernelslibrary. Uninstalltorch-points-kernels, clear cache, and reinstall after setting theTORCH_CUDA_ARCH_LISTenvironment variable. For example, for compiling with a Tesla T4 (Turing 7.5) and running the code on a Tesla V100 (Volta 7.0) use:export TORCH_CUDA_ARCH_LIST="7.0;7.5"Seethis useful chartfor more architecture compatibility.Projects using those kernels.Pytorch Point Cloud BenchmarkCreditPointnet2_TensorflowbyCharles R. QiPointnet2_PyTorchbyErik WijmansGRNetbyHaozhe Xie
Package: torch-position-embedding
PyTorch Position EmbeddingInstallpipinstalltorch-position-embeddingUsagefromtorch_position_embeddingimportPositionEmbeddingPositionEmbedding(num_embeddings=5,embedding_dim=10,mode=PositionEmbedding.MODE_ADD)Modes:MODE_EXPAND: negative indices could be used to represent relative positions.MODE_ADD: add position embedding to the original tensor.MODE_CAT: concatenate position embedding to the original tensor.
Package: torchpropel
PRObablistic Parametric rEgression Loss (PROPEL)PRObabilistic Parametric rEgresison Loss (PROPEL) is a loss function that enables probabilisitic regression for a neural network. It achieves this by enabling a neural network to learn parameters of a mixture of Gaussian distribution.Further details about the loss can be found in the paper:PROPEL: Probabilistic Parametric Regression Loss for Convolutional Neural NetworksThis repository provides official pytorch implementation of PROPEL.Installation InstructionsPROPEL can be installed using the following commandpipinstalltorchpropelpipinstallgit+https://github.com/masadcv/PROPEL.gitUsage ExampleimporttorchimportnumpyasnpfromtorchpropelimportPROPEL# Our example has a neural network with# output [num_batch, num_gaussians, num_dims]num_batch=4num_gaussians=6num_dims=3# setting ground-truth variance sigma_gt=0.2sigma_gt=0.2propel_loss=PROPEL(sigma_gt)# ground truth targets for lossy=torch.ones((num_batch,num_dims))*0.5# example prediction - this can also be coming as output of a neural networkfeat_g=np.random.randn(num_batch,num_gaussians,2*num_dims)*0.5feat_g[:,:,num_dims::]=0.2feat=torch.tensor(feat_g,dtype=y.dtype)# compute the lossL=propel_loss(feat,y)print(L)DocumentationFurther details of each function implemented for PROPEL can be accessed at the documentation hosted at:https://masadcv.github.io/PROPEL/index.html.Citing PROPELPre-print of PROPEL can be found at:PROPEL: Probabilistic Parametric Regression Loss for Convolutional Neural NetworksIf you use PROPEL in your research, then please cite:BibTeX:@inproceedings{asad2020propel,
  title={PROPEL: Probabilistic Parametric Regression Loss for Convolutional Neural Networks},
  author={Asad, Muhammad and Basaru, Rilwan and Arif, SM and Slabaugh, Greg},
  booktitle={25th International Conference on Pattern Recognition},
  pages={},
  year={2020}}
Package: torchps
TorchPSA phase-space generator based on "RAMBO on diet" for PyTorchThis is a PyTorch implementation of "RAMBO on diet" (arXiv:1308.2922) providing all the necessary functionalites for phase space sampling.
It maps the unit-hypercube into the final state particle phase space and can be used to integrate matrix elements with a
unit hypercube phase space generator.
Package: torch-pso
Torch PSOParticle Swarm Optimization is an optimization technique that iteratively attempts to improve a list of candidate
solutions. Each candidate solution is called a "particle", and collectively they are called a "swarm". In each step of
the optimization, each particle moves in a random directly while simultaneously being pulled towards the other particles
in the swarm. A simple introduction to the algorithm can be found onits Wikipedia article.This package implements the Particle Swarm Optimization using the PyTorch Optimizer API, making it compatible with
most pre-existing Torch training loops.InstallationTo install Torch PSO using PyPI, run the following command:$ pip install torch-psoGetting StartedTo use the ParticleSwarmOptimizer, simply import it, and use it as with any other PyTorch Optimizer.
Hyperparameters of the optimizer can also be specified. In practice, most PyTorch tutorials could be used to create
a use-case, simply substituting the ParticleSwarmOptimizer for any other optimizer.
A simplified use-case can be seen below, which trains a simple neural network to match its output to a target.importtorchfromtorch.nnimportSequential,Linear,MSELossfromtorch_psoimportParticleSwarmOptimizernet=Sequential(Linear(10,100),Linear(100,100),Linear(100,10))optim=ParticleSwarmOptimizer(net.parameters(),inertial_weight=0.5,num_particles=100,max_param_value=1,min_param_value=-1)criterion=MSELoss()target=torch.rand((10,)).round()x=torch.rand((10,))for_inrange(100):defclosure():# Clear any grads from before the optimization step, since we will be changing the parametersoptim.zero_grad()returncriterion(net(x),target)optim.step(closure)print('Prediciton',net(x))print('Target    ',target)
Package: torchpt
# Checkpointing
Unified model state dict and architecture checkpoints utils.Traditional model loading requires
1. Model architecture
2. model state dict.Normally we only save the model state dict in the checkpoint file, this forces us to
have the model architecture during inference. We can either load the model architecture
by instaling the package which contains the architecture dependency or we can copy the architecture file
to current repo. This creates additional dependencies for the production code.One way to solve this problem is to save the model architecture to the checkpoint file itself and load both
the model architecture and state dict from the same checkpoint file. This solves few development issues:
1. If model architecture is changed in the architecture repo we wont have to use some old commit of the repo.
For any architecture change and there is no need to map checkpoints to architecture version.
2. Each checkpoint is self sufficient and independent.Checkpointing add following utils:
1. Given a model architecture and state dict create a checkpointing checkpoint.
2. Given a checkpointing checkpoint return a the model with state dict loaded.
Package: torchpwl
Piecewise Linear Functions (PWLs) can be used to approximate any 1D function.
PWLs are built with a configurable number of line segments - the more segments the more accurate the approximation.
This package implements PWLs in PyTorch and as such they can be fit to the data using standard gradient descent.
For example:import torchpwl# Create a PWL consisting of 3 segments for 5 features - each feature will have its own PWL function.
pwl = torchpwl.PWL(num_features=5, num_breakpoints=3)
x = torch.Tensor(11, 5).normal_()
y = pwl(x)Monotonicity is also supported viaMonoPWL. See the class documentations for more details.
Package: torchqtm
torchquantumTorchQuantum is a backtesting framework that""" integrates
the structure of PyTorch and WorldQuant's Operator for
efficient quantitative financial analysis.ContentsInstallationFeaturesContributionInstallationfor Unix:cd/path/to/your/directory
gitclonegit@github.com:nymath/torchqtm.gitcd./torchqtmBefore running examples, you should compile the cython code.pythonsetup.pybuild_ext--inplaceNow you can run examplespython./examples/main.pyIf you are not downloading the dataset, then you shouldcd./examples
mkdirlargedatacd./largedata
wgethttps://github.com/nymath/torchqtm/releases/download/V0.1/stocks_f64.pkl.zip
unzipstocks_f64.pkl.zip
rmstocks_f64.pkl.zipcd../cd../
gitcheckoutdevAs for the backtesting dataset, we use the bundle provided byricequant.
We have wrapped the code into Makefile, you can just run the following command to download the bundle.makerqalpha_download_bundlefor windows:
We highly recommend you to use WSL2 to run torchquantum.Examplesalpha miningYou can easily create an alpha through torchquantum!importtorchqtm.opasopimporttorchqtm.op.functionalasFclassNeutralizePE(op.Fundamental):def__init__(self,env):super().__init__(env)self.lag=op.Parameter(5,requires_optim=False,feasible_region=None)defforward(self):self.data=F.divide(1,self.env.PE)self.data=F.winsorize(self.data,'std',4)self.data=F.normalize(self.data)self.data=F.group_neutralize(self.data,self.env.Sector)self.data=F.regression_neut(self.data,self.env.MktVal)self.data=F.ts_mean(self.data,self.lag)returnself.dataFis library that contains the operators defined by WorldQuant.op.Fundamentalimplies the NeutralizePE belongs to fundamental alpha.self.lagis the parameter of rolling mean, which can be optimized through grid search.backtestingHere we create a buy and hold strategy for illustration.fromtorchqtm.edbt.algorithmimportTradingAlgorithmfromtorchqtm.assetsimportEquityclassBuyAndHold(TradingAlgorithm):definitialize(self):self.safe_set_attr("s0",Equity("000001.XSHE"))self.safe_set_attr("count",0)defbefore_trading_start(self):passdefhandle_data(self):ifself.count==0:self.order(self.s0,10000)self.count+=1defanalyze(self):passFeaturesHigh-speed backtesting framework (most of the operators are implemented through cython)A revised gplearn library that is compatible with Alpha mining.CNN and other state of the art models for mining alphas.Event Driven backtesting framework is available.ContributionFor more information, we refer toDocumentation.Join usIf you are interested in quantitative finance and are committed to devoting
your life to alpha mining, you can contact me through WeChat at Ny_math.Referencesquantopian/alphalensquantopian/zipline
Package: torch-radiate
RadiateAutomatic deep learning reasearch report generatorContributingHow to contribute ?Create a branch by feature and/or bug fixGet the codeCommit and pushCreate a pull requestBranch namingFeature branchfeature/ [Short feature description] [Issue number]Bug branchfix/ [Short fix description] [Issue number]Commits syntax:Adding code:+ Added [Short Description] [Issue Number]Deleting code:- Deleted [Short Description] [Issue Number]Modifying code:* Changed [Short Description] [Issue Number]Merging code:Y Merged [Short Description] [Issue Number]Icons made byFreepikfromwww.flaticon.comis licensed byCC 3.0 BY