Saravanan666/pypi-org huggingface dataset:
Package: tf-notify
tf-notifyWant to get notified on the progress of your TensorFlow model training?This package provides atf.kerascallback to send notifications to a messaging app of your choice.InstallThe recommended installation is viapip:pipinstalltf-notifySupported AppsThe following apps are currently supported. But, do check the project frequently, as many more will soon be supported!SlackTelegramEmail (SMTP)Usageimporttensorflowastffromtf_notifyimportSlackCallback# define the tf.keras model to add callbacks tomodel=tf.keras.Sequential(name='neural-network')model.add(tf.keras.layers.Dense(1,input_dim=784))model.compile(optimizer=tf.keras.optimizers.RMSprop(learning_rate=0.1),loss="mean_squared_error",metrics=["mean_absolute_error"],)model.fit(x_train,y_train,batch_size=128,epochs=2,verbose=0,validation_split=0.5,callbacks=[SlackCallback(webhook_url='https://url.to/webhook')],# send a Slack notification when training ends!)You should see something like this on your Slack:How to contributeIf you wish to contribute,thisis a great place to start!LicenseDistributed under theApache-2.0 license.
Package: tfnumpy
Numerical Python using TensorFlowFunctionalities:Embedding: Sammon algorithm;Linear regression (with Ridge, Lasso, and ElasticNet);Tensor products: Khatri-Rao product and Kronecker product;Tensor decomposition using ALS.News01/16/2020:tfnumpy0.1.1 released.12/24/2019:tfnumpy0.1.0 released.09/02/2019:tfnumpy0.0.6 released.07/07/2019:tfnumpy0.0.5 released.05/18/2019:tfnumpy0.0.4 released.04/25/2019:tfnumpy0.0.3 released.01/19/2019:tfnumpy0.0.2 released.11/05/2018:tfnumpy0.0.1 released.
Package: tf-object-detection
tf_object_detectionThis is a thin wrapper aroundTensorflow Object Detection APIfor easy installation and use. The originalinstallation procedurecontains multiple manual steps that make dependency management difficult. This repository creates a pip package that automate the installation so that you can install the API with a single pip install.Installationpip install tf-object-detectionUsageAll the scripts from tensorflow object detection APIs work out-of-box.
You can find an example usages from the API'smodel_main.py.import object_detectionWhat's in heresetup.py: The python packaging script.PROTOCEnvironment variable should be set so thatsetup.pycan compile as
part of thesetup.pyexecution.# Download and setup all required dependencies required for tensorflow object# detection libarary to work correctly.$pythonsetup.pyinstalltf_object_detection: A git submodule pointing to the version of tensorflow object detection this thin wrapper is for.
Package: tfparse
WhatA python extension for parsing and evaluating terraform using defsec.While terraform uses HCL as its configuration format, it requires numerous
forms of variable interpolation, function and expression evaluation, which
is beyond the typical usage of an hcl parser. To achieve compatiblity
with the myriad real world usages of terraform, this library uses the
canonical implementation from terraform, along with the interpolation and evaluation
from defsec to offer a high level interface to parsing terraform modules.Installationpip install tfparseWe currently distribute binaries for MacOS (x86_64, arm64) and Linux (x86_64, aarch64) and Windows.Note on Windows we currently don't free memory allocated on parse results.UsageA terraform module root, withterraform inithaving been performed to resolve module references.from tfparse import load_from_path
parsed = load_from_path('path_to_terraform_root')
print(parsed.keys())Developingrequires Go >= 1.18requires Python >= 3.10Installing from sourceInstalling will build the module and install the local copy of tfparse in to the current Python environment.>pipinstall-e.
>python
>>>fromtfparseimportload_from_path
>>>parsed=load_from_path('<path_to_terraform>')>>>print(parsed.keys())Building from sourceBuilding will produce a wheel and a source artifact for distribution or upload to package repositories.pythonsetup.pybdist_wheel
ls-ldist/Running the testsThis project uses pytestpytestTesting CI Builds for cross compilingYou can test our cross compiling CI/CD builds by running the following:CIBW_BUILD=cp310* cibuildwheel --platform macos --archs x86_64This will try to build an intel wheel on python3.10Creditsaquasecurity/defsec - golang module for parsing and evaluating terraform hclScalr/pygohcl - python bindings for terraform hcl via golang extension
Package: tfp-causalimpact
TFP CausalImpactThis Python package implements an approach to estimating the causal effect of a
designed intervention on a time series.  For example, how many additional daily
clicks were generated by an advertising campaign? Answering a question like this
can be difficult when a randomized experiment is not available. The package aims
to address this difficulty using a structural Bayesian time-series model to
estimate how the response metric might have evolved after the intervention if
the intervention had not occurred [1].As with all approaches to causal inference on non-experimental data, valid
conclusions require strong assumptions. The CausalImpact package, in particular,
assumes that the outcome time series can be explained in terms of a set of
control time series that were themselves not affected by the intervention.
Furthermore, the relation between treated series and control series is assumed
to be stable during the post-intervention period. Understanding and checking
these assumptions for any given application is critical for obtaining valid
conclusions.TFP CausalImpact is a Python +TensorFlow Probabilityimplementation of theCausalImpactR package developed at
Google by Kay Brodersen and Alain Hauser.  TFP CausalImpact is based on both
the original R package and on a Python versionhttps://github.com/dafiti/causalimpactdeveloped at Dafiti by Willian Fuks.
TFP CausalImpact was developed at Google by Colin Carroll, David Moore,
Jacob Burnim, Kyle Loveless, and Susanna Makela.This is not an officially supported Google product.[1]Inferring causal impact using Bayesian structural time-series models.Kay H. Brodersen, Fabian Gallusser, Jim Koehler, Nicolas Remy,
Steven L. Scott.  Annals of Applied Statistics, vol. 9 (2015), pp. 247-274.https://research.google/pubs/pub41854/Getting StartedTFP CausalImpact can be installed viapip:pip install tfp-causalimpactAnd imported as:import causalimpactSee also theQuick-Start Guide.DevelopmentClone TFP CausalImpact, install the development dependencies, and run the unit
tests with:git clone https://github.com/google/tfp-causalimpact.git tfp_causalimpact
cd tfp_causalimpact

pip install flit
flit install --only-deps

pytest -vv -n auto
Package: tf-pde
Neural PDE Solver Python Package : tf-pdeAutomatic Differentiation based Partial Differential Equation solver implemented on the Tensorflow 2.x API. Package distribution under the MIT License. Built for students to get initiated on Neural PDE Solvers as described in the paperPhysics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations.InstallationSince the pakcage was built as a proof-of-concept, support for it has been discontinued. However the package still works with the mentioned dependencies. We suggest running the package within a conda environment.condacreate-nNPDEtf-pdecondaactivateNPDEExample(s)To solve a particular PDE using a PINN, the package requires information on the three parameters: neural network hyperparameters, sampling parameters, information about the PDE and the case that we are solving for :#Neural Network HyperparametersNN_parameters={'Network_Type':'Regular','input_neurons':2,'output_neurons':1,'num_layers':4,'num_neurons':64}#Neural PDE HyperparametersNPDE_parameters={'Sampling_Method':'Initial','N_initial':300,#Number of Randomly sampled Data points from the IC vector'N_boundary':300,#Number of Boundary Points'N_domain':20000#Number of Domain points generated}#PDEPDE_parameters={'Inputs':'t, x','Outputs':'u','Equation':'D(u, t) + u*D(u, x) + 0.0025*D3(u, x)','lower_range':[0.0,-1.0],#Float'upper_range':[1.0,1.0],#Float'Boundary_Condition':"Periodic",'Boundary_Vals':None,'Initial_Condition':lambdax:np.cos(np.pi*x),'Initial_Vals':None}Partial derivative of y with respect to x is represented by D(y, x) and the second order derivative is given by D(D(y, x), x) or D2(y, x).These parameters are used to initialise the model and sample the training data:model=tfpde.main.setup(NN_parameters,NPDE_parameters,PDE_parameters)Once the model is initiated, we determine the training parameters and solve for the PDE:train_config={'Optimizer':'adam','learning_rate':0.001,'Iterations':50000}training_time=model.train(train_config,training_data)The PDE solution can be extracted by running a feedforward operation of the trained network and compared with traditional numerical methods:u_pred=model(X_star)In order to gain a more theoretical understanding of the methods involved, do go through this video :
Package: tf-persistent-data
"# tf-persistent-data"설명데이터를 암호화하여 저장 / 복구데이터 형태에 상관없이 저장가능하고 해당 타입으로 복구한다.암호화 키를 반드시 지정하여 사용 (persist = TfPersistentData(b'p@ssw0rd'))사용법1fromtfpersistentdata.tfpersistentdataimportTfPersistentDataif__name__=='__main__':persist=TfPersistentData(b'p@ssw0rd')data={'a':123,'b':'text1234'}filename='data1.tpd'persist.write(data,filename)rdata=persist.read(filename)print('filename:',filename,'| data:',rdata,'| type:',type(rdata))사용법2fromtfpersistentdata.tfpersistentdataimportTfPersistentDataif__name__=='__main__':persist=TfPersistentData(b'p@ssw0rd')data=3.14filename='data1.tpd'persist.write(data,filename)rdata=persist.read(filename)print('filename:',filename,'| data:',rdata,'| type:',type(rdata))사용법3fromtfpersistentdata.tfpersistentdataimportTfPersistentDataclassA:a=1b='text2'if__name__=='__main__':persist=TfPersistentData(b'p@ssw0rd')data=A()filename='data1.tpd'persist.write(data,filename)rdata=persist.read(filename)print('filename:',filename,'| data:',rdata,'| type:',type(rdata))
Package: tfprotocol-client
IntroductionThe especifications for theTransference Protocolis available in thisrepository.Installation :floppy_disk:The package is available atpypi, to be installed frompipwith the
next command:pipinstalltfprotocol_clientA Simple Example :memo:To use theTransference Protocolthrough this library, you must create an instance ofTfProtocolwith the specified parameters and have an online server to connect to.fromtfprotocol_client.misc.constantsimportRESPONSE_LOGGERfromtfprotocol_client.tfprotocolimportTfProtocolADDRESS='tfproto.expresscuba.com'PORT=10345clienthash='<clienthash>'publickey='<publickey>'proto=TfProtocol('0.0',publickey,clienthash,ADDRESS,PORT)proto.connect()proto.echo_command('Hello World',response_handler=RESPONSE_LOGGER)proto.disconnect()For Contributors :wrench:Development Environment Installation :computer:To set up the development environment, all you need as a prerequisite is to have Python 2.7
or 3.5+ andpoetryinstalled. If you need to install poetry
followthese stepsand come back.With this in mind, to install the necessary dependencies and create a python environment for
this project, proceed to run the following command in the root directory of the project.poetryinstallProject Structure :open_file_folder:This library is made up of 5 folders and the particular implementations of theTfProtocolSuperclass, the folders are structured as follows:connection: where all socket and low-level communication is located.modelswhere the complex objects used all over the package are defined.securitywhere is implemented the methods and classes to encrypt and decrypt the messages for communication and also the utils for do the hashing stuff where is needed.miscto hold all utils and not related to any other folder concept.extensionswhere are all the extensions for theTransfer Protocol Client.Here the visual schema for all the classes and his relations with others:Publishing :rocket:To publish the package you need to run the following command in the root directory of the package:poetrypublish
Package: tfprovider
tfprovider(-python)This is a library to allow you to write Terraform providers in Python.NOT USABLE YET for anyone but myself, trust me.Implemented/missing featuresIf you need any of these, please either open an issue (on GitLab or GitHub,
doesn't matter to me) or comment on an existing one and I'll see what I can do.
In contrast to larger projects, I prefer +1 comments over thumbs upsfor now(!) because they are easier for me to get notified of.Most of them aren't difficult or time-consuming for me to implement, there is
just no point doing it if nobody needs it.General:Not being completely horrible to use and full of bugsKinds of Terraform objects:ResourcesData sourcesTerraform data types:StringsSets of stringsUnrefined unknownsRefined unknownsAnything else, including more complex typesMiscellaneous features:Private stateUpgrading state from earlier versionsCurrently has an API for this that can't possibly work => needs overhaulUtilities:Automatic comparison forrequires_replaceDevelopmentSync/Async variantsThe sync variant of the API is automatically generated from the async one
usingunasync. With dev dependencies
installed, you can regenerate them by runningrun_unasync.pyas a Python
script (e.g. viapoetry run run_unasync.py).
Package: tfpy
Create Terraform resources using Python.Descriptiontfpyis a thin wrapper aroundterraformpy, aiming at providing a well defined
structure to organize yourterraformstacks and leverage the power of Python to
define them rather than usingHCL.The goal is to have a repository layout inspired fromAnsiblewhere the stacks are driven by the variables.For more information regarding how to create your stacks, please refer to the officialterraformpydocumentation.Installationtfpy requires Python 3.7+ to workpip install tfpyUsageThetfpycommand needs to be run at the root of your project.The output will be created in a new subfolder within your project, namedgenerated.
For instancegenerated/gke/production/main.tf.jsonProject layout.
├── generated
│   └── commerce
│       └── staging
│           └── main.tf.json
├── library
│   ├── backend.py
│   └── provider.py
├── stacks
│   └── commerce
│       ├── README.md
│       ├── gke.tf.py
│       └── terraform.tf.py
└── vars
    ├── all
    │   ├── cartigan.yml
    │   └── config.yml
    └── staging
        └── commerce
            ├── gke.yml
            └── project.ymlgenerated: folder where the stack are stored as JSON once generated.library: folder where you can place custom functions.stacks: the stacks created using TerraformPy.vars: the variables used to create the stacks.ExamplesBuild a project stack without an environment:tfpy generate organizationBuild a project stack for a specific environment:tfpy generate gke production
Package: tf-pydf
TF_pyDFTF_pyDF is a Python package that provides a module for calculatingTF-IDF(Term Frequency-Inverse Document Frequency). It allows you to create a document model and perform various operations such as adding and removing documents, searching for documents based on queries, and computing TF-IDF scores.Usage WarningThe document contents and search query have to be pre-tokenized into list[str] or in a Tokenizer Iterator.
You can use your own tokenizer or use one related to this package -LexiPy, it provides a simple way to tokenize a string of text into tokens.InstallationYou can install TF_pyDF using pip:pipinstalltf_pydfUsagefromtf_pydfimportModeldocuments={"fruits":["apple","banana","orange"],"vegetables":["tomato","cucumber","radish"],"pasta":["tagliatelle","rotini","rigatoni"],}# Create a new instance of the document modelmodel=Model()# Add documents to the modelfordoc_id,doc_contentindocuments.items():model.add_doc(doc_id,doc_content)# Or use convenience method "from_dict"model=Model.from_dict(documents)# Remove a document from the modeldoc_id="pasta"model.remove_doc(doc_id)# Check if a document is in the modelifdoc_idinmodel:...# Search the model for documents matching a queryresults=model.search_query(query)results>>>[('fruits',0.10034333188799373),('vegetables',0.0)]ContributingContributions to LexiPy are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on theGitHub repository.LicenseThis package is licensed under theMIT License.ReferencesGithub RepositoryPyPI packageLexiPy- tokenizerTF-IDF- wikipedia
Package: tfpyth
TfPyThPutting TensorFlow back in PyTorch, back in TensorFlow (differentiable TensorFlow PyTorch adapters).A light-weight differentiable adapter library to make TensorFlow and PyTorch interact.Installpip install tfpythExampleimporttensorflowastfimporttorchasthimportnumpyasnpimporttfpythsession=tf.Session()defget_torch_function():a=tf.placeholder(tf.float32,name='a')b=tf.placeholder(tf.float32,name='b')c=3*a+4*b*bf=tfpyth.torch_from_tensorflow(session,[a,b],c).applyreturnff=get_torch_function()a=th.tensor(1,dtype=th.float32,requires_grad=True)b=th.tensor(3,dtype=th.float32,requires_grad=True)x=f(a,b)assertx==39.x.backward()assertnp.allclose((a.grad,b.grad),(3.,24.))What it's gottorch_from_tensorflowCreates a PyTorch function that is differentiable by evaluating a TensorFlow output tensor given input placeholders.eager_tensorflow_from_torchCreates an eager Tensorflow function from a PyTorch function.tensorflow_from_torchCreates a TensorFlow op/tensor from a PyTorch function.Future worksupport JAXsupport higher-order derivatives
Package: tfquaternion
# Tensorflow Quaternion
An implementation of quaternions for tensorflow. Fully differentiable.The tfquaternion module provides an implementation of quaternions as a
tensorflow graph.tfquaternionoffers module functions for the basic quaternion arithmetic
operations as well as aQuaternionclass which supports the relevant magic
methods. This is similar to the tensorflow API, e.g.tfq.quaternion_multiplyvs.tf.multiplyandtfq.Quaternionvstf.Tensor. Note that all functions
starting withtf.quaternion_…assume that it’s arguments aretf.Tensor`s
(or `tfq.Quaternion`s) that can be casted to `tfq.Quaternion, i.e. the shape
must be (…, 4).This implementation is mostly compatible with a small subset of
[moble’s quaternion implementation](https://github.com/moble/quaternion/)
(ensured by using slightly adapted versions of his tests). HOwever, there are
at least two major differences: First, tfquaternion is type specific as is
tensorflow, i.e. two quaternions of different dtypes can not be multiplied.
Second, tfquaternion supports operations on arrays of quaternions.### Installation
You can either use pypi` pip install tfquaternion `or install the latest version from git as development package:` git clonehttps://github.com/PhilJd/tf-quaternion.gitcdtf-quaternionpip install-e. `The -e option only links the working copy to the python site-packages,
so to upgrade, you only need to rungit pull.### UsageBefore getting started, an important note on the division:
This library resembles the division behaviour of
[moble’s quaternion](https://github.com/moble/quaternion/). While in
general the division operator is not defined (from the notation q1/q2 one can
not conclude if q1/q2 = q1 * q2^-1 or q1/q2 = q2^-1 * q1), we follow moble’s
implementation, i.e.tfq.quaternion_divideandQuaternion.__truediv__computeq1/q2 = q1 * 1/q2.#### Example
A simple rotation by a quaternion can look like this:` >>> import tfquaternion as tfq >>> import tensorflow as tf >>> s = tf.Session() >>> points =tf.constant([[1,0, 0], [0, 1, 0], [0, 0,1]],dtype=tf.float32) >>> quat =tfq.Quaternion([0,1, 0, 0])  rotate by 180 degrees around x axis >>>s.run(tf.matmul(quat.as_rotation_matrix(),points))array([[1.,  0.,0.],[ 0.,-1.,0.],[ 0.,  0.,-1.]],dtype=float32) `#### API##### class Quaternion
The usage of the*-Operator depends on the multiplier. If the multiplier is a
Quaternion, quaternion multiplication is performed while multiplication with
a tf.Tensor uses tf.multiply. The behaviour of division is similar, except if
the dividend is a scalar, then the inverse of the quaternion is computed.`tfq.Quaternion([1,0, 0, 0]) *tfq.Quaternion([0,4, 0, 0]) >>>tfq.Quaternion([0,4, 0, 0)tfq.Quaternion([1,0, 0, 0]) *tf.Tensor([0,4, 0, 0]) >>>tf.Quaternion([0,0, 0, 0) `
Package: tf-rbdl
tf_rbdltf_rbdl is a python library that contains some essential rigid body dynamics
algorithms such as forward dynamics and inverse dynamics using Tensorflow. It
uses Lie Group representation and provides kinematic and dynamics quatities of
rigid body systems.ExamplesGeneral UsagesSeeexamples/general_usage.pyfor details.InstallationYou can installtf_rbdlfrom PyPI:$pipinstalltf_rbdlor, you can also install from source:$gitclonehttps://github.com/junhyeokahn/tf_rbdl
$cdtf_rbdl
$pipinstall-e.Citation@misc{junhyeok_ahn_2020_3828061,
  author       = {Junhyeok Ahn},
  title        = {junhyeokahn/tf\_rbdl: tf\_rbdl-v1.2.0},
  month        = may,
  year         = 2020,
  publisher    = {Zenodo},
  version      = {v1.2.0},
  doi          = {10.5281/zenodo.3828061},
  url          = {https://doi.org/10.5281/zenodo.3828061}
}TodoWrite examplesParse urdfAcknowledgementThis library is based on the bookModern
Roboticsand thecode.
Package: tfrddlsim
tf-rddlsimRDDL2TensorFlow compiler and trajectory simulator in Python3.Quickstart$ pip3 install tfrddlsimUsagetf-rddlsim can be used as a standalone script or programmatically.Script mode$ tfrddlsim --help

usage: tfrddlsim [-h] [--policy {default,random}] [--viz {generic,navigation}]
                 [-hr HORIZON] [-b BATCH_SIZE] [-v]
                 rddl

RDDL2TensorFlow compiler and simulator

positional arguments:
  rddl                  path to RDDL file or rddlgym problem id

optional arguments:
  -h, --help            show this help message and exit
  --policy {default,random}
                        type of policy (default=random)
  --viz {generic,navigation}
                        type of visualizer (default=generic)
  -hr HORIZON, --horizon HORIZON
                        number of timesteps of each trajectory (default=40)
  -b BATCH_SIZE, --batch_size BATCH_SIZE
                        number of trajectories in a batch (default=75)
  -v, --verbose         verbosity mode$ tfrddlsim Navigation-v1 --policy random --viz navigation -hr 50 -b 32 -v$ tfrddlsim Reservoir-8 --policy default --viz generic -hr 20 -b 128 -vProgrammatic modeimportrddlgymfromrddl2tf.compilersimportDefaultCompilerasCompilerfromtfrddlsim.policyimportRandomPolicyfromtfrddlsim.simulation.policy_simulatorimportPolicySimulatorfromtfrddlsim.vizimportGenericVisualizer# parametershorizon=40batch_size=32# parse and compile RDDLrddl=rddlgym.make('Reservoir-8',mode=rddlgym.AST)compiler=Compiler(rddl,batch_size)compiler.init()# run simulationspolicy=RandomPolicy(compiler)simulator=PolicySimulator(compiler,policy)trajectories=simulator.run(horizon)# visualize trajectoriesviz=GenericVisualizer(compiler,verbose=True)viz.render(trajectories)SimulatorThetfrddlsim.Simulatorimplements a stochastic Recurrent Neural Net (RNN) in order to sample state-action trajectories. Each RNN cell encapsulates atfrddlsim.Policymodule generating actions for current states and comprehends the transition (specified by the CPFs) and reward functions. Sampling is done through dynamic unrolling of the RNN model with the embeddedtfrddlsim.Policy.Note that thetfrddlsimpackage only provides atfrddlsim.RandomPolicyand atfrddlsim.DefaultPolicy(constant policy with all action fluents with default values).DocumentationPlease refer tohttps://tf-rddlsim.readthedocs.io/for the code documentation.SupportIf you are having issues withtf-rddlsim, please let me know at:thiago.pbueno@gmail.com.LicenseCopyright (c) 2018-2019 Thiago Pereira Bueno All Rights Reserved.tf-rddlsim is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.tf-rddlsim is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.You should have received a copy of the GNU Lesser General Public License
along with tf-rddlsim. If not, seehttp://www.gnu.org/licenses/.