Package: thegolem
Graph Optimization and Learning by Evolutionary MethodsGOLEM is an open-source AI framework for optimization and learning of structured graph-based models with meta-heuristic
methods. It is centered around 2 ideas:The potential of meta-heuristic methods in complex problem spaces.The focus on meta-heuristics allows approaching the kinds of problems where gradient-based learning methods (notably, neural networks)
can’t be easily applied, like optimization problems with multiple conflicting objectives or having a combinatorial nature.The importance of structured models in multiple problem domains.Graph-based learning enables solutions in the form of structured and hybrid probabilistic models, not to mention
that a wide range of domain-specific problems have a natural formulation in the form of graphs.Together this constitutes an approach to AI that potentially leads to structured, intuitive, interpretable methods and
solutions for a wide range of tasks.Core FeaturesStructuredmodels with joint optimization of graph structure and properties (node attributes).Metaheuristicmethods (mainly evolutionary) applicable to any task with a well-defined objective.Multi-objectiveoptimization that can take into account both quality and complexity.Constrainedoptimization with support for arbitrary domain-specific constraints.Extensibleto new domains.Interpretablethanks to meta-heuristics, structured models, and visualisation tools.Reproduciblethanks to rich optimization history and model serialization.ApplicationsGOLEM is potentially applicable to any optimization problem structures:that can be represented as directed graphs;that have some clearly defined fitness function on them.Graph models can represent fixed structures (e.g. physical models such as truss structures) or functional models that
define a data-flow or inference process (e.g. bayesian networks that can be fitted and queried).Examples of GOLEM applications:Automatic Machine Learning (AutoML) with optimal ML pipelines search inFEDOT frameworkBayesian network structure search inBAMT frameworkDifferential equation discovery for physical models inEPDE frameworkGeometric design of physical objects inGEFEST frameworkNeural architecture searchAs GOLEM is a general-purpose framework, it’s easy to imagine potential applications, for example, finite state automata search
for robotics control or molecular graph learning for drug discovery, and more.InstallationGOLEM can be installed withpip:$ pip install thegolemQuick Start ExampleFollowing example demonstrates graph search using reference graph & edit distance metric. Optimizer is set up with a minimal set of parameters and simple single-point mutations. For more details see examplessimple_run.py,graph_search.pyandtree_search.pyin directoryexamples/synthetic_graph_evolution.defrun_graph_search(size=16,timeout=8):# Generate target graph sought by optimizer using edit distance objectivenode_types=('a','b')# Available node types that can appear in graphstarget_graph=generate_labeled_graph('tree',size,node_types)objective=Objective(partial(tree_edit_dist,target_graph))initial_population=[generate_labeled_graph('tree',5,node_types)for_inrange(10)]# Setup optimization parametersrequirements=GraphRequirements(timeout=timedelta(minutes=timeout))gen_params=GraphGenerationParams(adapter=BaseNetworkxAdapter(),available_node_types=node_types)algo_params=GPAlgorithmParameters(pop_size=30)# Build and run the optimizeroptimiser=EvoGraphOptimizer(objective,initial_population,requirements,gen_params,algo_params)found_graphs=optimiser.optimise(objective)# Visualize resultsfound_graph=gen_params.adapter.restore(found_graphs[0])# Transform back to NetworkX graphdraw_graphs_subplots(target_graph,found_graph,titles=['Target Graph','Found Graph'])optimiser.history.show.fitness_line()returnfound_graphProject StructureThe repository includes the following packages and directories:Packagecorecontains the main classes and scripts.Packagecore.adapteris responsible for transformation between domain graphs and internal graph representation used by optimisers.Packagecore.dagcontains classes and algorithms for representation and processing of graphs.Packagecore.optimiserscontains graph optimisers and all related classes (like those representing fitness, individuals, populations, etc.), including optimization history.Packagecore.optimisers.geneticcontains genetic (also called evolutionary) graph optimiser and operators (mutation, selection, and so on).Packagecore.utilitiescontains utilities and data structures used by other modules.Packageserializerscontains classSerializerwith required facilities, and is responsible for serialization of project classes (graphs, optimization history, and everything related).Packagevisualisationcontains classes that allow to visualise optimization history, graphs, and certain plots useful for analysis.Packageexamplesincludes several use-cases where you can start to discover how the framework works.All unit and integration tests are contained in thetestdirectory.The sources of the documentation are in thedocsdirectory.Current R&D and future plansAny contribution is welcome. Our R&D team is open for cooperation with other scientific teams as well as with industrial partners.Contribution GuideThe contribution guide is available in therepository.AcknowledgmentsWe acknowledge the contributors for their important impact and the participants of the numerous scientific conferences and
workshops for their valuable advice and suggestions.Supported byThe study is supported by the ResearchCenter Strong Artificial Intelligence in IndustryofITMO Universityas part of the plan of the center’s program:
Development and testing of an experimental prototype of the library of strong AI algorithms
in terms of basic algorithms of automatic ML for structural training of composite AI models,
including automation of feature selectionContactsTelegram channelfor solving problems and answering questions about FEDOTNatural System Simulation TeamNikolay Nikitin, AutoML Lead (nnikitin@itmo.ru)NewsfeedYoutube channelCitationIf you use our project in your work or research, we would appreciate citations.@article{nikitin2021automated,title = {Automated evolutionary approach for the design of composite machine learning pipelines},
author = {Nikolay O. Nikitin and Pavel Vychuzhanin and Mikhail Sarafanov and Iana S. Polonskaia and Ilia Revin and Irina V. Barabanova and Gleb Maximov and Anna V. Kalyuzhnaya and Alexander Boukhanovsky},
journal = {Future Generation Computer Systems},
year = {2021},
issn = {0167-739X},
doi = {https://doi.org/10.1016/j.future.2021.08.022}}Papers that describe applications of GOLEM:There are various cases solved with GOLEM’s algorithms:Algorithms for time series forecasting pipeline design: Sarafanov M., Pokrovskii V., Nikitin N. O. Evolutionary Automated Machine Learning for Multi-Scale Decomposition and Forecasting of Sensor Time Series //2022 IEEE Congress on Evolutionary Computation (CEC). – IEEE, 2022. – С. 01-08.Algorithms for acoustic equation discovery: Hvatov A. Data-Driven Approach for the Floquet Propagator Inverse Problem Solution //ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). – IEEE, 2022. – С. 3813-3817.Algorithms for PDE discovery: Maslyaev M., Hvatov A. Solver-Based Fitness Function for the Data-Driven Evolutionary Discovery of Partial Differential Equations //2022 IEEE Congress on Evolutionary Computation (CEC). – IEEE, 2022. – С. 1-8.Algorithms for structural learning of Bayesian Networks: Deeva I., Kalyuzhnaya A. V., Alexander V. Boukhanovsky Adaptive Learning Algorithm for Bayesian Networks Based on Kernel Mixtures Distributions//International Journal of Artificial Intelligence. – 2023. - Т.21. - №. 1. - С. 90.