Skip to main content

Multi-iteration Stochastic Estimator

Project description

Multi-iteration Stochastic Estimator

The Multi-Iteration stochastiC Estimator (MICE) is an estimator of gradients to be used in stochastic optimization. It uses control variates to build a hierarchy of iterations, adaptively sampling to keep the statistical variance below tolerance in an optimal fashion, cost-wise. The tolerance on the statistical error decreases proportionally to the square of the gradient norm, thus, SGD-MICE converges linearly in strongly convex L-smooth functions.

This python implementation of MICE is able to

  • estimate expectations or finite sums of gradients of functions;

  • choose the optimal sample sizes in order to minimize the sampling cost;

  • build a hierarchy of iterations that minimizes the total work;

  • use a resampling technique to compute the gradient norm, thus enforcing stability;

  • define a tolerance on the norm of the gradient estimate or a maximum number of evaluations as a stopping criterion.

Using MICE

Using MICE is as simple as

>>> import numpy as np
>>> from mice import MICE
>>>
>>>
>>> def gradient(x, thts):
>>>     return x - thts
>>>
>>>
>>> def sampler(n):
>>>     return np.random.random((n, 1))
>>>
>>>
>>> df = MICE(gradient , sampler=sampler)
>>> x = 10
>>> for i in range(10):
...    grad = df(x)
...    x = x - grad

However, it is flexible enough to tackle more complex problems. For more information on how to use MICE and examples, check the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mice-0.1.14.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mice-0.1.14-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file mice-0.1.14.tar.gz.

File metadata

  • Download URL: mice-0.1.14.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

File hashes

Hashes for mice-0.1.14.tar.gz
Algorithm Hash digest
SHA256 36f0255d65e1b256fb601d00632ac5360c03d645addde8a08e7c58e408580007
MD5 a2deb62ebb2a3654c0617dec91226d99
BLAKE2b-256 5ba81c6e8783b19fdf34bdd3b8e77805d9d253375f8d9851a2e6a4febf2bbbb3

See more details on using hashes here.

File details

Details for the file mice-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: mice-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10

File hashes

Hashes for mice-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 935b9e0af46302beaed3dd9b91bcc68fb6fa050cc226d2454aa063d816a32bb6
MD5 134da3f068b1cd2d34389b1d71e1628c
BLAKE2b-256 16c286adf5ade3aa836400b9c564b156e1af9145f33bf76de2a12945760726a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page