semvec/pypi-packages huggingface dataset:
ReplayTables-andnp 6.2.0
A simple replay buffer implementation in python for sampling n-step trajectories
License: MIT
Requires Python: >=3.10,<3.12

# ReplayTables

[Benchmarks](https://andnp.github.io/ReplayTables/dev/bench/)

## Getting started

Installation:
```bash
pip install ReplayTables-andnp
```

Basic usage:
```python
from typing import NamedTuple
from ReplayTables.ReplayBuffer import ReplayBuffer

class Data(NamedTuple):
    x: np.ndarray
    a: np.ndarray
    r: np.ndarray

buffer = ReplayBuffer(
    max_size=100_000,
    structure=Data,
    rng=np.random.default_rng(0),
)

buffer.add(Data(x, a, r))

batch = buffer.sample(32)
print(batch.x.shape) # -> (32, d)
print(batch.a.shape) # -> (32, )
print(batch.r.shape) # -> (32, )
```

## Prioritized Replay
An implementation of prioritized experience replay from
> Schaul, Tom, et al. "Prioritized experience replay." ICLR (2016).

The defaults for this implementation strictly adhere to the defaults from the original work, though several configuration options are available.

```python
from typing import NamedTuple
from ReplayTables.PER import PERConfig, PrioritizedReplay

class Data(NamedTuple):
    a: float
    b: float

# all configurables are optional.
config = PERConfig(
    # can also use "mean" mode to place new samples in the middle of the distribution
    # or "given" mode, which requires giving the priority when the sample is added
    new_priority_mode='max',
    # the sampling distribution is a mixture between uniform sampling and the priority
    # distribution. This specifies the weight given to the uniform sampler.
    # Setting to 1 reverts this back to an inefficient form of standard uniform replay.
    uniform_probability=1e-3,
    # this implementation assume priorities are positive. Can scale priorities by raising to
    # some power. Default is `priority**(1/2)`
    priority_exponent=0.5,
    # if `new_priority_mode` is 'max', then the buffer tracks the highest seen priority.
    # this can cause accidental saturation if outlier priorities are observed. This provides
    # an exponential decay of the max in order to prevent permanent saturation.
    max_decay=1,
)

# if no config is given, defaults to original PER parameters
buffer = PrioritizedReplay(
    max_size=100_000,
    structure=Data,
    rng=np.random.default_rng(0),
    config=config,
)

buffer.add(Data(a=1, b=2))

# if `new_priority_mode` is 'given':
buffer.add(Data(a=1, b=2), priority=1.3)

batch = buffer.sample(32)
```
simmer 1.1.1
Stellar Image Maturation via Efficient Reduction
License: MIT
Requires Python: >=3.8
Keywords: astronomy

# SImMER
[![arXiv](https://img.shields.io/badge/arXiv-2212.00641-b31b1b.svg)](https://arxiv.org/abs/2212.00641)
 [![Tests](https://github.com/arjunsavel/SImMER/actions/workflows/run_tests.yml/badge.svg)](https://github.com/arjunsavel/SImMER/actions/workflows/run_tests.yml)
[![codecov](https://codecov.io/gh/arjunsavel/simmer/branch/main/graph/badge.svg?token=eMUOVt99Gh)](https://codecov.io/gh/arjunsavel/simmer) [![Maintainability](https://api.codeclimate.com/v1/badges/d1fa9d77e8fbcc96619a/maintainability)](https://codeclimate.com/github/arjunsavel/SImMER/maintainability) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://readthedocs.org/projects/simmer/badge/?version=latest)](http://simmer.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/simmer.svg)](https://badge.fury.io/py/simmer) [![Conda Version](https://img.shields.io/conda/v/conda-forge/simmer?color=g&label=conda-forge%20%20%20%20%20&logo=conda-forge)](https://anaconda.org/conda-forge/simmer) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Yaml Lint](https://github.com/arjunsavel/SImMER/actions/workflows/yaml.yml/badge.svg)](https://github.com/arjunsavel/SImMER/actions/workflows/yaml.yml)



Repository for developing the ```SImMER``` image reduction pipeline. If you'd like to help out, take a look at our [ways to contribute](https://github.com/arjunsavel/simmer/blob/main/CONTRIBUTING.md). If you use this package in your research, please cite [our paper](https://iopscience.iop.org/article/10.1088/1538-3873/aca4f9/meta?casa_token=GQzZtqAVVDAAAAAA:uyvTw9R2VIWITJcGAioptUSJFmGMFaj4kS61ZGKKRf2k97nHVv5libuIly2FFBR95Iiq0576P2t90Hw5KqyFYehRcbsx).

<p align="center">
  <img src="https://github.com/arjunsavel/SImMER/blob/main/docs/img/final_image.png" />
</p>


## Installation
To install with conda (the recommended method), run
```
conda config --add channels conda-forge
conda install simmer
```
To install with pip, run
```
pip install simmer
```
Or, to install from source, run
```
python3 -m pip install -U pip
python3 -m pip install -U setuptools setuptools_scm pep517
git clone https://github.com/arjunsavel/SImMER.git


cd simmer
python3 -m pip install -e .
```

## Documentation
To get started, read the docs at [our readthedocs site](https://simmer.readthedocs.io/en/latest/pages/about/).