mice


Namemice JSON
Version 0.1.31 PyPI version JSON
download
home_pagehttps://bitbucket.org/agcarlon/mice
SummaryMulti-iteration Stochastic Estimator
upload_time2024-05-27 09:51:21
maintainerNone
docs_urlNone
authorAndre Gustavo Carlon
requires_pythonNone
licenseGPLv3
keywords stochastic optimization hierarchical methods monte carlo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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.

.. _Multi-Iteration stochastiC Estimator: https://arxiv.org/abs/2011.01718

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`_.

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://bitbucket.org/agcarlon/mice",
    "name": "mice",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "stochastic optimization, hierarchical methods, Monte Carlo",
    "author": "Andre Gustavo Carlon",
    "author_email": "agcarlon@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/10/78/71086b7529077859321d44ed5252a1d5dc52624d753399dee395e2b43f9c/mice-0.1.31.tar.gz",
    "platform": null,
    "description": "Multi-iteration Stochastic Estimator\n------------------------------------\n\nThe `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.\n\n.. _Multi-Iteration stochastiC Estimator: https://arxiv.org/abs/2011.01718\n\nThis python implementation of MICE is able to\n\n* estimate expectations or finite sums of gradients of functions;\n\n* choose the optimal sample sizes in order to minimize the sampling cost;\n\n* build a hierarchy of iterations that minimizes the total work;\n\n* use a resampling technique to compute the gradient norm, thus enforcing stability;\n\n* define a tolerance on the norm of the gradient estimate or a maximum number of evaluations as a stopping criterion.\n\nUsing MICE\n----------\n\nUsing MICE is as simple as\n\n    >>> import numpy as np\n    >>> from mice import MICE\n    >>>\n    >>>\n    >>> def gradient(x, thts):\n    >>>     return x - thts\n    >>>\n    >>>\n    >>> def sampler(n):\n    >>>     return np.random.random((n, 1))\n    >>>\n    >>>\n    >>> df = MICE(gradient , sampler=sampler)\n    >>> x = 10\n    >>> for i in range(10):\n    ...    grad = df(x)\n    ...    x = x - grad\n\n\nHowever, it is flexible enough to tackle more complex problems.\nFor more information on how to use MICE and examples, check the `documentation`_.\n\n.. _documentation: https://mice.readthedocs.io\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Multi-iteration Stochastic Estimator",
    "version": "0.1.31",
    "project_urls": {
        "Documentation": "https://mice.readthedocs.io/",
        "Homepage": "https://bitbucket.org/agcarlon/mice",
        "Manuscript": "https://arxiv.org/abs/2011.01718",
        "Source": "https://bitbucket.org/agcarlon/mice"
    },
    "split_keywords": [
        "stochastic optimization",
        " hierarchical methods",
        " monte carlo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d8df872b9c2c253303abc9686309aa24aaf7864fc2d6fb257d37681a2377ae4",
                "md5": "19bfb81baaeb0e88dc9365f84d6f3c08",
                "sha256": "90c3e8c3716aee8bfec9f8f71fdadbc7e692168064984bda5f4d45690cff157a"
            },
            "downloads": -1,
            "filename": "mice-0.1.31-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "19bfb81baaeb0e88dc9365f84d6f3c08",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 26187,
            "upload_time": "2024-05-27T09:51:18",
            "upload_time_iso_8601": "2024-05-27T09:51:18.189536Z",
            "url": "https://files.pythonhosted.org/packages/1d/8d/f872b9c2c253303abc9686309aa24aaf7864fc2d6fb257d37681a2377ae4/mice-0.1.31-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "107871086b7529077859321d44ed5252a1d5dc52624d753399dee395e2b43f9c",
                "md5": "bf846bf24bad965c2f91463e8c0d9003",
                "sha256": "10a747481e129f2369017df068bb371c109997501ee2df41e4b9f25cd6eab4e5"
            },
            "downloads": -1,
            "filename": "mice-0.1.31.tar.gz",
            "has_sig": false,
            "md5_digest": "bf846bf24bad965c2f91463e8c0d9003",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 899084,
            "upload_time": "2024-05-27T09:51:21",
            "upload_time_iso_8601": "2024-05-27T09:51:21.096739Z",
            "url": "https://files.pythonhosted.org/packages/10/78/71086b7529077859321d44ed5252a1d5dc52624d753399dee395e2b43f9c/mice-0.1.31.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-27 09:51:21",
    "github": false,
    "gitlab": false,
    "bitbucket": true,
    "codeberg": false,
    "bitbucket_user": "agcarlon",
    "bitbucket_project": "mice",
    "lcname": "mice"
}
        
Elapsed time: 0.27491s