Skip to main content

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

Project description

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

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

idinn-0.2.0.post1.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

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

idinn-0.2.0.post1-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file idinn-0.2.0.post1.tar.gz.

File metadata

  • Download URL: idinn-0.2.0.post1.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for idinn-0.2.0.post1.tar.gz
Algorithm Hash digest
SHA256 a99a59231923eb7dadb48aa084a2e388b13c15a373234f123c9407e3211d71e2
MD5 6cdae6c681c657cec63a7440da54eeac
BLAKE2b-256 c5d642c9b4ae91839dabc9647b97b526e590fc0f0f1e67e5058e070065aa8187

See more details on using hashes here.

File details

Details for the file idinn-0.2.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for idinn-0.2.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 c0405e3426fc9491fd3a3427290adef24625e23b2138189cd587293d9f092041
MD5 7a861edb6fd282851501766ca05f932c
BLAKE2b-256 3f87c946c59aa701134c687a605fcb75c10e1b8bd4e654d4b1c43eca0900048c

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