Saravanan666/pypi-org huggingface dataset:
Package: tensorio-bundler
tensorio-bundlerCreate TensorIO model bundlesRunning the bundler from the command lineNOTE: Working on making a PyPI package. Once that is done, these instructions will change
to use whatever binary the correspondingpip installproduces.RequirementsPython 3InstructionsThetensorio_bundlermodule comes with abundlerutility that you can use to create TensorIO
zipped tiobundle files directly from your command line.For more information on how to run thebundler, run:python -m tensorio_bundler.bundler -hA sample invocation (using test data, assumed to be run from project root -- same directory as this
README):python -m tensorio_bundler.bundler \
    --tflite-model ./tensorio_bundler/fixtures/test.tflite \
    --model-json ./tensorio_bundler/fixtures/test.tiobundle/model.json \
    --assets-dir ./tensorio_bundler/fixtures/test.tiobundle/assets \
    --bundle-name sample.tiobundle \
    --outfile sample.tiobundle.zipCalling the bundler locally through the REST APITo run the REST API locally from project root (same directory as this README):gunicorn tensorio_bundler.rest:apiIn a separate terminal window, you can invoke the bundler as follows:TFLITE_PATH="\"$(mktemp -d)/model.tflite\""

read -r -d '' REQUEST_BODY <<-EOF
    {
        "saved_model_dir": "./tensorio_bundler/fixtures/test-model",
        "build": true,
        "tflite_path": $TFLITE_PATH,
        "model_json_path": "./tensorio_bundler/fixtures/test.tiobundle/model.json",
        "assets_path": "./tensorio_bundler/fixtures/test.tiobundle/assets",
        "bundle_name": "curl-test.tiobundle",
        "bundle_output_path": "curl-test.tiobundle.zip"
    }
EOF

curl -v -X POST \
    -H "Content-Type: application/json" \
    -d "$REQUEST_BODY" \
    http://localhost:8000/bundleRunning the bundler via dockerRequirementsDockerIf you don't have it,get itInstructionsYou can either bind mount the paths to the inputs into your docker container when you run the
bundler or you can bind mount in a service account credentials file and set theGOOGLE_APPLICATION_CREDENTIALSenvironment variable to point at the mount path in the container.NOTE: These instructions are extremely sparse at the moment. They will not be so forever.TensorIO Models repositoriesThe TensorIO bundler is now integrated withtensorio-modelsvia the Repository REST API. Once a bundle has been built, you can use thetensorio_bundler.bundler.register_bundlemethod to register it against a TensorIO Models
repository. Thetensorio_bundler.bundlerCLI allows you to do this automatically through the--repository-pathargument.This requires two environment variables to be set in your environment:REPOSITORY-- a URL for a TensorIO models repository API URL (e.g.https://tio-models-test.dev.docai.beer/rest/v1/repository)REPISITORY_API_KEY-- a basic auth token used to authenticate requests against the repository
REST API.Running tests if you want to contribute to this projectRequirementsDockerIf you don't have it,get itInstructionsSimply run:./test.sh
Package: tensorlayer3
TensorLayer3 is a deep learning library designed for researchers and engineers that is compatible with multiple deep learning frameworks such as TensorFlow,
MindSpore and PaddlePaddle, allowing users to run the code on different hardware like Nvidia-GPU and Huawei-Ascend.
It provides popular DL and RL modules that can be easily customized and assembled for tackling real-world machine learning problems.
More details can be found here. TensorLayer3 will support TensorFlow, MindSpore, PaddlePaddle, and PyTorch backends in the future.InstallTensorLayer3 has some prerequisites that need to be installed first, including TensorFlow ,
MindSpore, PaddlePaddle,numpy and matplotlib.For GPU support CUDA and cuDNN are required.# for last stable versionpipinstall--upgradetensorlayer3# for latest release candidatepipinstall--upgrade--pretensorlayer3# if you want to install the additional dependencies, you can also runpipinstall--upgradetensorlayer3[all]# all additional dependenciespipinstall--upgradetensorlayer3[extra]# only the `extra` dependenciespipinstall--upgradetensorlayer3[contrib_loggers]# only the `contrib_loggers` dependenciesAlternatively, you can install the latest or development version by directly pulling from OpenI:pip3installgit+https://git.openi.org.cn/TensorLayer/tensorlayer3.0.gitContainers with CPU support# for CPU version and Python 2dockerpulltensorlayer/tensorlayer:latestdockerrun-it--rm-p8888:8888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest# for CPU version and Python 3dockerpulltensorlayer/tensorlayer:latest-py3dockerrun-it--rm-p8888:8888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest-py3Containers with GPU supportNVIDIA-Docker is required for these containers to work:Project
Link# for GPU version and Python 2dockerpulltensorlayer/tensorlayer:latest-gpunvidia-dockerrun-it--rm-p8888:88888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest-gpu# for GPU version and Python 3dockerpulltensorlayer/tensorlayer:latest-gpu-py3nvidia-dockerrun-it--rm-p8888:8888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest-gpu-py3ContributePlease read theContributor
Guidelinebefore submitting your PRs.CiteIf you find this project useful, we would be grateful if you cite the
TensorLayer papers.@article{tensorlayer2017,
    author  = {Dong, Hao and Supratak, Akara and Mai, Luo and Liu, Fangde and Oehmichen, Axel and Yu, Simiao and Guo, Yike},
    journal = {ACM Multimedia},
    title   = {{TensorLayer: A Versatile Library for Efficient Deep Learning Development}},
    url     = {http://tensorlayer.org},
    year    = {2017}
}
@inproceedings{tensorlayer2021,
    title={Tensorlayer 3.0: A Deep Learning Library Compatible With Multiple Backends},
    author={Lai, Cheng and Han, Jiarong and Dong, Hao},
    booktitle={2021 IEEE International Conference on Multimedia \& Expo Workshops (ICMEW)},
    pages={1--3},
    year={2021},
    organization={IEEE}
}LicenseTensorLayer3 is released under the Apache 2.0 license.
Package: tensorlayerx
TensorLayerX is a deep learning library designed for researchers and engineers that is compatible with multiple deep learning frameworks such as TensorFlow,
MindSpore and PaddlePaddle, allowing users to run the code on different hardware like Nvidia-GPU and Huawei-Ascend.
It provides popular DL and RL modules that can be easily customized and assembled for tackling real-world machine learning problems.
More details can be found here. TensorLayerX will support TensorFlow, MindSpore, PaddlePaddle, and PyTorch backends in the future.InstallTensorLayerX has some prerequisites that need to be installed first, including TensorFlow ,
MindSpore, PaddlePaddle,numpy and matplotlib.For GPU support CUDA and cuDNN are required.# for last stable versionpipinstall--upgradetensorlayerX# for latest release candidatepipinstall--upgrade--pretensorlayerX# if you want to install the additional dependencies, you can also runpipinstall--upgradetensorlayerX[all]# all additional dependenciespipinstall--upgradetensorlayerX[extra]# only the `extra` dependenciespipinstall--upgradetensorlayerX[contrib_loggers]# only the `contrib_loggers` dependenciesAlternatively, you can install the latest or development version by directly pulling from OpenI:pip3installgit+https://github.com/tensorlayer/TensorLayerX.gitContainers with CPU support# for CPU version and Python 2dockerpulltensorlayer/tensorlayer:latestdockerrun-it--rm-p8888:8888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest# for CPU version and Python 3dockerpulltensorlayer/tensorlayer:latest-py3dockerrun-it--rm-p8888:8888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest-py3Containers with GPU supportNVIDIA-Docker is required for these containers to work:Project
Link# for GPU version and Python 2dockerpulltensorlayer/tensorlayer:latest-gpunvidia-dockerrun-it--rm-p8888:88888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest-gpu# for GPU version and Python 3dockerpulltensorlayer/tensorlayer:latest-gpu-py3nvidia-dockerrun-it--rm-p8888:8888-p6006:6006-ePASSWORD=JUPYTER_NB_PASSWORDtensorlayer/tensorlayer:latest-gpu-py3CiteIf you find this project useful, we would be grateful if you cite the
TensorLayer papers.@article{tensorlayer2017,
    author  = {Dong, Hao and Supratak, Akara and Mai, Luo and Liu, Fangde and Oehmichen, Axel and Yu, Simiao and Guo, Yike},
    journal = {ACM Multimedia},
    title   = {{TensorLayer: A Versatile Library for Efficient Deep Learning Development}},
    url     = {http://tensorlayer.org},
    year    = {2017}
}
@inproceedings{tensorlayer2021,
    title={Tensorlayer 3.0: A Deep Learning Library Compatible With Multiple Backends},
    author={Lai, Cheng and Han, Jiarong and Dong, Hao},
    booktitle={2021 IEEE International Conference on Multimedia \& Expo Workshops (ICMEW)},
    pages={1--3},
    year={2021},
    organization={IEEE}
}LicenseTensorLayerX is released under the Apache 2.0 license.
Package: tensorleap
Keras data format converterGenerates equal keras models with the desired data formatRequirementstensorflow >= 2.0APIconvert_channels_first_to_last(model: keras.Model, inputs_to_transpose: List[str] = None, verbose: bool = False) -> keras.Modelconvert_channels_last_to_first(model: tf.keras.Model, inputs_to_transpose: List[str] = None, verbose: bool = False) \ -> tf.keras.Modelmodel: Keras model to convertinputs_to_transpose: list of input names that need to be transposed due tothe data foramt changingverbose: detailed outputGetting startedfromtensorflowimportkerasfromkeras_data_format_converterimportconvert_channels_last_to_first# Load Keras modelkeras_model=keras.models.load_model("my_image_model")# Call the converter (image_input is an input that needs to be transposed, can be different for your model)converted_model=convert_channels_last_to_first(keras_model,["image_input"])Supported Layers with Special handlingNormalization layersPermuteReshapeConcatenateDotMultiHeadAttentionTFOpLambda (Inserted by the Functional API construction whenever users call
a supported TF symbol on KerasTensors, seehereat Tensorflow repo for more info)Unsupported Layers due to lack of data_format propertyCropping1DUpsampling1DZeropadding1DAll layers in tensorflow.keras.preprocessingHow to deployCreate a new release version on GitHubUpdate parameters in setup.py (usuallyversionanddownload_url)Runpython setup.py sdistin root directoryRunpip install twineRuntwine upload dist/*LicenseThis software is covered by MIT License.
Package: tensorloader
Tensor LoaderTensorLoaderis similar to the combination of PyTorch'sTensorDatasetandDataLoader. It is faster and has better type hints.InstallationInstall from PyPi:pipinstalltensorloaderInstall from source:gitclonehttps://github.com/zhb2000/tensorloader.gitcdtensorloader
pipinstall.UsageThis package only contains aTensorLoaderclass.fromtensorloaderimportTensorLoaderUse a single tensor as data:X=torch.tensor(...)dataloader=TensorLoader(X)forxindataloader:...Use a tuple of tensor as data:X=torch.tensor(...)Y=torch.tensor(...)dataloader=TensorLoader((X,Y))forx,yindataloader:# unpack the batch tuple as x, y...Use a namedtuple of tensor as data:fromcollectionsimportnamedtupleBatch=namedtuple('Batch',['x','y'])X=torch.tensor(...)Y=torch.tensor(...)# set unpack_args=True when using a namedtuple as datadataloader=TensorLoader(Batch(X,Y),unpack_args=True)forbatchindataloader:assertisinstance(batch,Batch)assertisinstance(batch.x,torch.Tensor)assertisinstance(batch.y,torch.Tensor)x,y=batch...PS: Namedtuples are similar to common tuples and they allow field access by name which makes code more readable. For more information, see thedocumentationof namedtuple.Speed TestTensorLoaderis much faster thanTensorDataset+DataLoader, for it uses vectorized operations instead of creating costly Python lists.importtimeitimporttorchfromtorch.utils.dataimportTensorDataset,DataLoaderfromtensorloaderimportTensorLoaderdefspeed_test(epoch_num:int,**kwargs):sample_num=int(1e6)X=torch.zeros(sample_num,10)Y=torch.zeros(sample_num)tensorloader=TensorLoader((X,Y),**kwargs)torchloader=DataLoader(TensorDataset(X,Y),**kwargs)defloop(loader):for_inloader:passt1=timeit.timeit(lambda:loop(tensorloader),number=epoch_num)t2=timeit.timeit(lambda:loop(torchloader),number=epoch_num)print(f'TensorLoader:{t1:.4g}s, TensorDatset + DataLoader:{t2:.4g}s.')>>> speed_test(epoch_num=10, batch_size=128, shuffle=False)
TensorLoader: 0.363s, TensorDatset + DataLoader: 54.39s.
>>> speed_test(epoch_num=10, batch_size=128, shuffle=True)
TensorLoader: 0.9296s, TensorDatset + DataLoader: 56.54s.
>>> speed_test(epoch_num=10, batch_size=10000, shuffle=False)
TensorLoader: 0.005262s, TensorDatset + DataLoader: 55.57s.
>>> speed_test(epoch_num=10, batch_size=10000, shuffle=True)
TensorLoader: 0.5682s, TensorDatset + DataLoader: 57.71s.
Package: tensorly-gcp
TensorLy-GcpTensorLy-Gcp is a Python library for fitting generalized parafac decomposition (GCP) [1] and its stochastic version (SGCP) [2] which allows using different losses rather than only Euclidean. Tensorly-Gcp builds on top ofTensorLy. Both GCP and SGCP algorithms fit generalized parafac given an input tensor using a gradient-based algorithm. Gradients are computed according to a loss selected by the user, and may be provided by the user, allowing customization. While GCP implementation uses Limited-memory BFGS (LBFGS) method for optimization, SGCP uses ADAM optimization as in [2].The following losses are implemented in Tensorly-Gcp:RayleighBernoulli oddsBernoulli logitGammaPoisson countPoisson logGaussianContributingAt the moment, only Numpy backend is supported to implement GCP and SGCP. This library can be compatible with other backends (Pytorch, Tensorflow, Jax, Mxnet) by improving LBFGS with the given information inhere. Then, it could eventually be merged in TensorLy.UsageIt is possible select one of the losses from the list above and fit generalized decomposition easily:fromtlgcpimportgeneralized_parafacrank=3loss='rayleigh'tensorgcp,errorsgcp=generalized_parafac(tensor,rank=rank,loss=loss)Installing TensorLy-GCPThrough pippip install tensorly-gcpFrom sourcegit clone https://github.com/tensorly/gcp
cd gcp
pip install -e .References[1]Hong, D., Kolda, T. G., & Duersch, J. A. (2020). Generalized canonical polyadic tensor decomposition. SIAM Review, 62(1), 133-163.Link-1[2]Kolda, T. G., & Hong, D. (2020). Stochastic gradients for large-scale tensor decomposition. SIAM Journal on Mathematics of Data Science, 2(4), 1066-1095.Link-2
Package: tensorly-quantum
TensorLy-Quantum is a Python library for Tensor-Based Quantum Machine Learning that
builds on top ofTensorLyandPyTorch.Website:http://tensorly.org/quantum/Source-code:https://github.com/tensorly/quantumWith TensorLy-Quantum, you can easily:Create large quantum circuit: Tensor network formalism requires up to exponentially less memory for quantum simulation than traditional vector and matrix approaches.Leverage tensor methods: the state vectors are efficiently represented in factorized form as Tensor-Rings (MPS) and the operators as TT-Matrices (MPO)Efficient simulation: tensorly-quantum leverages the factorized structure to efficiently perform quantum simulation without ever forming the full, dense operators and state-vectorsMulti-Basis Encoding: we provide multi-basis encoding out-of-the-box for scalable experimentationSolve hard problems: we provide all the tools to solve the MaxCut problem for an unprecendented number of qubits / verticesInstalling TensorLy-QuantumThrough pippip install tensorly-quantumFrom sourcegit clone https://github.com/tensorly/quantum
cd quantum
pip install -e .
Package: tensorly-sphinx-theme
This is theTensorLytheme forSphinxdocumentations,
based onBulma.InstallationAfter cloning this repository, simply run:pipinstall-e.UsageTo use the theme in your project, add the following to theconf.pyfile of your sphinx documentation:html_theme="tensorly_sphinx_theme"ConfigurationProject logoThe logo of your project will be used in the navigation bar. You can specify the path to it in yourconf.py:html_logo = '_static/image.png'Navigation and main optionsYou can set most of the parameters in your sphinx configuration file (conf.py).The options are:‘google_analytics’: str, your Google analytics ID, if any.‘nav_links’:  tuple list, a list of (‘Link display name’, ‘local.file’), contains the links to the local documentation, in the top navigation bar. If the link starts with ‘http’, it will be considered as an external link.‘nav_dropdowns’: same as above but contains multiple links in a dropdown.Example:html_theme_options = {'google_analytics' : 'YOUR_GOOGLE_ANALYTICS_ID','nav_links' : [('Install', 'installation'),('User Guide', 'user_guide/index'),('TensorLy', 'https://github.com/tensorly/tensorly'),('TensorLy-Torch', 'https://github.com/tensorly/torch')],'nav_dropdowns': [('LinksInDropdown', [('TensorLy', 'http://tensorly.org/dev'),('TensorLy-Viz', 'http://tensorly.org/viz'),('TensorLy-Quantum', 'http://tensorly.org/quantum')])],}In rst filesIn your documentation itself, you can use:no-toc:,:no-localtoc:and:no-pagination:to remove the side-menu’s table of content (toc), local toc (“on this page”)
and pagination buttons, respectively.
For instance, if you don’t wantfile.rstto have a toc, simply add in the file::no-toc:
Package: tensorly-viz
TLViz is a Python package for visualising component-based decomposition models like PARAFAC and PCA.DocumentationThe documentation
is available onthe TensorLy websiteand includesAprimer on tensors,tensor factorisationsand thenotation we useAn example galleryThe API referenceDependenciesTLViz supports Python 3.8 or above (it may also work with Python 3.6 and 3.7, though that is not officially supported).Installation requires matplotlib, numpy, pandas, scipy, statsmodels and xarray.InstallationTo install the latest stable release of TLViz and its dependencies, run:pip install tensorly-vizThere is also functionality to create improved QQ-plots with Pingoiun.
However, this is disabled by default due to the restrictive GPL lisence.
To enable this possibility, you must manuallyinstall Pingoiun.To install the latest development version of TLViz, you can either clone
this repo or runpip install git+https://github.com/marieroald/tlviz.gitSome extra dependencies are needed to run the examples, tests or build the documentation.
For more information about installing these dependencies, see theinstallation guide.Exampleimporttlvizimportmatplotlib.pyplotaspltfromtensorly.decompositionimportparafacdeffit_parafac(dataset,num_components,num_inits):model_candidates=[parafac(dataset.data,num_components,init="random",random_state=i)foriinrange(num_inits)]model=tlviz.multimodel_evaluation.get_model_with_lowest_error(model_candidates,dataset)returntlviz.postprocessing.postprocess(model,dataset)data=tlviz.data.load_aminoacids()cp_tensor=fit_parafac(data,3,num_inits=3)tlviz.visualisation.components_plot(cp_tensor)plt.show()Loading Aminoacids dataset from:
Bro, R, PARAFAC: Tutorial and applications, Chemometrics and Intelligent Laboratory Systems, 1997, 38, 149-171This example uses TensorLy to fit five three-component PARAFAC models to the data. Then it uses TLViz to do the following steps:Select the model that gave the lowest reconstruction error.Normalise the component vectors, storing their magnitude in a separate weight-vector.Permute the components in descending weight (i.e. signal strength) order.Flip the components so they point in a logical direction compared to the data.Convert the factor matrices into Pandas DataFrames with logical indices.Plot the components using matplotlib.All these steps are described in theAPI documentationwith references to the literature.TestingThe test suite requires an additional set of dependencies. To install these, runpip install tlviz[test]orpip install -e .[test]inside your local copy of the TLViz repository.The tests can be run by callingpytestwith no additional arguments.
All doctests are ran by default and a coverage summary will be printed on the screen.
To generate a coverage report, runcoverage html.ContributingContributions are welcome to TLViz, see thecontribution guidelines.
Package: tensor-observer
tensor-observerSimple PHP Server to keep track of current machine learning trainings.Install a little api librarypip install tensor-observerpush the following files to your server and maintain the folder structureindex.phpphp/*assets/*and create a "data" foldercreate an object of the APIfromtensor-observerimportTensorObserverto_api=TensorObserver('http://localhost:8080')push your scalars during training byto_api.scalar(self,scalar,run,tag,step,wall_time=None)This method performs a http post request to save a scalar value from the training process.Args:scalar: number that should be savedrun: run identifiertag: tag of the scalarstep: step idwall_time: if not specified, current time is takenwrap your script in a try catch block to push exceptionsto_api.exception(self,e,run,wall_time=None)This method performs a http post request to notify that an exception happend.Args:e: Exception objectrun: run identifierwall_time: if not specified, current time is takensend a end signal at the end to mark a run as terminatedto_api.end_signal(self,run,wall_time=None)This method performs a http post request to notify that the run terminatedArgs:run: run identifierwall_time: if not specified, current time is takenhave fun!
Package: tensorop
# tensorop<img style="float: centre;" src="tensorop_logo.png">[![PyPI version](https://badge.fury.io/py/tensorop.svg)](https://badge.fury.io/py/tensorop)Tensorop is a Deep Learning library built over Pytorch to accelerate research in the simplest manner possible without compromising on flexibility. Each module/object returned can be used with Pytorch at any moment (total sync). It can also be extended with [fastai](https://github.com/fastai/fastai).## Getting Started### PrerequisitesInstall `pytorch` and `torchvision` from [pytorch.org](pytorch.org)- Pytorch 1.0- Torchvision- Fastai (Optional: Can be extended)- Pandas- Numpy### InstallingUsing with git (Recommended method)```$ git clone https://github.com/prajjwal1/tensorop$ cd tensorop```Installation via Pypi```$ pip3 install tensorop```Pypi install is not being updated regularly until v0.1 comes out### Example/TutorialsTutorials can be found [here](https://github.com/prajjwal1/tensorop/tree/master/nbs). They may not be updated,please refer to docs for updated API or file an issue.- Image Classification- [Example 1](https://github.com/prajjwal1/tensorop/blob/master/nbs/example1.ipynb)## DocsDocs can be found [here](https://github.com/prajjwal1/tensorop/tree/master/docs).### Components (Structure)- Model- Dataset- Loss- Norm- Torch Utils- Trainer- Transforms- Ensembling- UtilsThese are frequently changing once `v0.1` is out## ContributingThere is so much work which needs to be done as of now, PRs are always welcome.
Package: tensorpac
DescriptionTensorpac is an Python open-source toolbox for computing Phase-Amplitude Coupling (PAC) using tensors and parallel computing for an efficient, and highly flexible modular implementation of PAC metrics both known and novel. Check out ourdocumentationfor details.InstallationTensorpac uses NumPy, SciPy and joblib for parallel computing. To get started, just open your terminal and run :$pipinstalltensorpacCode snippet & illustrationfromtensorpacimportPacfromtensorpac.signalsimportpac_signals_tort# Dataset of signals artificially coupled between 10hz and 100hz :n_epochs=20# number of trialsn_times=4000# number of time pointssf=512.# sampling frequency# Create artificially coupled signals using Tort method :data,time=pac_signals_tort(f_pha=10,f_amp=100,noise=2,n_epochs=n_epochs,dpha=10,damp=10,sf=sf,n_times=n_times)# Define a Pac objectp=Pac(idpac=(6,0,0),f_pha='hres',f_amp='hres')# Filter the data and extract pacxpac=p.filterfit(sf,data)# plot your Phase-Amplitude Coupling :p.comodulogram(xpac.mean(-1),cmap='Spectral_r',plotas='contour',ncontours=5,title=r'10hz phase$\Leftrightarrow$100Hz amplitude coupling',fz_title=14,fz_labels=13)p.show()