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 dobjf(x, thts):
>>>     return x - thts
>>>
>>>
>>> def sampler(n):
>>>     return np.random.random((n, 1))
>>>
>>>
>>> df = MICE(dobjf , 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, check the documentation_.

.. _documentation: https://mice.readthedocs.io/

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.6.tar.gz (204.7 kB view details)

Uploaded Source

Built Distributions

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

mice-0.1.6-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

mice-0.1.6-1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mice-0.1.6.tar.gz
  • Upload date:
  • Size: 204.7 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.6.tar.gz
Algorithm Hash digest
SHA256 0f18e3eabb906abbbafb6add1220a55ecdcf280f4573d186405d12d424f678bc
MD5 f78c033147525b398d6f0428618e4d22
BLAKE2b-256 23d366ed3e81194fd4bae86a062d5c9944e7e012a5703cfb9caad651c7b1a16d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mice-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 24.1 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f8e3aef8ff035616a3f1fee0dbdd98868a54b966b2e4c91bb6e2f2ebed3c7490
MD5 4157cf1c7f3a56acdf43c34b289f106b
BLAKE2b-256 84eeb068fec289a38d6c8a1db314d9c8519ba377f7990864910434acb4ab78bf

See more details on using hashes here.

File details

Details for the file mice-0.1.6-1-py3-none-any.whl.

File metadata

  • Download URL: mice-0.1.6-1-py3-none-any.whl
  • Upload date:
  • Size: 24.1 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.6-1-py3-none-any.whl
Algorithm Hash digest
SHA256 12bf959062bf9f49cf8b0807a4434c27229388f2cf10456e9df71072eaaf0eae
MD5 becf5f8b20131553233871f6189be46b
BLAKE2b-256 5008040f1928cadfae11f19faf63c5cdee3e835edbe33a1c515b55a4c927bd9d

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