Saravanan666/pypi-org huggingface dataset:
Package: tensorpack
Tensorpack is a neural network training interface based on TensorFlow.Features:It's Yet Another TF high-level API, withspeed, andflexibilitybuilt together.Focus ontraining speed.Speed comes for free with Tensorpack -- it uses TensorFlow in theefficient waywith no extra overhead.
On common CNNs, it runs training1.2~5x fasterthan the equivalent Keras code.
Your training can probably gets faster if written with Tensorpack.Data-parallel multi-GPU/distributed training strategy is off-the-shelf to use.
It scales as well as Google'sofficial benchmark.Seetensorpack/benchmarksfor
some benchmark scripts.Focus onlarge datasets.You don't usually needtf.data.
Symbolic programming often makes data processing harder.
Tensorpack helps you efficiently process large datasets (e.g. ImageNet) inpure Pythonwith autoparallelization.It's not a model wrapper.There are too many symbolic function wrappers in the world. Tensorpack includes only a few common models.
But you can use any symbolic function library inside Tensorpack, including tf.layers/Keras/slim/tflearn/tensorlayer/....Seetutorials and documentationsto know more about these features.Examples:We refuse toy examples.
Instead of showing tiny CNNs trained on MNIST/Cifar10,
we provide training scripts that reproduce well-known papers.We refuse low-quality implementations.
Unlike most open source repos which onlyimplementpapers,Tensorpack examplesfaithfullyreproducepapers,
demonstrating itsflexibilityfor actual research.Vision:Train ResNetandother modelson ImageNetTrain Mask/Faster R-CNN on COCO object detectionUnsupervised learning with Momentum Contrast(MoCo)Generative Adversarial Network(GAN) variants, including DCGAN, InfoGAN, Conditional GAN, WGAN, BEGAN, DiscoGAN, Image to Image, CycleGANDoReFa-Net: train binary / low-bitwidth CNN on ImageNetFully-convolutional Network for Holistically-Nested Edge Detection(HED)Spatial Transformer Networks on MNIST additionVisualize CNN saliency mapsSimilarity learning on MNISTReinforcement Learning:Deep Q-Network(DQN) variants on Atari games, including DQN, DoubleDQN, DuelingDQN.Asynchronous Advantage Actor-Critic(A3C) with demos on OpenAI GymSpeech / NLP:LSTM-CTC for speech recognitionchar-rnn for funLSTM language model on PennTreebankInstall:Dependencies:Python 3.3+.Python bindings for OpenCV. (Optional, but required by a lot of features)TensorFlow ≥ 1.5, < 2TF is not not required if you only want to usetensorpack.dataflowalone as a data processing libraryTF2 is supported if used in graph mode (and usetf.compat.v1when needed)pip install --upgrade git+https://github.com/tensorpack/tensorpack.git
# or add `--user` to install to user's local directoriesPlease note that tensorpack is not yet stable.
If you use tensorpack in your code, remember to mark the exact version of tensorpack you use as your dependencies.Citing Tensorpack:If you use Tensorpack in your research or wish to refer to the examples, please cite with:@misc{wu2016tensorpack,
  title={Tensorpack},
  author={Wu, Yuxin and others},
  howpublished={\url{https://github.com/tensorpack/}},
  year={2016}
}
Package: tensorpowerflow
TensorPowerFlowWhat is TensorPowerFlow?An ultra-fast power flow based on Laurent series expansion. The power flow is intended for applications where massive
amounts of power flow computations are required. e.g., electrical load time series, metaheuristics, electrical grid
environments for reinforcement learning.How to installThe package can be installed via pip using:pipinstalltensorpowerflowExample:Run the load base case as:fromtensorpowerflowimportGridTensorimportnumpyasnpfromtimeimportperf_counter#%% Solve base case (34 node bus)network=GridTensor()solution=network.run_pf()print(solution["v"])#%% Solve 10_000 power flows on the 34 node bus case.network_size=network.nb-1# Size of network without slack bus.active_ns=np.random.normal(50,scale=1,size=(10_000,network_size))# Power in kWreactive_ns=active_ns*0.1# kVArsolution_tensor=network.run_pf(active_power=active_ns,reactive_power=reactive_ns)print(solution_tensor["v"])#%% Generate random radial network of 100 nodes and a maximum of 1 to 3 branches per node.network_rnd=GridTensor.generate_from_graph(nodes=100,child=3,plot_graph=True)solution_rnd=network_rnd.run_pf()print(solution_rnd["v"])#%% Solve a tensor power flow. For 10 scenarios, 8_760 time steps (one year - 1 hr res), for the 33 PQ nodes.# Meaning that the dimensions of the tensor is (10, 8_760, 33)network=GridTensor(numba=True)# Loads the basic 34 bus node network.active_ns=np.random.normal(50,# Power in kWscale=10,size=(10,8_760,33)).round(3)# Assume 1 slack variablereactive_ns=(active_ns*.1).round(3)# Constant PF of 0.1start_tensor_dense=perf_counter()solution=network.run_pf(active_power=active_ns,reactive_power=reactive_ns,algorithm="tensor")t_tensor_dense=perf_counter()-start_tensor_denseassertsolution["convergence"],"Algorithm did not converge."assertsolution["v"].shape==active_ns.shapeprint(f"Time tensor dense:{t_tensor_dense:.3f}sec.")More examples can be found in theexamples folder(under development).
Also, you can try the package via jupyter lab clicking in the binder icon:Reading and citations:The mathematical formulation of the power flow can be found at:“A Fixed-Point Current Injection Power Flow for Electric Distribution Systems using Laurent Series.”J.S. Giraldo,
O.D. Montoya, P.P. Vergara, F. Milano. Power Systems Computational Conference (PSCC) 2022.linkHow to contact usAny questions, suggestions or collaborations contact Juan S. Giraldo at <jnse@ieee.org>
Package: tensorpy
TensorPyEasy Image Classification with TensorFlow(Watch the 2-minute tutorial on YouTube)Requirements:A Mac or Linux machinePython 3.5, 3.6, or 3.7You can use TensorPy to classify images by simply passing a URL on the command line, or by using TensorPy in your Python programs.TensorFlowdoes all the real work. TensorPy also simplifies TensorFlow installation by automating several setup steps into a single script (Seeinstall.shfor details).(Readhow_tensorpy_worksfor a detailed explanation of how TensorPy works.)Setup Steps for Mac & Ubuntu/Linux(Windows & Docker users: See theDocker ReadMefor running on a Docker machine. Windows requires Docker to run TensorFlow.)Step 1:Create and activate a virtual environment named "tensorpy"If you're not sure how to create a virtual environment,follow these instructionsto learn how.Step 2:Clone the TensorPy repo from GitHubgitclonehttps://github.com/TensorPy/TensorPy.gitcdTensorPyStep 3:Install TensorPy, TensorFlow, and ImageNet/InceptionUseinstall.shto install everything you need../install.shStep 4:Run the examples(NOTE: Run times may vary depending on your Internet connection and computer's CPU speed.)Classify a single image from a URL:classify"http://cdn2.hubspot.net/hubfs/100006/happy_animal.jpg"Classify all images on a web page:classify"https://github.com/TensorPy/TensorPy/tree/master/examples/images"Classify a single image URL from a Python script: (Seetest_python_classify.pyfor details.)pythonexamples/test_python_classify.pyClassify an image from a local file path:classifyexamples/images/cat_animal.jpgClassify all images from a local folder:classifyexamples/images/Examples in Python programs:Classify an image from a local file path using a Python script: (Seetest_python_file_classify.pyfor details.)cdexamples
pythontest_python_file_classify.pyClassify all images in a local folder using a Python script (Output = LIST): (Seetest_python_folder_classify.pyfor details.)cdexamples
pythontest_python_folder_classify.pyClassify all images in a local folder using a Python script (Output = DICTIONARY): (Seetest_python_folder_classify_dict.pyfor details.)cdexamples
pythontest_python_folder_classify_dict.pyFuture Work:Eventually, the headline will change from "Image Classification with TensorFlow made easy!" to "Machine Learning with TensorFlow made easy!" once I expand on TensorPy to make other features of TensorFlow easier too. Stay tuned for updates!
Package: tensorrt
A high performance deep learning inference libraryTo install, please execute the following:pip install tensorrt --extra-index-url https://pypi.nvidia.comOr add the index URL to the (space-separated) PIP_EXTRA_INDEX_URL environment variable:export PIP_EXTRA_INDEX_URL='https://pypi.nvidia.com'
pip install tensorrtWhen the extra index url does not containhttps://pypi.nvidia.com, a nestedpip installwill run with the proper extra index url hard-coded.
Package: tensorrt-dispatch
A high performance deep learning inference libraryTo install, please execute the following:pip install tensorrt --extra-index-url https://pypi.nvidia.comOr add the index URL to the (space-separated) PIP_EXTRA_INDEX_URL environment variable:export PIP_EXTRA_INDEX_URL='https://pypi.nvidia.com'
pip install tensorrtWhen the extra index url does not containhttps://pypi.nvidia.com, a nestedpip installwill run with the proper extra index url hard-coded.
Package: tensorrt-lean
A high performance deep learning inference libraryTo install, please execute the following:pip install tensorrt --extra-index-url https://pypi.nvidia.comOr add the index URL to the (space-separated) PIP_EXTRA_INDEX_URL environment variable:export PIP_EXTRA_INDEX_URL='https://pypi.nvidia.com'
pip install tensorrtWhen the extra index url does not containhttps://pypi.nvidia.com, a nestedpip installwill run with the proper extra index url hard-coded.
Package: tensorscout
tensorscoutA Python library for tensor operations powered by parallel processing.InstallationpipinstalltensorscoutIt is recommended you run voxelmap using avirtualenvvirtual environment. To do so, follow the below simple protocol to create the virtual environment, run it, and install the package there:virtualenvvenvsourcevenv/bin/activatepipinstalltensorscoutTo exit the virtual environment, simply typedeactivate. To access it at any other time again, enter with the abovesource venv...command.
Package: tensorshare
TensorShare🤝 Trade any tensors over the networkTensorShare is a powerful tool enabling ⚡ lightning-fast tensor sharing across networks.This project leverages the best open-source tools to provide a simple and easy-to-use interface for sharing tensors:safetensorsfor secure tensor serialization and deserialization.pydanticfor data validation and settings management.fastapifor building APIs (and because it's too good to avoid it).This project is heavily in development and is not ready for production use.Feel free to contribute to the project by opening issues and pull requests.UsageExample of tensors serialization with torch:importtorchfromtensorshareimportTensorSharetensors={"embeddings":torch.zeros((2,2)),"labels":torch.zeros((2,2)),}ts=TensorShare.from_dict(tensors,backend="torch")print(ts)# tensors=b'gAAAAAAAAAB7ImVtYmVkZGluZ3MiOnsiZHR5cGUiO...' size=168You can now freely send the tensors over the network via any means (e.g. HTTP, gRPC, ...).On the other side, when you receive the tensors, you can deserialize them in any supported backend:fromtensorshareimportBackendnp_tensors=ts.to_tensors(backend=Backend.NUMPY)print(np_tensors)# {# 	'embeddings': array([[0., 0.], [0., 0.]], dtype=float32),# 	'labels': array([[0., 0.], [0., 0.]], dtype=float32)# }For more examples and details, please refer to theUsage section.RoadmapPydantic schema for sharing tensors ~>TensorShareSerialization and deserialization ~>tensorshare.serializationTensorProcessor for processing tensors ~>TensorProcessorServer for sharing tensors ~>TensorShareServerClient for sharing tensors ~>TensorShareClientNew incredible features! (Check theissues)
Package: tensorshow
TensorshowTensorshow is a python module for inspectingTFRecords.Tensorshow can convert a TFRecord to a pandas dataframe.importtensorshow# The column labels of `df` are the features of the tf.train.example protobufs.df=tensorshow.dataframe_from('path/to/tfrecord')Tensorshow can be used as a command line utility. It will convert a tfrecord to an html file on the command line.pythontensorshow--tfrecord=/Users/joel/train.tfrecord--html_file=Users/joel/out.htmlImages stored as byte strings will be automatically detected and displayed as images rather than text. Theout.htmlfile looks like this when you open it with a browser.Tensorshow can be used in a jupyter notebook to preview a TFRecord. Theheadfunction will show the first 5tf.train.examples by default and therandomfunction will show five randomtf.train.examples from the tfrecord.
Package: tensorslow
TensorslowHave you ever wanted to to use the power of neural network modeling with absolutelyNONEof the rush given by competing neural network frameworks? Well if you answered yes to the previous question then Tensorslow is the machine learning framework to use. Using state of the artPython3lists rather than any complicated and vectorized backends from languages of yester-year likeC++, we seek to use the Zen of Python to make your machine learning models learn at a pace more compatible with that of your three remaining brain-cells (or at least mine). So, get ready to sit back, take a sip of that green-tea, and enjoy the magic of machine learning with absolutelyNONEof the stress provided by a machine that works way too quickly for its own good.InstallTo download the code from the repositorygitclonegit@github.com:oortega20/tensorslow.gitTo install the current release of TensorslowpipinstalltensorslowTry some simple Tensorslow ProgramsSome fun matrix manipulations with tensorslow's linear-algebra package>>>fromtensorslow.linalgimportTensor>>>x=Tensor(list(range(6)),(2,3))>>>xTensor([[0.0001.0002.000][3.0004.0005.000]])>>>x@x.TTensor([[5.00014.000][14.00050.000]])>>>x.T@xTensor([[9.00012.00015.000][12.00017.00022.000][15.00022.00029.000]])>>>x-3Tensor([[-3.000-2.000-1.000][0.0001.0002.000]])>>>0*xTensor([[0.0000.0000.000][0.0000.0000.000]])A simple demonstration of forward propagation with Tensorslow's available layers and activations>>>fromtensorslow.linalgimportTensor>>>fromtensorslow.activationsimportRelu>>>fromtensorslow.layersimportDense>>>>>>x=Tensor(list(range(6)),(2,3))>>>xTensor([[0.0001.0002.000][3.0004.0005.000]])>>>act=Sigmoid()>>>f=Dense('f',in_dim=3,out_dim=3)>>>f.weights['w']Tensor([[0.0570.0510.021][0.047-0.0310.003][0.015-0.0520.058]])>>>f.weights['b']Tensor([0.3330.3330.333])>>>out=act(f(x))>>>outTensor([[0.6010.5490.611][0.6820.5250.667]])>>>Inference using Tensorslow MNIST Classifierfromtensorslow.datasetsimportMNISTfromtensorslow.modelsimportts_mnist_classifiermodel=ts_mnist_classifier(from_ts=True)data=MNIST(load_train=False,load_test=True,batch_size=128)x_test,y_test=data.get_test_data()forx,yinzip(x_test,y_test):probs=model.forward(x)# if we only want the class probabilitiesloss,grad=model.forward(x,y)# if we want to compute losses and gradientsExample of simple model training using tensorslowfromtensorslow.datasetsimportMNISTfromtensorslow.modelsimportts_mnist_classifierfromtensorslow.optimizersimportSGDdata=MNIST(batch_size=128)x_train,y_train=data.get_train_data()epochs=10model=ts_mnist_classifier(from_ts=False)opt=SGD(model,learning_rate=5e-4)train_loss,test_loss=[],[]forepochinrange(epochs):fordatainzip(x_train,y_train):x,y=databatch_loss,grad=model(x,y)model.backward(grad)opt.update()Details of the Tensorslow MNIST Classifier can be found in a link to ourtensorslow-experimentationrepository. Improving the accuracy of the current MNIST classifier is something being researched!
Package: tensorsocket
tensorsocketShare PyTorch tensors over ZMQ socketsInstallationInstall as module. Should be installed in a project such asRAD/data-sharingFrom sourceFrom the root of the tensorsocket directory, install it with pip:$pipinstall.From PyPi$pipinstalltensorsocketUsagetensorsocket works by exposing batches of data, represented as PyTorch tensors, on sockets that training processes can access. This allows for minimizing redundancy of training data during collocated tasks such as hyper-parameter tuning. Training with tensorsocket builds on the concept of a producer-consumer relationship, where the following example code shows how the producer wraps around an arbitrary data loader object. As with nested epoch-batch loops, one can iterate over the producer in the same manner as iterating over a data loader.The use of tensorsocket relies on aTensorProducerandTensorConsumer. TheTensorProducercan be used as is, however theTensorConsumerneeds to be embedded in a class that exposes the same functionality as a PyTorch data loader, as shown in theSharedLoaderexample class, below:# shared_data_loader.pyfromtensorsocketimportTensorConsumerclassSharedLoader(object):def__init__(self,port="5556",ack_port="5557"):self.consumer=TensorConsumer(port,ack_port)self.counter=0def__iter__(self):self.counter=0returnselfdef__next__(self):ifself.counter<self.__len__():self.counter+=1returnnext(self.consumer)else:raiseStopIterationdef__len__(self):returnlen(self.consumer)Using theTensorProducerrequires next to no additional implementation, apart from the original data loader.# producer.pydata_loader=DataLoader(dataset)producer=TensorProducer(data_loader,port="5556",ack_port="5557")for_inrange(epochs):for_inproducer:passproducer.join()Given theSharedLoaderwith theTensorConsumerclass, it is straightforward to modify a training script to fetch batches of data from the shared loader, rather than using the process-specific data loader, which is created for each collocated training job.# consumer.py (or train.py)from...importSharedLoader...ifnotuse_shared_loader:data_loader=create_loader(...)else:data_loader=SharedLoader()...forbatch_idx,(input,target)inenumerate(data_loader):output=model(input)...Features
Package: tensorspace
TensorSpace is a reference implementation of an artificial intelligence lab.Why?I was tired of setting up ad hoc environments for various research experiments. I wanted a solution that can turn any “computer” into a research environment that I can use right away.FeaturesDownloads and normalizes datasets. Currently only COCO, but more coming. Saves everything into a nice organized directory structure.Single annotation schema for all datasets. You don’t need to research with just one dataset at a time anymore. You do queries like “give me all images with bounding boxes from all datasets”.Automatically preprocess vectors or other intermidate datasets.Coming soon: Demos and models that use the data.Coming soon: GraphQL API for running modelsComing soon: Multiple deployment targets. This will include Kubernetes.Installationpip install tensorspaceUsagetensorspace up
Package: tensorstate
TensorState (v0.4.0) - Neural Network Efficiency ToolsTensorState is a toolbox to capture neural network information to better
understand how information flows through the network. The core of the toolbox is
the ability to capture and analyze neural layer state space, which logs unique
firing states of neural network layers. This repository implements and extends
the work by Schaub and Hotaling in their paper,Assessing Intelligence in Artificial Neural Networks.InstallationPrecompiled wheels exist for Windows, Linux, and MacOS for Python 3.6-3.8. No
special installation instructions are required in most cases:pip install pip --upgradepip install TensorStateIf the wheels don't download or you run into an error, try installing the
pre-requisites for compiling before installing withpip.pip install pip --upgradepip install numpy==1.19.2 Cython==3.0a1pip install TensorStateDocumentationhttps://tensorstate.readthedocs.io/en/latest/
Package: tensorstore
TensorStoreTensorStore is an open-source C++ and Python software library designed for
storage and manipulation of large multi-dimensional arrays that:Provides advanced, fully composable indexing operations and virtual views.Provides a uniform API for reading and writing multiple array formats, includingzarrandN5.Natively supports multiple storage systems, such as local and network
filesystems,Google Cloud Storage,
Amazon S3-compatible object stores, HTTP servers, and in-memory storage.Offers an asynchronous API to enable high-throughput access even to
high-latency remote storage.Supports read caching and transactions, with strong atomicity,
isolation, consistency, and durability (ACID) guarantees.Supports safe, efficient access from multiple processes and machines via
optimistic concurrency.Documentation and installation instructions are athttps://google.github.io/tensorstore.Getting StartedTo get started using the TensorStore Python API, you can install the tensorstore
PyPI package using:pip install tensorstoreRefer to thetutorialsandAPI documentation,
or the announcement on theGoogle Research Blogfor more details.This is not an officially supported Google product.LicenseLicensed under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0.Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: tensortime
TensorTime🕙TensorTime 让你的实验可以回溯！1 缘起在训练模型时，可能有很多参数需要调试，有时我们会把结果和参数记录下来。
由于代码和数据等各种细节都可能会改变，所以在回溯代码时，就可能会发生无法复现先前结果的状况。版本控制工具是一个解决的办法，但是 git 管理起大文件不是特别方便。
所以我们需要一个工具既可以保存代码这种小文件，也要能保存数据和模型这种大文件。TensorTime就是这样一个工具，它在每次运行实验时，完整的复制一份代码和数据到特定的文件夹里。
任何时候你都可以重新回溯，复现出先前的实验！当然这样做也有一个很大的缺点，就是比较占用空间，因此 TensorTime 可以选择性的忽略一些文件或文件夹。
比如有些实验的数据集就是不会变动的，可以选择直接忽略掉。总的来说，TensorTime 是一种「空间换时间」的做法，希望你用得愉快～2 安装# 使用 pip 安装pipinstalltensortime# 从代码库安装gitclonehttps://github.com/dovolopor-research/tensortime.gitcdtensortime&&pythonsetup.pyinstall3 快速上手3.1 引入# 通常在 train.py 文件下fromtensortimeimportTimeMachine# ....if__name__=="__main__":tm=TimeMachine()tm.backup()# ...3.2 执行# 正常执行文件，在开始运行时会要求输入实验备注pythontrain.py

>>tensortime:输入实验备注nlp
>>tensortime:创建备份文件夹tensortime
>>tensortime:创建实验文件夹Fri_Oct_23_09:36:04_2020-nlp
>>tensortime:忽略model
>>tensortime:备份train.py
>>tensortime:忽略tensortime
>>tensortime:备份.git
>>tensortime:忽略test.sh
>>tensortime:备份.ttignore
>>tensortime:成功备份到tensortime/Fri_Oct_23_09:36:04_2020-nlp在tensortime/Fri_Oct_23_09:36:04_2020-nlp下即可找到本次实验的所有文件。3.3 忽略从上文的日志中可以看到，有些文件是不希望备份进去的，比如temp.py、.git。我们可以直接在 backup 里设置参数，忽略掉指定文件。tm.backup(ignore=["temp.py",".git"])另外还可以使用类似于.gitignore的方式，在项目的主目录下创建一个.ttignore。# .ttignore
# 忽略文件（以#开头的是注释，不会被解析）
temp.py

# 忽略文件夹
.git/注：暂时不支持一级以上的忽略，比如model/cnlp.py。3.4 附加前面的代码展示了如何忽略不需要的文件，这个操作一般是在所有代码运行前。对于深度学习应用来说，我们有一项非常重要的数据——权重，它一般是代码跑完后才会生成的。因此我们需要在保存权重后，再执行一遍备份操作，这个时候仅仅需要备份权重文件。tm.backup(add=["save"])4 进阶4.1 自定义 TimeMachine 参数backup_dir: 指定备份文件夹，默认为 tensortimeexp_dir: 指定实验文件夹，默认为 时间 + 备注exp_suffix: 指定实验文件夹的备注（在 exp_dir 为 None 时生效）5 许可