Saravanan666/pypi-org huggingface dataset:
Package: gradient-api
Usage:>>> from gradient_api import gradient>>> r1 = gradient.generate(expr_or_poly1d='x**2+1')
>>> r2 = gradient.generate(expr_or_poly1d=[1,0,1])>>> print(r1 == r2)
True>>> print(r1)
{'X': -0.00011417981541647683, 'Y': 1.0000000130370303, 'Gradient': -0.00022835963083295366, 'Numloop': 51}>>> trainData = pandas.DataFrame(numpy.array([[1,3,5,7],[2,4,6,8]]))
>>> r3 = gradient.generate_2d(trainData)
>>> print(r3)
{'Gradient': array([-1020.54, -1589.21, -3630.29, -5671.37]),
 'Linear_Coef': array([-16.94, -38.6 , -60.26]),
 'Linear_Intercept': -10.83,
 'Numloop': 2,
 'Y': 263786.0329,
 'theta': array([-10.83, -16.94, -38.6 , -60.26])}Tips:>>> generate_1d(expr_or_poly1d,init_x=-0.5,step=0.01,num_iters=1e4,showPlot=False,xlimArr=None,ylimArr=None)>>> generate_2d(dataFrame,step=0.1,num_iters=1e4)
Package: gradientchat
gradientchatgradientchatis the official Python bot client module for GradientChatthat is OOP-based.ExampleTestBotimportgradientchatmyBot=gradientchat.Bot("TestBot [t!]")# No prefix arg makes prefix first letter of name + "!"@myBot.cmddefping():"""Returns \"Pong!\"""" # Docstring is used as description for the commandreturn"Pong!"myBot.connect()Docsgradientchat.Bot(name, pref)Ifnameis notstr, raisesTypeError, however ifprefis not string andnameisstr, prefix will be lowercase of first character ofnameand a exclamation mark.gradientchat.Bot.connect(servUrl)Connects to server; ifservUrlisstr, connects to URL specified onservUrl; raisesExceptionif already connected.@gradientchat.Bot.cmdDecorator for adding a command; if called with a command name, command name will be set to the specified command name.NOTE: Thehelpcommand is already built-in, but can be overriddengradientchat.Bot.sendMsgSends a message.NOTE:sendMsgis not required only if you are using thecmddecorator and can be replace by using thereturnkeyword.gradientchat.Bot.emitEmits an event with optional arguments to the server. An alias forgradientchat.Bot.cli.emit
Package: gradient-cli
​​​​​​​MaxGradientautomates the printing gradient colored text to the console. It's built upon the greatrich library. It contains a Console that can serve as a drop in replacement forrich.rich.Consoleand has an expanded Color class which can parse X11 color names on top of rich's standard colors.MaxGradientis a work in progress and I'm open to any suggestions or contributions.​InstallationMaxGradientcan be installed from PyPi using your favorite package manager:PDM(Recommended)pdmaddmaxgradientPippipinstallmaxgradientUsageBasic UsageThe basic usage is to create a console object and use it to print gradient text:importmaxgradientasmgconsole=mg.Console()console.gradient("Hello, World!")GradientYou may also instantiate a Gradient Object. TheGradientclass is a subclass of therich.text.Textclass, and can be used in the same way. TheGradientclass has a few extra arguments available though.classGradient(rich.rich.Text):"""Text with gradient color / style."""def__init__(ext:Optional[str|Text]="",colors:Optional[str|List[Color|Tuple|str]]=None,rainbow:bool=False,invert:bool=False,hues:Optional[int]=None,color_sample:bool=False,style:StyleType=Style.null(),*,# The arguments below are used directly by Text# so I won't cover them here. If you have# questions check out the rich documentation.justify:Optional[JustifyMethod]=None,overflow:Optional[OverflowMethod]=None,no_wrap:Optional[bool]=None,end:str="\n",tab_size:Optional[int]=8,spans:Optional[List[Span]]=None,)->None:The Gradient class can utilize the above arguments to get a plethora of different gradients.ColorThe final main component ofMaxGradientis expanding therich.color.Colorclass. TheMaxGradient.Colorclass can still parse and utilize therich.color.Color'sstandard colorsbut in addition to Hex and RGB colors, it can also parse RGB Tuples as well as X11 color names. I've also included the colors thatMaxGradientuses to create random gradients from for convenience. The follow are the available named colors as well as there hex and rgb colors:Color Examplesimportmaxgradientasmgconsole=mg.Console()console.print("[bold green]This is a a vibrant green color!")Changelog v1.0.6Added docsChanged docs to readthedocs theme.
Package: gradientcobra
Introductiongradientcobrais thepythonpackage implementation of Gradient COBRA method byS. Has (2023), which is a kernel-based consensual aggregation method for regression problems.
It is a regular kernel-based version ofCOBRAmethod byBiau et al. (2016).
We have theoretically shown that the consistency inheritance property also holds for this kernel-based configuration, and the same convergence rate as classical COBRA is achieved.
Moreoever, gradient descent algorithm is applied to efficiently estimate the bandwidth parameter of the method. This efficiency is illustrated in several numerical experiments on simulated and real datasets.For more information, read the “Documentation and Examples” below.InstallationIn your terminal, run the following command to download and install from PyPI:pip install gradientcobraCitationIf you findgradientcobrahelpful, please consider citing the following papaers:S. Has (2023),Gradient COBRA: A kernel-based consensual aggregation for regression.A. Fischer and M. Mougeot (2019),Aggregation using input-output trade-off.G. Biau, A. Fischer, B. Guedj and J. D. Malley (2016),COBRA: A combined regression strategy.Documentation and ExamplesFor more information and how to use the package, readgradientcobra documentation.Read also:GradientCOBRA documentation.MixCOBRARegressor documentation.Kernel Smoother documentation.Super Learner documentation.DependenciesPython 3.9+numpy, scipy, scikit-learn, matplotlib, pandas, seaborn, plotlyReferencesS. Has (2023). A Gradient COBRA: A kernel-based consensual aggregation for regression.
Journal of Data Science, Statistics, and Visualisation, 3(2).A. Fischer, M. Mougeot (2019). Aggregation using input-output trade-off.
Journal of Statistical Planning and Inference, 200.G. Biau, A. Fischer, B. Guedj and J. D. Malley (2016), COBRA: A
combined regression strategy, Journal of Multivariate Analysis.M. Mojirsheibani (1999), Combining Classifiers via Discretization,
Journal of the American Statistical Association.M. J. Van der Laan, E. C. Polley, and A. E. Hubbard (2007). Super Learner.
Statistical Applications of Genetics and Molecular Biology, 6, article 25.T. Hastie, R. Tibshirani, J. Friedman (2009). Kernel Smoothing Methods.
The Elements of Statistical Learning. Springer Series in Statistics. Springer, New York, NY.
Package: gradient-decode-dicom
TensorFlow Decode DICOMOperationsDecode DICOM contains two Tensorflow Operations that allow reading information from DICOM files.Decode DICOM Imageloads a dicom image file and returns its pixel information in the specified output format.Decode DICOM Dataloads a dicom image file and returns a sting tensor with the values of each of the supplied tags.Inputscontents:* Description: byte string with the file bytes. Use tf.io.read_file to read the file contents into a string.
* Type: stringAttributesdtype:* Description: Type for the output tensor
* Type: Dtype
* Possible Values: uint8, uint16, uint32, uint64, float, float16, double
* Default Value: uint16color_dim:* Description: Whether or not to include the color_dimension. If decoded image is monochrome and this attribute is True the output tensor will have an extra singleton dimension for the color.
* Type: Bool
* Default Value: Trueon_error:* Description: This attribute establishes the behavior in case an error occurs on opening the image or if the output type cannot accomodate all the possible input values. *'strict'* throws an error, *'skip'* returns 0 and *'lossy'* continues with the operation as if no error occurred.
* Possible Values: 'strict', 'skip', 'lossy'
* Default Value: 'skip'scale:* Description: This attribute establishes what to do with the scale of the input values. *'auto'* will autoscale the input values, if the output type is integer, *'auto'* will use the maximum output scale, if the output is float, *'auto'* will scale to [0,1]. *'preserve'* keeps the values as they are, an input value greater than the maximum possible output will be clipped.  
* Possible Values: 'auto', 'preserve'
* Default Value: 'preserve'Outputsoutput:* Description: Pixel data of the DICOM image
* Type: Tensor of selected type (see attribute dtype)
* Dimensions: [F, I, J, C]
    * F: Number of frames
    * I: Number of rows
    * J: Number of columns
    * C: Color dimensionsInstallationpipinstallgradient-decode-dicom
Package: gradient-descent
gradient-descentgradient-descent is a package that contains different gradient-based algorithms, usually used to optimize Neural Networks and other machine learning models. The package contains the following algorithms:Gradients DescentMomentumRMSpropNasterov accelerated gradientAdamThe package purpose is to facilitate the user experience when using optimization algorithms and to allow the users to have a better intuition about how thisblack-boxesalgorithms works.This is an open-source project, any feedback, improvement ideas, and contributors are welcome.InstallationDependenciesPython (>= 3.6)NumPy (>= 1.13.3)Matplotlib (>=3.2.1)User installationpip install gradient-descentDevelopmentAll contributors of all levels are welcome to help in any possible away.Souce Codegit clone https://github.com/DanielDaCosta/gradient-descent.gitTestspytest testsTO DOThe package is still on its early days and there are a lot of improvements to make:Build new optimization algorithmsExtend its use for multivariable functionsNew ideas of functions for better usabilityImprove DocumentationAcknowledgementsFirst of all I would like to thank Hammad Shaikh by his well documented and very well explained GitHub repositoryMath of Machine Learning Course by SirajI would like to appreciate the help of the following contents and articles in the package development:Optimizing Gradient Descentby Sebastian RuderOptimization Techniques for Gradient Descentbywww.geeksforgeeks.orgwebsiteoptimization_algosGitHub repository by Iain Carmichael[Deep Learning] (http://www.deeplearningbook.org) by Begnio, Goodfellow and Courtville
Package: gradient-descent-edf1101
Gradient Descent ModuleIntroductionGradient Descent for the Fundamentals of Machine Learning module of my Computer Science DegreeGetting StartedInstallationThis can be installed via pip by runningpip installIt can then be used as a regular moduleExamplesExamples found in the examples folder both as a python file and as jupyter notebooksThe blue points are the random points that somewhat fit the curve 2x2- 3x + 4The Red line is the actual curveThe Green line is the predicted curvePrerequisitesModules UsedMatplotlibVersion of python Used = 3.11.4Developer DetailsDocumentationHTML file documentation generated by sphinx can be foundhereLintingIn the base of the project you can runpylint gradient_descentLearning Parameters (for OK results)Quartic - learning = 0.0000000003Cubic - learning = 0.00000003Quadratic - learning = 0.000001Linear - learning = 0.00001In general for each extra polynomial term you add it should be ~100x smaller.
Smaller learning rates may get better results, but you will need to have more attempts to reach it since it learns slowerTestingpytest is required for these tests.
This can be installed bypip install pytestDetailsLicenseThis falls under the MIT license foundhereAuthorsEd FillinghamSourcesThis project can be found athttps://github.com/edf1101/GradientDescent
Package: gradient-figlet
Gradient FigletA CLI that prints (optionally outputs html) gradient figlets usingrichandpyfigletUsageTo get all the information about the parameters, run the following command:python-mgradient_figlet-hTo just test out the tool with some pre determined pleasant parameters, run the following command:python-mgradient_figletYOUR_TEXTAnd change YOUR_TEXT to something else that you want.Screenshots
Package: gradient-generator
Gradient GeneratorGenerate random but beautiful gradients in a super simple way.DemoYou can check out more exampleshereFeaturesSuper simple usageCurrent limitationsNo way to choose colorsPNG onlyInstallation$pipinstallgradient-generatorUsagefromgradient_generatorimportgenerate_gradientimage=generate_gradient(640,480)image<_io.BytesIOobjectat0x10ce70040>withopen('test.png','wb')asf:f.write(image.getbuffer())SupportIf you need help or found a bug, consider opening an issue on the project.LicenceThe source code for this project is licensed under the MIT license, which you can find in the MIT-LICENSE.txt file.
Package: gradient_metrics
This package implements utilities for computing gradient metrics for measuring uncertainties in neural networks based on the paper "Classification Uncertainty of Deep Neural Networks Based on Gradient Information, Oberdiek et al., 2018".An application of this can also be found in "On the Importance of Gradients for Detecting Distributional Shifts in the Wild, Huang et al., 2021"Documentation and examples can be found onGitHub pages.Table of ContentsInstallationUsageContributingCitingInstallationpipinstallgradient-metricsUsageExample of computing the maximum, minimum, mean and standard deviation of gradient entries as inClassification Uncertainty of Deep Neural Networks Based on Gradient Information:fromgradient_metricsimportGradientMetricCollectorfromgradient_metrics.metricsimportMax,Min,MeanStdimporttorch.nn.functionalastfunc# Initialize a networkmynet=MyNeuralNetwork()# Initialize the GradientMetricCollectormcollector=GradientMetricCollector([Max(mynet),Min(mynet),MeanStd(mynet),])# Predict your dataout=mynet(x)# Construct pseudo labelsy_pred=out.argmax(1).clone().detach()# Construct the sample wise loss for backpropagationsample_loss=tfunc.cross_entropy(out,y_pred,reduction="none")# Compute the gradient metricsmetrics=mcollector(sample_loss)Example of computing the L1-Norm fromOn the Importance of Gradients for Detecting Distributional Shifts in the Wild:fromgradient_metricsimportGradientMetricCollectorfromgradient_metrics.metricsimportPNormimporttorchimporttorch.nn.functionalastfunc# Initialize a networkmynet=MyNeuralNetwork()# Initialize the GradientMetricCollectormcollector=GradientMetricCollector(PNorm(mynet))# Predict your dataout=mynet(x)# Construct the sample wise loss for backpropagationsample_loss=torch.log(tfunc.softmax(out,dim=1)).mean(1).neg()# Compute the gradient metricsmetrics=mcollector(sample_loss)ContributingRequirements:Python 3.8 or higherpoetrymakeContributions in the form of PRs or issues are welcome. To install the development environment runmakesetupBefore you open your pull-request, make sure that all tests are passing in your local copy by runningmake test.Citing@inproceedings{OberdiekRG18,  
  author    = {Philipp Oberdiek and  
               Matthias Rottmann and  
               Hanno Gottschalk},  
  editor    = {Luca Pancioni and  
               Friedhelm Schwenker and  
               Edmondo Trentin},  
  title     = {Classification Uncertainty of Deep Neural Networks Based on Gradient  
               Information},  
  booktitle = {Artificial Neural Networks in Pattern Recognition - 8th {IAPR} {TC3}  
               Workshop, {ANNPR} 2018, Siena, Italy, September 19-21, 2018, Proceedings},  
  series    = {Lecture Notes in Computer Science},  
  volume    = {11081},  
  pages     = {113--125},  
  publisher = {Springer},  
  year      = {2018},  
  url       = { https://doi.org/10.1007/978-3-319-99978-4_9 },  
  doi       = { 10.1007/978-3-319-99978-4\_9 },  
}
Package: gradientmodel
Gradient ModelCalculate the surface impedance of a rough metal surface using the Gradient Model (GM)Example: Surface Impedance of GoldSurface impedance of gold (conductivity: 4.1e7 S/m) between 280 GHz and 360 GHz:To use these results in HFSS, selectAssign boundary > Impedance...and then copy/paste these values into the dialog box:50 nm surface roughness:
   Real:       -1.6644e-25 * Freq^2 + 5.1199e-13 * Freq^1 + 6.1107e-02
   Imaginary:  -3.4813e-25 * Freq^2 + 2.2603e-12 * Freq^1 + 7.2291e-02
   ur:         -1.3448e-23 * Freq^2 + 5.0514e-11 * Freq^1 + 3.9464e+00

75 nm surface roughness:
   Real:       -1.5186e-25 * Freq^2 + 6.0379e-13 * Freq^1 + 5.8012e-02
   Imaginary:  -4.5447e-25 * Freq^2 + 3.0960e-12 * Freq^1 + 7.9819e-02
   ur:         -2.5105e-23 * Freq^2 + 9.6127e-11 * Freq^1 + 5.8256e+00

100 nm surface roughness:
   Real:       -1.4427e-25 * Freq^2 + 7.0489e-13 * Freq^1 + 5.5407e-02
   Imaginary:  -5.6445e-25 * Freq^2 + 3.8871e-12 * Freq^1 + 8.8834e-02
   ur:         -3.9840e-23 * Freq^2 + 1.5236e-10 * Freq^1 + 8.0508e+00ReferencesGradient model:G. Gold and K. Helmreich, “A Physical Surface Roughness Model and Its Applications,” IEEE Trans. Microw. Theory Tech., vol. 65, no. 10, pp. 3720–3732, Oct. 2017, doi:10.1109/TMTT.2017.2695192.K. Lomakin, G. Gold, and K. Helmreich, “Analytical Waveguide Model Precisely Predicting Loss and Delay Including Surface Roughness,” IEEE Trans. Microw. Theory Tech., vol. 66, no. 6, pp. 2649–2662, Jun. 2018, doi:10.1109/TMTT.2018.2827383.Closed-form solution:D. N. Grujic, “Closed-Form Solution of Rough Conductor Surface Impedance,” IEEE Trans. Microw. Theory Tech., vol. 66, no. 11, pp. 4677–4683, 2018, doi:10.1109/TMTT.2018.2864586.
Package: gradientone
The client code connecting test and measurement devices to the cloud.Warning:Currently this client software is intended to only run on pre-configured GradientOne machines. Running this without a properly configured machine may result in unexpected behavior. Use at your own risk.Set Config FileIt’s important to set up your config file before running the module. After installing with pip, a/etc/gradientone.gradient_one.cfg.samplefile is created. Edit the variables to include the AUTH_TOKEN and change variable names to match your particular configuration. Then change the file name back to/etc/gradient_one.cfgbefore running the client.$ sudo cp gradient_one.cfg.sample /etc/gradient_one.cfgUsageIt’s recommended to create a ‘client’ directory and execute from there:$ mkdir ~/client
$ cd ~/client
$ sudo gradientoneMore InfoFor more information visit:http://www.gradientone.com/
Package: gradient-optimizers
# Gradient OptimizersOptimize you Theano Models with [Adagrad](http://www.magicbroom.info/Papers/DuchiHaSi10.pdf), Hessian Free optimization, or linear updates.pip3 install gradient-optimizersSee example notebook (TBD) for tutorial.Two classes **GradientModel**, and **GradientHFModel**, for optimizing gradientbased models (specifically built with indexed parameters in mind (e.g.for language models))## GradientModelA gradient model for updating your model withhessian free, adagrad, or linear decay updates.You will need to define the following attributes,and fill them as appropriate:# a forward method for getting errors:projection = self.projection_function(ivector <indices/>)# a cost function (that takes the result of projection function and labels as input)# and returns a symbolic differentiable theano variableself.cost_function(projection, ivector <label/>).sum()self.params = []self.indexed_params = set()self._l2_regularization = True / Falseself.store_max_updates = True / False# set this theano settingself.theano_mode = "FAST_RUN"# set this theano settingself.disconnected_inputs = 'ignore' / None# if L2 is true store this parameter:self._l2_regularization_parameter = theano.shared(np.float64(l2_regularization).astype(REAL), name='l2_regularization_parameter')Upon initialization you must run:self._select_update_mechanism(update_method_name)# then to compile this mechanism:self.create_update_fun()The update methods expect the input to be of the form:ivector <indices/>, ivector <labels/>If this is not the case you can modify them as appropriate.## GradientHFModelImplements an symbolic one step of hessian-free [1]optimization that approximates the curvature,requires a _compute_cost method that takes an exampleas input or a _compute_cost_gradients that returnsgradients for each example provided.Model should have a params property containing symbolictheano variables.[[1] James Martens, ``Deep learning via Hessian-free optimization", ICML 2010](http://www.icml2010.org/papers/458.pdf)Make sure the following parameters are not tampered with:self._additional_paramsself._num_updates
Package: gradients
Build your deep learning models with confidenceGradients provide a self consistency test function to perform gradient checking on your deep learning models. It uses centered finite difference approximation method to check the difference between analytical and numerical gradients and report if the check fails on any parameters of your model. Currently the library supports only PyTorch models built with custom layers, custom loss functions, activation functions and any neural network function subclassingAutoGrad.Installationpip install gradientsPackage OverviewOptimizing deep learning models is a two step process:Compute gradients with respect to parametersUpdate the parameters given the gradientsIn PyTorch, step 1 is done by the type-based automatic differentiation systemtorch.nn.autogradand 2 by the package implementing optimization algorithmstorch.optim. Using  them, we can develop fully customized deep learning models withtorch.nn.Moduleand test them usingGradientas follows;Activation function with backwardclassMySigmoid(torch.autograd.Function):@staticmethoddefforward(ctx,input):output=1/(1+torch.exp(-input))ctx.save_for_backward(output)returnoutput@staticmethoddefbackward(ctx,grad_output):input,=ctx.saved_tensorsreturngrad_output*input*(1-input)Loss function with backwardclassMSELoss(torch.autograd.Function):@staticmethoddefforward(ctx,y_pred,y):ctx.save_for_backward(y_pred,y)return((y_pred-y)**2).sum()/y_pred.shape[0]@staticmethoddefbackward(ctx,grad_output):y_pred,y=ctx.saved_tensorsgrad_input=2*(y_pred-y)/y_pred.shape[0]returngrad_input,NonePytorch ModelclassMyModel(torch.nn.Module):def__init__(self,D_in,D_out):super(MyModel,self).__init__()self.w1=torch.nn.Parameter(torch.randn(D_in,D_out),requires_grad=True)self.sigmoid=MySigmoid.applydefforward(self,x):y_pred=self.sigmoid(x.mm(self.w1))returny_predCheck your implementation using GradientimporttorchfromgradientsimportGradientN,D_in,D_out=10,4,3# Create random Tensors to hold inputs and outputsx=torch.randn(N,D_in)y=torch.randn(N,D_out)# Construct model by instantiating the class defined abovemymodel=MyModel(D_in,D_out)criterion=MSELoss.apply# Test custom build modelGradient(mymodel,x,y,criterion,eps=1e-8)CitingGradients@software{nambusubramaniyan_saranraj_2021_5176243,author={Nambusubramaniyan,Saranraj},title={gradients},month=aug,year=2021,publisher={Zenodo},version={1.0.0},doi={10.5281/zenodo.5176243},url={https://doi.org/10.5281/zenodo.5176243}}```