Skip to main content

Suite of Gymnasium environments for optimizing breeding programs

Project description

BreedGym

Installation

Using pip:

pip install breedgym

From source:

git clone https://github.com/younik/breedgym
cd breedgym
pip install -e .

Quickstart

BreedGym environments implement the Gymnasium API, making it easy to use it with your preferred learning library.

import gymnasium as gym
import numpy as np

env = gym.make(
    "breedgym:BreedGym",
    genetic_map="path/to/genetic_map.txt",
    initial_population="path/to/geno.npy",
    num_generations=10
)
print("Observation space:", env.observation_space)
print("Action space:", env.action_space)

To test, you can use the sample data we provide here. In the case of the small sample data, we have 370 initial population members with 10k markers.

Observation space: Box(False, True, (370, 10000, 2), bool)
Action space: Sequence(Tuple(Discrete(370), Discrete(370)), stack=False)

After initializing the environment, we can interact with it as a standard Gymnasium environment:

initial_pop, info = env.reset()
tru = False
for gen_number in range(10):
    assert not tru
    act = env.action_space.sample()
    pop, rew, ter, tru, infos = env.step(np.asarray(act))

After 10 generations, we expect the environment to truncate, as we specified 10 generations horizon during environment initialization:

assert tru
print("Reward (GEBV mean):", rew)

The full list of environments can be found here.

Citing

@inproceedings{younis2023breeding,
  title={Breeding Programs Optimization with Reinforcement Learning},
  author={Younis, Omar G. and Corinzia, Luca and Athanasiadis, Ioannis N and Krause, Andreas and Buhmann, Joachim  and Turchetta, Matteo},
  booktitle={NeurIPS 2023 Workshop on Tackling Climate Change with Machine Learning},
  url={https://www.climatechange.ai/papers/neurips2023/93},
  year={2023}
}

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

breedgym-0.0.2a0.tar.gz (562.2 kB view details)

Uploaded Source

Built Distribution

breedgym-0.0.2a0-py3-none-any.whl (652.1 kB view details)

Uploaded Python 3

File details

Details for the file breedgym-0.0.2a0.tar.gz.

File metadata

  • Download URL: breedgym-0.0.2a0.tar.gz
  • Upload date:
  • Size: 562.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for breedgym-0.0.2a0.tar.gz
Algorithm Hash digest
SHA256 db16261de673c1fb68556f49e4feef892ad3b894d2363c7f6450dd3de722dbd2
MD5 1f5ec916e760ee5b794b8294d6e48c6c
BLAKE2b-256 2472ef5d12cb412e3004fc36a43dbcc9149c427e8c6eed8bc6c9499baa41bccc

See more details on using hashes here.

File details

Details for the file breedgym-0.0.2a0-py3-none-any.whl.

File metadata

  • Download URL: breedgym-0.0.2a0-py3-none-any.whl
  • Upload date:
  • Size: 652.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for breedgym-0.0.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 23faabaf12e0a376d3b98d538da11af1499afc79cef835d3951c3147f65f4895
MD5 9b5806283a0276d33dc508ef17587875
BLAKE2b-256 49358bd8c67219f860c1ceacc3d5238e9c382801778a474ffa1fa3c4efb19282

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page