Skip to main content

idinn: Inventory-Dynamics Control with Neural Networks

PyPI Latest Release Open in Colab Open in Streamlit status

youtube

idinn implements inventory dynamics–informed neural network 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. 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.

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

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 for more information.

Contribution

We welcome contributions of all kinds! To get started, please see our contribution guide.

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

Metadata

Release files for idinn 0.2.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idinn 0.2.0.post1
File Size Uploaded Provenance Actions
idinn-0.2.0.post1.tar.gz 4.0 MB Without provenance Details for idinn-0.2.0.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for idinn 0.2.0.post1
File Interpreter ABI Platform Actions
idinn-0.2.0.post1-py3-none-any.whl Python 3 none any Details for idinn-0.2.0.post1-py3-none-any.whl

Total release size: 4.0 MB

Release files / idinn-0.2.0.post1.tar.gz

Download URL idinn-0.2.0.post1.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
a99a59231923eb7dadb48aa084a2e388b13c15a373234f123c9407e3211d71e2
BLAKE2b-256 checksum
How to use checksums
c5d642c9b4ae91839dabc9647b97b526e590fc0f0f1e67e5058e070065aa8187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Release files / idinn-0.2.0.post1-py3-none-any.whl

Download URL idinn-0.2.0.post1-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0405e3426fc9491fd3a3427290adef24625e23b2138189cd587293d9f092041
BLAKE2b-256 checksum
How to use checksums
3f87c946c59aa701134c687a605fcb75c10e1b8bd4e654d4b1c43eca0900048c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Security for idinn 0.2.0.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page