Welcome to MetaGen!
MetaGen is a Python scientific package designed to provide users with a comprehensive system for:
Solution representation
Methods to generate and modify solutions
A standard interface between metaheuristics and potential users
These features simplify the development of metaheuristics and make hyperparameter tuning more accessible in machine learning model production.
Figure 1 MetaGen’s architectural overview.
Key Design Principles
Abstraction: Separate problem definition from solution exploration
Flexibility: Support for diverse optimization strategies
Extensibility: Easy integration of custom algorithms and problem domains
Usability: Intuitive interfaces for developers and researchers
Use Cases
Machine Learning Hyperparameter Tuning
Deep Learning Architecture Optimization
Scientific Computational Problems
Engineering Design Optimization
User Profiles
MetaGen supports two primary user profiles:
Developer Profile
Implements metaheuristics using the
SolutionclassFollows the Development Use Case (DUC)
Simplifies algorithm development process
Makes metaheuristic implementation accessible to a broader audience
Solver Profile
Key Features
Intuitive Development: Lowers the barrier to creating new metaheuristics
Standardized Interface: Isolates developer from end-user complexities
Dynamic Optimization: Tools for adjusting deep learning architectures
Type Hints: Leverages Python’s typing for improved development experience
Flexible Problem Definition: Easy-to-use domain configuration
For more details, explore the Understanding MetaGen section.
Installation
using pip:
(.venv) $ pip install pymetagen-datalabupo
Quick Example
from metagen.framework import Domain
from metagen.metaheuristics import RandomSearch
# Define problem domain
domain = Domain()
domain.defineInteger('x', -10, 10)
domain.defineReal('y', -5, 5)
# Define fitness function
def fitness_function(solution):
x, y = solution['x'], solution['y']
return x**2 + y**2
# Run optimization
search = RandomSearch(domain, fitness_function)
best_solution = search.run()