Skip to main content

No project description provided

Project description

Replay Memory

Simple replay memory data structure implemented using a ring buffer in Rust. Intended to be used for reinforcement learning.

Installation

pip install replay_memory

Usage

>>> import replay_memory
>>> rm = replay_memory.ReplayMemory(10)  # set capacity to 10
>>> rm.push_items(range(21))
>>> rm[0]  # show has overwritten oldest data
20
>>> len(rm)  # length unchanged
10
>>> rm.sample(3)  # get a randomly selected sample of 3 items
[20, 18, 11]
>>> rm.sample(3)
[12, 18, 16]

Development

Package is written in rust using PyO3 and maturin.

Unit tests

Rust unit tests can be run as below:

cargo test --no-default-features

Python unit tests are run using tox:

tox

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

replay_memory-0.2.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

replay_memory-0.2.0-cp36-abi3-manylinux_2_28_x86_64.whl (205.3 kB view details)

Uploaded CPython 3.6+ manylinux: glibc 2.28+ x86-64

replay_memory-0.2.0-cp36-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (481.9 kB view details)

Uploaded CPython 3.6+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

File details

Details for the file replay_memory-0.2.0.tar.gz.

File metadata

  • Download URL: replay_memory-0.2.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.6

File hashes

Hashes for replay_memory-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d59c693405278fba0e8bebf5f657458e38d9a9451ae6c19ee3479fe10ddc45d8
MD5 e88b0c154a1599c4b94faaa25aef3f90
BLAKE2b-256 9609eb6cc4c5f6f13ed68793a70588a10e8a8722163dacbe676f7566b90ce790

See more details on using hashes here.

File details

Details for the file replay_memory-0.2.0-cp36-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for replay_memory-0.2.0-cp36-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d9bf8da4c36836d9267bce6fdbf2219c0c4b7c9dc54fd35fcfab4bae84b63f91
MD5 625799f85108c237591580cf35e552c0
BLAKE2b-256 f6a288d38471c33db80406480e765285c7e27631ab55e8ad7fe65dcf3e29ca44

See more details on using hashes here.

File details

Details for the file replay_memory-0.2.0-cp36-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for replay_memory-0.2.0-cp36-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ac220217f8fc69681bb382711847ec8031fcd81278d09e23e4d959797dfdbd97
MD5 4d90ffc1a58cc9445297b61091276bfc
BLAKE2b-256 9ff7e006d672b7783525ae08932a0dbaa8e6bcad2a4b7564362a5c00bd2c97b6

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