idinn


Nameidinn JSON
Version 0.2.0.post1 PyPI version JSON
download
home_pageNone
SummaryInventory dynamics–informed neural networks and other related controllers for solving single-sourcing and dual-sourcing problems.
upload_time2025-09-01 07:49:55
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2021 Jiawei Li, Thomas Asikis, Ioannis Fragkos, and Lucas Boettcher Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords dynamic control neural networks
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # idinn: Inventory-Dynamics Control with Neural Networks

[![PyPI Latest Release](https://img.shields.io/pypi/v/idinn.svg)](https://pypi.org/project/idinn/)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1BAMiveGXmErIp10MK3V_SUJlDAXHAyaI)
[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://idinn-demo.streamlit.app)
[![status](https://joss.theoj.org/papers/224380be40f3be0b741a4ec711eac83b/status.svg)](https://joss.theoj.org/papers/224380be40f3be0b741a4ec711eac83b)

[<img src="https://gitlab.com/ComputationalScience/idinn/-/raw/main/docs/_static/youtube.png" align="center" width="60%" size="auto" alt="youtube">](https://www.youtube.com/watch?v=hUBfTWV6tWQ)

`idinn` implements **i**nventory **d**ynamics–**i**nformed **n**eural **n**etwork and other related controllers for solving single-sourcing and dual-sourcing problems. Neural network controllers and inventory dynamics are implemented into customizable objects using PyTorch as backend to enable users to find the optimal controllers for the user-specified inventory systems.

## Demo

For a quick demo, you can run our [Streamlit app](https://idinn-demo.streamlit.app/). The app allows you to interactively train and evaluate neural controllers for user-specified dual-sourcing systems. Alternatively, you may use our notebook in [Colab](https://colab.research.google.com/drive/1BAMiveGXmErIp10MK3V_SUJlDAXHAyaI).

## Installation

The package can be installed from PyPI. To do that, run

```
pip install idinn
```

Or, if you want to inspect the source code and edit locally, run

```
git clone https://gitlab.com/ComputationalScience/idinn.git
cd idinn
pip install -e .
```

## Example Usage

```python
import torch
from idinn.sourcing_model import SingleSourcingModel
from idinn.single_controller import SingleSourcingNeuralController
from idinn.demand import UniformDemand

# Initialize the sourcing model and the neural controller
sourcing_model = SingleSourcingModel(
    lead_time=0,
    holding_cost=5,
    shortage_cost=495,
    batch_size=32,
    init_inventory=10,
    demand_generator=UniformDemand(low=1, high=4),
)
controller = SingleSourcingNeuralController(
    hidden_layers=[2],
    activation=torch.nn.CELU(alpha=1)
)
# Train the neural controller
controller.fit(
    sourcing_model=sourcing_model,
    sourcing_periods=50,
    validation_sourcing_periods=1000,
    epochs=5000,
    seed=1,
)
# Simulate and plot the results
controller.plot(sourcing_model=sourcing_model, sourcing_periods=100)
# Calculate the optimal order quantity for applications
controller.predict(current_inventory=10)
```

## Documentation

See the official [documentation](https://inventory-optimization.readthedocs.io/en/latest/) for more information.

## Contribution

We welcome contributions of all kinds! To get started, please see our [contribution guide](CONTRIBUTING.md).

## Papers using `idinn`

* Böttcher, Lucas, Thomas Asikis, and Ioannis Fragkos. "Control of dual-sourcing inventory systems using recurrent neural networks." [INFORMS Journal on Computing](https://pubsonline.informs.org/doi/abs/10.1287/ijoc.2022.0136) 35.6 (2023): 1308-1328.
* Li, Jiawei, Thomas Asikis, Ioannis Fragkos, and Böttcher, Lucas. "idinn: A Python package for inventory-dynamics control with neural networks." [Journal of Open Source Software](https://joss.theoj.org/papers/10.21105/joss.08508#) 10.112 (2025): 8508.


```
@article{bottcher2023control,
  title={Control of dual-sourcing inventory systems using recurrent neural networks},
  author={B{\"o}ttcher, Lucas and Asikis, Thomas and Fragkos, Ioannis},
  journal={INFORMS Journal on Computing},
  volume={35},
  number={6},
  pages={1308--1328},
  year={2023}
}
```

```
@article{li2025, 
title = {idinn: A {P}ython package for inventory-dynamics control with neural networks}, 
author = {Li, Jiawei and Asikis, Thomas and Fragkos, Ioannis and B{\"o}ttcher, Lucas}, 
journal = {Journal of Open Source Software},
volume = {10}, 
number = {112}, 
pages = {8508}, 
year = {2025}
}
```

## Contributors

* [Jiawei Li](https://github.com/iewaij)
* [Thomas Asikis](https://gitlab.com/asikist)
* [Ioannis Fragkos](https://gitlab.com/ioannis.fragkos1)
* [Lucas Böttcher](https://gitlab.com/lucasboettcher)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "idinn",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "dynamic control, neural networks",
    "author": null,
    "author_email": "Jiawei Li <sud.concept0x@icloud.com>, Thomas Asikis <thomas.asikis@uzh.ch>, Ioannis Fragkos <fragkos@rsm.nl>, Lucas Boettcher <l.boettcher@fs.de>",
    "download_url": "https://files.pythonhosted.org/packages/c5/d6/42c9b4ae91839dabc9647b97b526e590fc0f0f1e67e5058e070065aa8187/idinn-0.2.0.post1.tar.gz",
    "platform": null,
    "description": "# idinn: Inventory-Dynamics Control with Neural Networks\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/idinn.svg)](https://pypi.org/project/idinn/)\n[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1BAMiveGXmErIp10MK3V_SUJlDAXHAyaI)\n[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://idinn-demo.streamlit.app)\n[![status](https://joss.theoj.org/papers/224380be40f3be0b741a4ec711eac83b/status.svg)](https://joss.theoj.org/papers/224380be40f3be0b741a4ec711eac83b)\n\n[<img src=\"https://gitlab.com/ComputationalScience/idinn/-/raw/main/docs/_static/youtube.png\" align=\"center\" width=\"60%\" size=\"auto\" alt=\"youtube\">](https://www.youtube.com/watch?v=hUBfTWV6tWQ)\n\n`idinn` implements **i**nventory **d**ynamics\u2013**i**nformed **n**eural **n**etwork and other related controllers for solving single-sourcing and dual-sourcing problems. Neural network controllers and inventory dynamics are implemented into customizable objects using PyTorch as backend to enable users to find the optimal controllers for the user-specified inventory systems.\n\n## Demo\n\nFor a quick demo, you can run our [Streamlit app](https://idinn-demo.streamlit.app/). The app allows you to interactively train and evaluate neural controllers for user-specified dual-sourcing systems. Alternatively, you may use our notebook in [Colab](https://colab.research.google.com/drive/1BAMiveGXmErIp10MK3V_SUJlDAXHAyaI).\n\n## Installation\n\nThe package can be installed from PyPI. To do that, run\n\n```\npip install idinn\n```\n\nOr, if you want to inspect the source code and edit locally, run\n\n```\ngit clone https://gitlab.com/ComputationalScience/idinn.git\ncd idinn\npip install -e .\n```\n\n## Example Usage\n\n```python\nimport torch\nfrom idinn.sourcing_model import SingleSourcingModel\nfrom idinn.single_controller import SingleSourcingNeuralController\nfrom idinn.demand import UniformDemand\n\n# Initialize the sourcing model and the neural controller\nsourcing_model = SingleSourcingModel(\n    lead_time=0,\n    holding_cost=5,\n    shortage_cost=495,\n    batch_size=32,\n    init_inventory=10,\n    demand_generator=UniformDemand(low=1, high=4),\n)\ncontroller = SingleSourcingNeuralController(\n    hidden_layers=[2],\n    activation=torch.nn.CELU(alpha=1)\n)\n# Train the neural controller\ncontroller.fit(\n    sourcing_model=sourcing_model,\n    sourcing_periods=50,\n    validation_sourcing_periods=1000,\n    epochs=5000,\n    seed=1,\n)\n# Simulate and plot the results\ncontroller.plot(sourcing_model=sourcing_model, sourcing_periods=100)\n# Calculate the optimal order quantity for applications\ncontroller.predict(current_inventory=10)\n```\n\n## Documentation\n\nSee the official [documentation](https://inventory-optimization.readthedocs.io/en/latest/) for more information.\n\n## Contribution\n\nWe welcome contributions of all kinds! To get started, please see our [contribution guide](CONTRIBUTING.md).\n\n## Papers using `idinn`\n\n* B\u00f6ttcher, Lucas, Thomas Asikis, and Ioannis Fragkos. \"Control of dual-sourcing inventory systems using recurrent neural networks.\" [INFORMS Journal on Computing](https://pubsonline.informs.org/doi/abs/10.1287/ijoc.2022.0136) 35.6 (2023): 1308-1328.\n* Li, Jiawei, Thomas Asikis, Ioannis Fragkos, and B\u00f6ttcher, Lucas. \"idinn: A Python package for inventory-dynamics control with neural networks.\" [Journal of Open Source Software](https://joss.theoj.org/papers/10.21105/joss.08508#) 10.112 (2025): 8508.\n\n\n```\n@article{bottcher2023control,\n  title={Control of dual-sourcing inventory systems using recurrent neural networks},\n  author={B{\\\"o}ttcher, Lucas and Asikis, Thomas and Fragkos, Ioannis},\n  journal={INFORMS Journal on Computing},\n  volume={35},\n  number={6},\n  pages={1308--1328},\n  year={2023}\n}\n```\n\n```\n@article{li2025, \ntitle = {idinn: A {P}ython package for inventory-dynamics control with neural networks}, \nauthor = {Li, Jiawei and Asikis, Thomas and Fragkos, Ioannis and B{\\\"o}ttcher, Lucas}, \njournal = {Journal of Open Source Software},\nvolume = {10}, \nnumber = {112}, \npages = {8508}, \nyear = {2025}\n}\n```\n\n## Contributors\n\n* [Jiawei Li](https://github.com/iewaij)\n* [Thomas Asikis](https://gitlab.com/asikist)\n* [Ioannis Fragkos](https://gitlab.com/ioannis.fragkos1)\n* [Lucas B\u00f6ttcher](https://gitlab.com/lucasboettcher)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 Jiawei Li, Thomas Asikis, Ioannis Fragkos, and Lucas Boettcher  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Inventory dynamics\u2013informed neural networks and other related controllers for solving single-sourcing and dual-sourcing problems.",
    "version": "0.2.0.post1",
    "project_urls": {
        "Documentation": "https://inventory-optimization.readthedocs.io",
        "Homepage": "https://gitlab.com/ComputationalScience/idinn",
        "Issues": "https://gitlab.com/ComputationalScience/idinn/-/issues"
    },
    "split_keywords": [
        "dynamic control",
        " neural networks"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3f87c946c59aa701134c687a605fcb75c10e1b8bd4e654d4b1c43eca0900048c",
                "md5": "7a861edb6fd282851501766ca05f932c",
                "sha256": "c0405e3426fc9491fd3a3427290adef24625e23b2138189cd587293d9f092041"
            },
            "downloads": -1,
            "filename": "idinn-0.2.0.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7a861edb6fd282851501766ca05f932c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 26805,
            "upload_time": "2025-09-01T07:49:53",
            "upload_time_iso_8601": "2025-09-01T07:49:53.315095Z",
            "url": "https://files.pythonhosted.org/packages/3f/87/c946c59aa701134c687a605fcb75c10e1b8bd4e654d4b1c43eca0900048c/idinn-0.2.0.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c5d642c9b4ae91839dabc9647b97b526e590fc0f0f1e67e5058e070065aa8187",
                "md5": "6cdae6c681c657cec63a7440da54eeac",
                "sha256": "a99a59231923eb7dadb48aa084a2e388b13c15a373234f123c9407e3211d71e2"
            },
            "downloads": -1,
            "filename": "idinn-0.2.0.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "6cdae6c681c657cec63a7440da54eeac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 3985179,
            "upload_time": "2025-09-01T07:49:55",
            "upload_time_iso_8601": "2025-09-01T07:49:55.804914Z",
            "url": "https://files.pythonhosted.org/packages/c5/d6/42c9b4ae91839dabc9647b97b526e590fc0f0f1e67e5058e070065aa8187/idinn-0.2.0.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-01 07:49:55",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "ComputationalScience",
    "gitlab_project": "idinn",
    "lcname": "idinn"
}
        
Elapsed time: 1.59713s