Now Reading
FB’s New Python Library Nevergrad Provides A Collection Of Algorithms That Don’t Require Gradient Computation

FB’s New Python Library Nevergrad Provides A Collection Of Algorithms That Don’t Require Gradient Computation

Nevergrad, an open-sourced Python3 toolkit by Facebook for developers offers an extensive collection of algorithms to avoid gradient optimization and present them in a standard ask-and-tell Python framework. The platform enables AI researchers, machine learning scientists, and enthusiasts whose work involves derivative-free optimization to implement state-of-the-art algorithms and methods to compare performance in different settings.

The library includes a broad range of optimizers, such as FastGA, Covariance matrix adaptation, Particle Swarm Optimisation, Sequential quadratic programming, etc. The working of this algorithm can be described as multiple points sampled in one function space, a population of best points is selected and these new points are objected around the existing points in order to improve the current population.


This tool is a Python 3.6+ library and can be installed with the following code

pip install nevergrad

One can also install the master branch instead of the latest release with the following code

pip install git+[email protected]#egg=nevergrad

For cloning the repository, run the following code from inside the repository folder

python3 develop

Solving ML Problems

The gradient-free optimizations in Nevergrad are used to solve a variety of machine learning problems such as discussed below:

    • Noisy problems like independent episodes in reinforcement learning
    • Discrete, continuous or mixed problems like power systems or tasks with neural networks that require simultaneously choosing the learning rate per layer, weight decay per layer, etc
    • Multimodal problems such as those that have several minima, for instance, hyper-parametrization of deep learning for language modelling
  • Separable or rotated problems
  • Partially separable problems like architecture search for Deep Learning

Goals Of This Toolkit

There are basically four goals of this package which are mentioned below:

See Also

  • To provide gradient/derivative-free optimization algorithms including algorithms that are able to handle noise.
  • To provide tools to instrument any code
  • To provide functions on which to test the optimization algorithms
  • To provide benchmark routines in order to compare algorithms easily

There are also some other features, which are mentioned below:

  • Optimization: It helps in implementing optimization algorithms
  • Instrumentation: It helps in tooling in order to convert code into a well-defined function to optimize
  • Functions: It helps in implementing both simple and complex benchmark functions
  • Benchmark: It helps for running the experiments comparing the algorithms on benchmark functions
  • Common: This is a set of tools available throughout the package


  • The open-sourced Python3 toolkit can be used in machine learning to tune the hyper-parameters such as momentum, weight decay, dropout, layer parameters, etc. for each part of the deep network, or others
  • It can also be used in power grid management, aeronautics, and many other scientific and engineering applications

Similar Toolkits


This open-sourced Python tool for derivative-free optimization is a mathematical technique which is used for simulation-based optimization. The optimization algorithms implemented in this tool relies on a surrogate model of the unknown performance measure. The algorithms are known as derivative-free because they basically do not require the computation of the performance measure, unlike traditional optimization algorithms.

Click here to get the code.


Zeroth-Order Optimisation (ZOOpt) provides an efficient derivative-free solver and can be easily used. This toolbox provides a Python package for single-thread optimization and a light-weighted distributed version with the help of Julia language for Python described functions. It mainly focuses on optimization problems in machine learning, addressing high-dimensional, noisy as well as large-scale problems. It does not rely on the gradient of the objective function, but instead, learns from samples of the search space.

Click here to get the code.

What Do You Think?

Join Our Telegram Group. Be part of an engaging online community. Join Here.

Subscribe to our Newsletter

Get the latest updates and relevant offers by sharing your email.

Copyright Analytics India Magazine Pvt Ltd

Scroll To Top