Saravanan666/pypi-org huggingface dataset:
Package: optimas
Optimization at scale, powered bylibEnsembleExplore the docs »View Examples·Support·API ReferenceOptimas is a Python library designed for highly scalable optimization, from laptops to massively-parallel supercomputers.Key FeaturesScalability: Leveraging the power oflibEnsemble, Optimas is designed to scale seamlessly from your laptop to high-performance computing clusters.User-Friendly: Optimas simplifies the process of running large parallel parameter scans and optimizations. Specify the number of parallel evaluations and the computing resources to allocate to each of them and Optimas will handle the rest.Advanced Optimization: Optimas integrates algorithms from theAxlibrary, offering both single- and multi-objective Bayesian optimization. This includes advanced techniques such as multi-fidelity and multi-task algorithms.InstallationYou can install Optimas from PyPI (recommended):pipinstalloptimasfrom conda-forge:condainstalloptimas--channelconda-forgeor directly from GitHub:pipinstallgit+https://github.com/optimas-org/optimas.gitMake surempi4pyis available in your environment before installing optimas. Fore more details, check out the fullinstallation guide. We have also prepared dedicated installation instructions for some HPC systems such asJUWELS (JSC),Maxwell (DESY)andPerlmutter (NERSC).DocumentationFor more information on how to use Optimas, check out thedocumentation. You'll find installation instructions, a user guide,examplesand the API reference.SupportNeed more help? Join ourSlack channelor open anew issue.Citing optimasIf your usage of Optimas leads to a scientific publication, please consider citing the originalpaper:@article{PhysRevAccelBeams.26.084601,title={Bayesian optimization of laser-plasma accelerators assisted by reduced physical models},author={Ferran Pousa, A. and Jalas, S. and Kirchen, M. and Martinez de la Ossa, A. and Th\'evenet, M. and Hudson, S. and Larson, J. and Huebl, A. and Vay, J.-L. and Lehe, R.},journal={Phys. Rev. Accel. Beams},volume={26},issue={8},pages={084601},numpages={9},year={2023},month={Aug},publisher={American Physical Society},doi={10.1103/PhysRevAccelBeams.26.084601},url={https://link.aps.org/doi/10.1103/PhysRevAccelBeams.26.084601}}and libEnsemble:@article{Hudson2022,title={{libEnsemble}: A Library to Coordinate the ConcurrentEvaluation of Dynamic Ensembles of Calculations},author={Stephen Hudson and Jeffrey Larson and John-Luke Navarro and Stefan M. Wild},journal={{IEEE} Transactions on Parallel and Distributed Systems},volume={33},number={4},pages={977--988},year={2022},doi={10.1109/tpds.2021.3082815}}
Package: optimask
OptiMask: Efficient NaN Data Removal in PythonIntroductionOptiMask is a Python package designed to facilitate the process of removing NaN (Not-a-Number) data from matrices while efficiently computing the largest (and not necessarily contiguous) submatrix without NaN values. This tool prioritizes practicality and compatibility with Numpy arrays and Pandas DataFrames.Key FeaturesLargest Submatrix without NaN:OptiMask calculates the largest submatrix without NaN, enhancing data analysis accuracy.Efficient Computation:With optimized computation, OptiMask provides rapid results without undue delays.Numpy and Pandas Compatibility:OptiMask seamlessly adapts to both Numpy and Pandas data structures.UtilizationTo employ OptiMask, install theoptimaskpackage via pip:pipinstalloptimaskUsage ExampleImport theOptiMaskclass from theoptimaskpackage and utilize its methods for efficient data masking:fromoptimaskimportOptiMaskimportnumpyasnp# Create a matrix with NaN valuesm=120n=7data=np.zeros(shape=(m,n))data[24:72,3]=np.nandata[95,:5]=np.nan# Solve for the largest submatrix without NaN valuesrows,cols=OptiMask.solve(data)# Calculate the ratio of non-NaN values in the resultcoverage_ratio=len(rows)*len(cols)/data.size# Check if there are any NaN values in the selected submatrixhas_nan_values=np.isnan(data[rows][:,cols]).any()# Print or display the resultsprint(f"Coverage Ratio:{coverage_ratio:.2f}, Has NaN Values:{has_nan_values}")# Output: Coverage Ratio: 0.85, Has NaN Values: FalseFurther InformationAdditional details about the algorithm are available in thisnotebook.Repository LinkFind more about OptiMask onGitHub.ContributionsContributions to theoptimaskproject are encouraged. For bug reports, feature requests, or code contributions, please open an issue or submit a pull request.
Package: optimeed
Optimeed aims at easing data generation and visualization.
Its key strength is its adaptability toanyproblem thanks to its flexibility, while accounting for parallelization, disk space and RAM usages.It is divided in 4 Modules:coreEmbeds all the tools to load/save python objects in plain text using json-like format.optimizeA framework to solve optimization problem, while profiting fromcoresaving utilities.consolidateA framework to perform sensitivity analyses, while profiting fromcoresaving utilities.visualizeA framework for data analysis. Provides GUI foroptimizeandconsolidate, using 2D interactive graphs. For the optimization, results can be displayed in real time.InstallationTo install the latest optimeed release, run the following command:pip install optimeedTo install the latest development version of optimeed, run the following commands:git clone https://git.immc.ucl.ac.be/chdegreef/optimeed.git
cd optimeed
python setup.py installSupportGitlab (preferably), readthe guided tutorials.orDocumentation optimeedorSend mail atchristophe.degreef@uclouvain.be.LicenseThe project is distributed "has it is" underGNU General Public License v3.0 (GPL), which is a strong copyleft license.
This means that the code is open-source and you are free to do anything you want with it,as long as you apply the same license to distribute your code.
This constraining license is imposed by the use ofPlatypus Libraryas "optimization algorithm library", which is under GPL license.It is perfectly possible to use other optimization library (which would use the same algorithms but with a different implementation) and to interface it to this project, so that the use of platypus is no longer needed. This work has already been done forNLopt, which is under MIT license (not constraining at all).
In that case,after removing all the platypus sources(optiAlgorithms/multiObjective_GA and optiAlgorithsm/platypus/*), the license of the present work becomes less restrictive:GNU Lesser General Public License (LGPL). As for the GPL, this license makes the project open-source and free to be modified, but (nearly) no limitation is made to distribute your code.
Package: optimis
Optimus: HuggingFace-Aligned 3D-parallel backendflash attention 2 support on trainingflash attention 2 support on left-padding generation with kv cachefmha on GQA & MQAmulti model topology support by mpu contextmore model type for experiment (PPL,RM,...)GQA & MQA generation (left-padding)TODO:less model control optiongenerator based on non-batch flash attention and self-design cuda fused kernelFixed pipeline modelKV Cache management by pre-malloc and reuse (pre-calculate)
Package: optimisation-algorithms
Optimisation-AlgorithmsA collection of the most commonly used Optimisation Algorithms for Data Science & Machine LearningThis repository is created by and belongs to:https://github.com/Muradmustafayev-03Contributing guide:https://github.com/Muradmustafayev-03/Optimisation-Algorithms/blob/main/CONTRIBUTING.mdTo report any issues:https://github.com/Muradmustafayev-03/Optimisation-Algorithms/issuesTo install the package as a library use:pip install optimisation-algorithmsThen to import:import optimisation-algorithmsIn this project I try to collect as many useful Optimisation Algorithms as possible, and write them in a simple and reusable way.
The idea is write all these algorithms in python, in a fundamental, yet easy-to-use way, withnumpybeing the only external library used.
The project is currently on the early stages of the development, but one can already try and implement it in their own projects.
And for sure, you are always welcome to contribute or to make any suggestions. Any feedback is appreciated.What is an Optimisation Algorithm?For more information:https://en.wikipedia.org/wiki/Mathematical_optimizationOptimisation Algorithmis an algorithm, that is used to find input values of theglobal minima, or less often, of theglobal maximaof a function.In this project, all the algorithms look for theglobal minimaof the given function.
However, if you want to find theglobal maximaof a function, you can pass the negation of your function:-f(x), instead off(x),
having that its mimima will be the maxima of your function.Optimization algorithmsare widely used inMachine Learning,Mathematicsand a range of other applied sciences.There are multiple kinds ofOptimization algorithms, so here is a short description ofthe ones, used in the project:Iterative AlgorithmsTese algorithms start from a random or specified point, and step by step move torwards the closest minima.
They often require thepartial derivativeor thegradientof the function, which requires function to be differentiable.
These algorithms are simple and work good forbowl-likefunctions,
thow if there is mor than one minimum in function, it can stock at alocal minima, insted of finding theglobalone.Examples of theIterative Algorithmsused in this project are:Gradient DescentBatch Gradient DescentApproximated Batch Gradient DescentMetaheuristic AlgorithmsThese algorithms start with a set of random solutions,
then competetively chose the best solutions from the set and based on them,
generate a new set of better solutions, thus evolving each iteration.
These algorithms don't stock atlocal minimums, but directly find theglobalone, so they can be used formany-local-minimumsfunctions.Examples of theMetaheuristic Algorithmsused in this project are:Harmony Search AlgorithmGenetic AlgorithmBenchmark FunctionsBenchmark functionsare used to testOptimization Algorithms, however they can be used by themselves.
There are multiplebenchmark functionsused in this project, and they are divided into several types depending on their shape.For more information and the mathematical definition of the functions see:https://www.sfu.ca/~ssurjano/optimization.html
Package: optimiser
OptimiserOverviewThis Python package is a library with implementations of some optimization techniques. Current content is shown in the below table:MethodImplementationCross-Entropyoptimize_with_crossentropy_methodOf course, just one function is not that much...InstallationpipinstalloptimiserUsageAll functions from the package (especially, those of them that are designed for end users) have a built-in documentation that describes every argument. To read it, look at a docstring or, alternatively, run from Python shell a command like this one:help(optimize_with_crossentropy_method)
Package: optimism
optimismA very small & simple unit-testing framework designed to provide all the
basic necessities to beginner programmers as simply as possible.Designed by Peter Mawhorter.DependenciesWorks on Python versions 3.7 and up, with 3.9+ recommended.InstallingTo install from PyPI, run the following command on the command-line:python3-mpipinstalloptimismOnce it's installed, you can run the tests using:pytest--doctest-modulesoptimism.py
pytesttest_examples.pyUsageUse thetestFunction,testFunctionMaybe,testFile,testBlock,
and/ortestThisNotebookCellfunctions to establish test managers for
specific pieces of code. Then use those managers'checkCodeContainsmethods to check for the presence/absence of certain code constructs (see
theASTRequirementclass) or use thecasemethod to establish a test
case w/ specific inputs (one manager can support multiple derived cases
w/ different inputs). Finally, use methods of a test case likecheckResultorcheckPrintedLinesto check for specific behavior.Seethe documentationfor more details on how to use it and what each function does.ChangelogSeethe documentation.
Package: optimism-python
Optimism-Python: Unofficial Python Client for the OP-Stack:construction:DISCLAIMER: Reference SDK is still under active development so the repository might be temporarily out of date.This library is a Python implementation of theOP-Stack SDK. It tries to mirror some of the core functionalities such as:providing easy access to the OP-Stack contractsbridging of assets from L1 to L2 (deposits) and vice-versa (withdrawls)creating withdrawl proofsGetting startedInstallationpipinstalloptimism-pythonDeposit ETH to L2fromweb3importWeb3fromoptimismimportCrossChainMessenger# Create a node provider for each chainprovider_l1=Web3(Web3.HTTPProvider("https://eth-mainnet.g.alchemy.com/v2/<your-alchemy-key>"))provider_l2=Web3(Web3.HTTPProvider("https://optimism-mainnet.g.alchemy.com/v2/<your-alchemy-key>"))# Specify an account for each chain (can be the same)account_l1=provider_l1.eth.account.from_key("<your-private-key>")account_l2=provider_l2.eth.account.from_key("<your-private-key>")# Create a messenger instancemessenger=CrossChainMessenger(chain_id_l1=1,# Ethereum Mainnetchain_id_l2=10,# Optimism Mainnetaccount_l1=account_l1,account_l2=account_l2,provider_l1=provider_l1,provider_l2=provider_l2)# Deposit 1 ETH to L2messenger.deposit_eth(10**18)
Package: optimistix
OptimistixOptimistix is aJAXlibrary for nonlinear solvers: root finding, minimisation, fixed points, and least squares.Features include:interoperable solvers: e.g. autoconvert root find problems to least squares problems, then solve using a minimisation algorithm.modular optimisers: e.g. use a BFGS quadratic bowl with a dogleg descent path with a trust region update.using a PyTree as the state.fast compilation and runtimes.interoperability withOptax.all the benefits of working with JAX: autodiff, autoparallism, GPU/TPU support etc.InstallationpipinstalloptimistixRequires Python 3.9+ and JAX 0.4.14+ andEquinox0.11.0+.DocumentationAvailable athttps://docs.kidger.site/optimistix.Quick exampleimportjax.numpyasjnpimportoptimistixasoptx# Let's solve the ODE dy/dt=tanh(y(t)) with the implicit Euler method.# We need to find y1 s.t. y1 = y0 + tanh(y1)dt.y0=jnp.array(1.)dt=jnp.array(0.1)deffn(y,args):returny0+jnp.tanh(y)*dtsolver=optx.Newton(rtol=1e-5,atol=1e-5)sol=optx.fixed_point(fn,solver,y0)y1=sol.value# satisfies y1 == fn(y1)FinallyJAX ecosystemjaxtyping: type annotations for shape/dtype of arrays.Equinox: neural networks.Optax: first-order gradient (SGD, Adam, ...) optimisers.Diffrax: numerical differential equation solvers.Lineax: linear solvers.BlackJAX: probabilistic+Bayesian sampling.Orbax: checkpointing (async/multi-host/multi-device).sympy2jax: SymPy<->JAX conversion; train symbolic expressions via gradient descent.Eqxvision: computer vision models.Levanter: scalable+reliable training of foundation models (e.g. LLMs).PySR: symbolic regression. (Non-JAX honourable mention!)DisclaimerThis is not an official Google product.CreditOptimistix was primarily built by Jason Rader (@packquickly):Twitter;GitHub;Website.
Package: optimizationalgo
Оптимизационные алгоритмы для задачи коммивояжёраБиблиотека содержит в себе некоторые алгоритмы для оптимального решения задачи коммивояжёра.Какие есть возможности:Решение задачи коммивояжера алгоритмом имитации отжигаРешение задачи коммивояжера алгоритмом муравьиной колонииГенетический алгоритм coming soon...
Package: optimization-dashboard
Optimization DashboardVisualize multidimensional data from studies performed by Hyperactive and Gradient-Free-Optimizers.ExamplesimportpandasaspdfromdashboardimportDashboard# create so test dataset for this exampledf_array=[[0.5,6,50,0.6],[0.9,7,40,0.7],[0.2,9,70,0.8]]columns=["x1","x2","x3","score"]search_data=pd.DataFrame(df_array,columns=columns)# save the dataframe to filesearch_data.to_csv("./search_data")board=Dashboard()# the dashboard must read the dataframe from a fileboard.open_search_data_file("./search_data")The search data that is loaded from file must always follow the pattern below:scorex1x2...0.7560.10.2...0.8230.30.1...........................Hereby "x1", "x2", ... can be given any name. But "score" is always necessary!API referenceDashboard(plots=[
"score_statistics",
"1d_scatter",
"2d_scatter",
"3d_scatter",
"parallel_coordinates",
]
).open_search_data_file(path)
Package: optimization-lib
Optimization LibraryThe optimization library measures the general speed of a program based on the last run.This library can be used by developers to speed up their programs.Example Usage:First, import the library:from optimization import optimizationNext, the library needs to be initialized:opt = optimization.OptimizationLibrary()Finally, we can start and stop the timer:opt.start_timer()
'''
implement function/program to meausure 
'''
opt.end_timer()Example Filefrom optimization import optimization

def function_to_optiimize()
    pass

def test():
    opt = optimization.OptimizationLibrary() 
    opt.start_timer()
    function_to_optiimize()
    opt.end_timer()
if __name__ == '__main__':
    test()Additional Notes:This is a developer tool.The library has a small performance window (to account for natural program variance).This is an optional parameter that can be changed with the 'variance' optional parameter.The library can also be initialized with an optional parameter to show performance increases/decreases visually. This can be changed with the 'color' parameter:opt = optimization.OptimizationLibrary(variance=2.5, color=True)
Package: optimization-metadata
Optimization-MetadataMeta-data core functionalities for Hyperactive.This package is a collection of core functionalities for the memory module in Hyperactive. It enables Hyperactive to "remember" previous evaluations, which can save significant computation time. The effect is, that every position in the search-space that has been evaluated once never needs to be evaluated again. The previous calculated score has been stored and can just be looked up instead of recalculating it.
Optimization-Metadata also enables persistent storage of python-objects in the meta-data. This means, that information about the objective-function and python-objects in the search-space can be saved and read via the dill-package.Master status:Code quality:Latest versions:
Package: optimization-problem-inspector
optimization-problem-inspectorTable of ContentsInstallationRunning GUILicenseInstallationFrom PyPIFirst create a new virtual environment and activate it or activate desired virtual environment.Now install theoptimization-problem-inspectorfrom PyPI withpip install optimization-problem-inspectorNOTEThis install works only for certain Linux distributions! You may have to re-compile for your distribution or Windows/Mac. SeeInstalling bbob_functionsfor more info.From sourceYou can also install the package from source. The project is hosted at:https://repo.ijs.si/DIS-CI/optimization-problem-inspectorDownload the repo and cd to it. Create a fresh virtual environment with python 3.9 or higher, e.g.,python-mvenv.venvActivate it with something like# in Linux/Unixsource.venv/bin/activateNow install the package with (use-eflag to make and editable install if desired)pip install -e .This will make the package available in the currently activated virtual environment.UsinghatchYou can also usehatchto manage dependencies and get some additional extra functionality. After cd-ing to the project directory, you can runhatchrunpythonto start Python3 shell withoptimization-problem-inspector installed.Installingbbob_functionsYou may have to re-compile for your Linux distribution or Windows/Mac. Go to the virtual environment folders created byvenvtool or your virtual environment manager of choice and find thebbob_functionsdirectory. Usually something like.../envs/opi-test/lib/python3.1/site-packages/optimization_problem_inspector/bbob_functionsor similar. Note, this is relevant only if you did not invoke editable install (i.e., you have not installed the package by cloning the repo or obtained the source in some way and executedpip install -e .- using-eflag). With your virtual environment activated, you can now re-build thebbob_functionsmodule withpythoninstall_bbob_functions.pybuild_ext-iUsinghatchIf usinghatch, buildingbbob_functionsis much easier, go to project directory and invokehatchrunbuild_bbob_functionsRunning GUITo run theoptimization-problem-inspectorGUI after installation process has completed, type commandopi-guiYou can also run the GUI withpython-moptimization_problem_inspector.appNote: the desired virtual environment withoptimization-problem-inspectorhas to be activated.Note: usepythonorpython3command, depending on what executables you have available for Python3.Additional guidesDevelopmentOPI app administrationLicenseoptimization-problem-inspectoris distributed under the terms of theMITlicense.
Package: optimized-image
Optimized-image is a simple Django library to allows optimization
of images by using TinyPNG. Saving an image locally to an
OptimizedImageField uses TinyPNG to optimize the image, then S3
to store it.Detailed documentation is in the “docs” directory.Quick startAdd “optimized_image” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'optimized_image',
]Because optimized_image uses TinyPNG and S3, you will need to
get API keys from each of them. Visithttps://tinypng.com/developersandhttp://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.htmlfor more details on getting a TinyPNG API key (easy) and setting
up an S3 bucket (harder). Once you have done so, add the
following settings to your settings file. Note: it is a good idea
to keep most, if not all, of these secret:TINYPNG_KEY # Go to
S3_KEY_ID
S3_ACCESS_KEY
S3_REGION
S3_BUCKET
S3_OPTIMIZED_IMAGES_FOLDERMigrate the optimized_image models:python manage.py migrate optimized_imageYou may use theOptimizedImageFieldby importing it:from optimized_image.fields import OptimizedImageFieldand saving images into it, the same way you would to a DjangoImageField.You may get an optimized url by using theget_optimized_urlfunction
for an instance of an object. For a blogpost with animagefield that
has had an image uploaded you may run:from optimized_image.utils import get_optimized_url
get_optimized_url(blogpost, ‘image’)If you want to change legacy models with Django’s Image fields and
optimize the images in those fields, you may do so for legacy models
by passing a list of legacy model classes (not their instances) to
the following function:from optimized_image.utils import optimize_legacy_images_in_model_fields
optimize_legacy_images_in_model_fields([LegacyModelClass1, LegacyModelClass2])Note: this function makes calls to TinyPNG and S3, so it can take a really
long time, depending on how many images you have. You may pass in 1
for the verbosity parameter to get logs on the progress:optimize_legacy_images_in_model_fields([LegacyModelClass1, LegacyModelClass2], verbosity=1)Note about TinyPNG API keys: If you obtain the free TinyPNG API token, you are limited to 500
image optimizations per month, so this function may fail if you have a
lot of images. You may either obtain a paid API key, or wait until next month.
Package: optimized-lssvr
Least Squares Support Vector Regression with optimized hyperparametersThis is a simple implementation of the hyperparameter optimization approach proposed in[1].Installationpipinstalloptimized-lssvrExampleimportnumpyasnpfromoptimized_lssvrimportOptimizedLSSVR# generate example datan,nft=500,5x=np.random.rand(n,nft)y=x[:,0]-5*x[:,1]# create and fit modelmodel=OptimizedLSSVR(verbose=1)model.fit(x,y)print('final relative MSE:',model.relative_mse_)print('optimized parameters:',model.params_)More examples can be found in theexamplesdirectory.References[1]Fischer, A., Langensiepen, G., Luig, K., Strasdat, N., & Thies, T. (2015). Efficient optimization of hyper-parameters for least squares support vector regression. Optimization Methods and Software, 30(6), 1095-1108.