Tensor utilities, reinforcement learning, and more!
Project description
pyoneer
Tensor utilities, reinforcement learning, and more! Designed to make research easier with low-level abstractions for common operations.
Usage
For the top-level utilities, import like so:
import pyoneer as pynr
pynr.math.rescale(...)
For the larger sub-modules, such as reinforcement learning, we recommend:
import pyoneer.rl as pyrl
loss_fn = pyrl.losses.PolicyGradient(...)
In general, the Pyoneer API tries to adhere to the TensorFlow 2.0 API.
Examples
API
Activations (pynr.activations
)
pynr.activations.swish
Debugging (pynr.debugging
)
pynr.debugging.Stopwatch
Distributions (pynr.distributions
)
pynr.distributions.MultiCategorical
Initializers (pynr.initializers
)
pynr.initializers.SoftplusInverse
Layers (pynr.layers
)
pynr.layers.Swish
pynr.layers.OneHotEncoder
pynr.layers.AngleEncoder
Tensor Manipulation (pynr.manip
)
pynr.manip.flatten
pynr.manip.batched_index
pynr.manip.pad_or_truncate
pynr.manip.shift
Math (pynr.math
)
pynr.math.to_radians
pynr.math.to_degrees
pynr.math.to_cartesian
pynr.math.to_polar
pynr.math.RADIANS_TO_DEGREES
pynr.math.DEGREES_TO_RADIANS
pynr.math.isclose
pynr.math.safe_divide
pynr.math.rescale
pynr.math.normalize
pynr.math.denormalize
Metrics (pynr.metrics
)
pynr.metrics.mape
pynr.metrics.smape
pynr.metrics.MAPE
pynr.metrics.SMAPE
Moments (pynr.moments
)
pynr.moments.range_moments
pynr.moments.StaticMoments
pynr.moments.StreamingMoments
pynr.moments.ExponentialMovingMoments
Learning Rate Schedules (pynr.schedules
)
pynr.schedules.CyclicSchedule
Reinforcement Learning (pynr.rl
)
Utilities for reinforcement learning.
Losses (pynr.rl.losses
)
pynr.rl.losses.policy_gradient
pynr.rl.losses.policy_entropy
pynr.rl.losses.clipped_policy_gradient
pynr.rl.losses.PolicyGradient
pynr.rl.losses.PolicyEntropy
pynr.rl.losses.ClippedPolicyGradient
Targets (pynr.rl.targets
)
pynr.rl.targets.DiscountedReturns
pynr.rl.targets.GeneralizedAdvantages
Strategies (pynr.rl.strategies
)
pynr.rl.strategies.EpsilonGreedy
pynr.rl.strategies.Mode
pynr.rl.strategies.Sample
Wrappers (pynr.rl.wrappers
)
pynr.rl.wrappers.ObservationCoordinates
pynr.rl.wrappers.ObservationNormalization
pynr.rl.wrappers.Batch
pynr.rl.wrappers.BatchProcess
pynr.rl.wrappers.Process
Installation
There are a few options for installation:
-
(Recommended) Install with
pipenv
:pipenv install fomoro-pyoneer
-
Install locally for development with
pipenv
:git clone https://github.com/fomorians/pyoneer.git cd pyoneer pipenv install pipenv shell
Testing
There are a few options for testing:
-
Run all tests:
python -m unittest discover -bfp '*_test.py'
-
Run specific tests:
python -m pyoneer.math.logical_ops_test
Contributing
File an issue following the ISSUE_TEMPLATE
. If the issue discussion warrants implementation, then submit a pull request from a branch describing the feature. This will eventually get merged into master
after a few rounds of code review.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fomoro_pyoneer-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fc40f61f1c79f08fccd2396a7036c817843f9568527bb7dd87d5a98ca54d68e |
|
MD5 | f7527882b9ff32f96be344042abd051e |
|
BLAKE2b-256 | 0efd65f15d7599f3e15d97c1b465e4e436b299c3d57c04a83758ccd526d9b14f |