idinn

idinn: A Python Package for Inventory-Dynamics Control with Neural Networks - Published in JOSS (2025)

https://gitlab.com/ComputationalScience/idinn

Science Score: 87.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software
Last synced: 4 months ago · JSON representation

Repository

Inventory dynamics–informed neural networks for solving single-sourcing and dual-sourcing problems.

Basic Info
  • Host: gitlab.com
  • Owner: ComputationalScience
  • License: mit
  • Default Branch: main
Statistics
  • Stars: 0
  • Forks: 0
  • Open Issues: 2
  • Releases: 0
Created over 4 years ago

https://gitlab.com/ComputationalScience/idinn/blob/main/

# 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)

[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`

* Bttcher, 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 Bttcher, 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 Bttcher](https://gitlab.com/lucasboettcher)

Owner

  • Name: ComputationalScience
  • Login: ComputationalScience
  • Kind: organization

JOSS Publication

idinn: A Python Package for Inventory-Dynamics Control with Neural Networks
Published
August 21, 2025
Volume 10, Issue 112, Page 8508
Authors
Jiawei Li ORCID
Department of Computational Science and Philosophy, Frankfurt School of Finance and Management
Thomas Asikis ORCID
Game Theory, University of Zurich
Ioannis Fragkos ORCID
Department of Technology and Operations Management, Rotterdam School of Management, Erasmus University Rotterdam
Lucas Böttcher ORCID
Department of Computational Science and Philosophy, Frankfurt School of Finance and Management, Laboratory for Systems Medicine, Department of Medicine, University of Florida
Editor
Evan Spotte-Smith ORCID
Tags
PyTorch artificial neural networks inventory dynamics optimization control dynamic programming

Issues and Pull Requests

Last synced: 4 months ago

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 159 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 1
pypi.org: idinn

Inventory dynamics–informed neural networks and other related controllers for solving single-sourcing and dual-sourcing problems.

  • Homepage: https://gitlab.com/ComputationalScience/idinn
  • Documentation: https://inventory-optimization.readthedocs.io
  • 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.
  • Latest release: 0.2.0
    published 9 months ago
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 159 Last month
Rankings
Dependent packages count: 9.7%
Average: 36.8%
Dependent repos count: 63.9%
Maintainers (1)
Last synced: 4 months ago