Abstract
Reinforcement learning is increasingly finding success across domains where the problem can be represented as a Markov decision process. Evolutionary computation algorithms have also proven successful in this domain, exhibiting similar performance to the generally more complex reinforcement learning. Whilst there exist many open-source reinforcement learning and evolutionary computation libraries, no publicly available library combines the two approaches for enhanced comparison, cooperation, or visualization. To this end, we have created Pearl, an open source Python library designed to allow researchers to rapidly and conveniently perform optimized reinforcement learning, evolutionary computation and combinations of the two. The key features within Pearl include: modular and expandable components, opinionated module settings, Tensorboard integration, custom callbacks and comprehensive visualizations.
Introduction
In the field of adaptive decision-making, Reinforcement Learning (RL) and Evolutionary Computation (EC) are frequently treated as distinct silos. RL typically relies on gradient-based optimization within Markov Decision Processes, whereas EC utilizes population-based search strategies. The authors identify a significant gap in existing literature: a lack of libraries that integrate both paradigms. This fragmentation hinders fair comparisons, the development of hybrid algorithms, and the management of complexity in diverse agent types. Pearl addresses these challenges by providing a unified, modular framework built on PyTorch.
Architecture and Methods
Pearl is built upon a highly modular architecture, allowing agents to be composed of interchangeable components. This design facilitates rapid experimentation and extension.
Key architectural features include:
- Unified Base Class: RL, EC, and hybrid agents derive from a single base class, flattening the learning curve for researchers.
- Population-as-Matrix: Treating a population of neural networks as a single matrix allows Pearl to leverage PyTorch’s vectorized operations for efficient evolutionary updates.
- Dataclasses for Configuration: Pearl uses Python dataclasses to provide "opinionated" settings, ensuring IDE-friendly suggestions and reducing configuration errors.
- AdamES Algorithm: A standout contribution is AdamES, a novel hybrid algorithm that plugs the sample gradient approximation from Evolution Strategies (ES) into the Adam optimizer's update equations, adding momentum and dampening to evolutionary search.
Evaluation and Datasets
The library and the AdamES algorithm were evaluated using a diverse suite of benchmarks:
- Continuous Optimization: Classic "black-box" functions including Sphere, Matyas, Ackley, Beale, EggHolder, Himmelblau, Rastrigin, and Rosenbrock.
- OpenAI Gym: Specifically the Cartpole-v0 environment for demonstrating RL and EC comparison.
- Discrete Bit-Flipping: Used for testing Hindsight Experience Replay (HER) implementations.
Key Results
Empirical evaluations demonstrate the advantages of the Pearl framework and the AdamES algorithm.
Key findings include:
- AdamES Performance: AdamES achieved faster convergence compared to standard ES across multiple multidimensional functions.
- Stability: While exhibiting higher variance in KL divergence during steady-state, AdamES maintained a smaller expected divergence value, indicating more stable solutions near local optima.
- Tooling Efficiency: Pearl includes a CLI for generating publication-ready plots directly from Tensorboard logs, significantly reducing the manual labor of data visualization.
Conclusion and Future Work
Pearl provides a robust foundation for bridging RL and EC. Future work will focus on expanding model diversity to include Transformers, integrating advanced RL modules like the Intrinsic Curiosity Module (ICM), and further enhancing large-scale distributed computing capabilities.
Summary updated