semvec/pypi-packages huggingface dataset:
noisyenv 0.1.1
Simple noisy environment augmentation for reinforcement learning

# `noisyenv`: Simple Noisy Environment Augmentation for Reinforcement Learning

This package contains a set of generic wrappers designed to augment RL environments with noise and encourage agent exploration and improve training data diversity which are applicable to a broad spectrum of RL algorithms and environments. For more details, please refer to our paper: https://arxiv.org/abs/2305.02882.

Note that this package has been developed for the new step and reset API introduced in [OpenAI Gym v26](https://github.com/openai/gym/releases/tag/0.26.2) and [Gymnasium v26](https://gymnasium.farama.org/content/migration-guide/). Use the `gymnasium.wrappers.EnvCompatibility` wrapper to update old environments for compatibility. 

## Installation

```shell
pip install noisyenv
```

## Usage

```python
import gymnasium as gym
from noisyenv.wrappers import RandomUniformScaleReward

base_env = gym.make("HalfCheetah-v2")
env = RandomUniformScaleReward(env=base_env, noise_rate=0.01, low=0.9, high=1.1)

# And just use as you would normally
observation, info = env.reset(seed=333)

for _ in range(100):
    action = env.action_space.sample()
    observation, reward, terminated, truncated, info = env.step(action)

    if terminated or truncated:
        observation, info = env.reset()
env.close()
```


## Citing noisyenv
If you use `noisyenv` in your work, please cite our paper:

```bibtex
@misc{khraishi2023simple,
      title={Simple Noisy Environment Augmentation for Reinforcement Learning}, 
      author={Raad Khraishi and Ramin Okhrati},
      year={2023},
      eprint={2305.02882},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}
```
berens-neat 0.1.2
A simple implementation of NEAT in Python
Requires Python: >=3.8

# NEAT
## Algorithm
This is a Python implementation of the **NeuroEvolution of Augmenting Topologies (NEAT)** algorithm described [here](https://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf).

**NEAT** is an evolutionary algorithm for reinforcement learning based on evolving neural networks. It provides a set of mutations that change connection weights and network topology, and preserves new mutations by dividing networks into species that are protected for a number of generations.

I stay  mostly faithful to the original paper. The one major change that I made (that stuck) is how I implement biases. The authors of the originial paper simply added an input pin with a value of 1 to their networks. I, on the other hand, give each node its own bias value.   

## Installation
```
pip install berens-neat
```
json-expand-o-matic 0.2.4
Expand a dict into a collection of subdirectories and json files or contract (un-expand) the output of expand() into a dict.
Keywords: json,jsonref

# JSON Expand-O-Matic

Expand a dict into a collection of subdirectories and json files or contract (un-expand) the output of expand() into a dict.

## Overview

Construct

    expandomatic = JsonExpandOMatic(path=data_path, logger=logger)

Expand -- become or make larger or more extensive.

    data = { ... }

    data_path = sys.argv[1] if len(sys.argv) > 1 else '.'

Create {data_path}/root.json and {data_path}/root/...

    expandomatic.expand(data)

Create {data_path}/foo.json and {data_path}/foo/...

    expandomatic.expand(foo, root_element='foo')

    Warning: expand() is destructive unless `preserve=True`

Contract -- decrease in size, number, or range.

    data = expandomatic.contract()

Or use jsonref

    import jsonref
    with open(f'{data_path}/root.json') as f:
        data = jsonref.load(f, base_uri=f'file://{os.path.abspath(data_path)}/')

## Quick Start

Setup wrapper scripts:

    ./wrapper.sh

Install for development:

    ./tox.sh

Do a thing:

    rm -rf output
    ./expand.sh output tests/testresources/actor-data.json 2>&1 | tee log.txt
    find output -type f | sort

Do another thing:

    rm -rf output
    ./expand.sh output tests/testresources/actor-data.json '[{"/root/actors/.*": ["/[^/]+/movies/.*"]}]' 2>&1 | tee log.txt
    find output -type f | sort

## Testing

Install & use tox:

    ./tox.sh

Update requirements.txt and dev-requirements.txt:

    ./tox.sh -e deps

Reformat the code to make it pretty:

    ./tox.sh -e fmt

Manually run the commands:

    ./wrapper.sh
    ./expand.sh output tests/testresources/actor-data.json
    ./contract.sh output | jq -S . > output.json
    ls -l output.json tests/testresources/actor-data.json
    cmp output.json <(jq -S . tests/testresources/actor-data.json)
timeblock 0.1.1
Time blocks of code using a context manager
Requires Python: >=3.10

# 🕐 timeblock

Helpful snippet for timing blocks, basically [contexttimer](https://github.com/brouberol/contexttimer) with a few tweaks / forked.

```bash
pip install timeblock==0.1.1
```

```python
from timeblock import Timer

with Timer() as timer:
    sleep(1)

print(timer.elapsed) # 1s

with Timer(output=True):
    sleep(1)

# logger.debug(f"Elapsed time: {timer.elapsed}"

with Timer("sleepy time", output=print):
    sleep(1)

# print("sleepy time took {:.3f} seconds".format(timer.elapsed))
```