AutoGL - A Library For Automated Graph Learning
360DigiTMG
We don’t just train, we transform by making a POSITIVE impact on your CAREER!
INTRODUCTION
Imagine a world where the complexities of graph learning are tamed, where analyzing and understanding intricate networks becomes a breeze. Welcome to the realm of AutoGL, a groundbreaking framework designed to automate and simplify the process of graph learning. Graphs are ubiquitous, appearing in various domains such as social networks, biological systems, recommendation engines, and knowledge graphs. However, extracting valuable insights from these complex interconnected structures has traditionally been a challenging endeavor. Enter AutoGL, the game-changer that revolutionizes the way we approach graph learning.
AutoGL stands for "Auto Graph Learning," and it embodies the fusion of cutting-edge techniques from machine learning and graph analytics. With AutoGL, you no longer need to struggle with hand-crafting intricate graph algorithms or navigating through a maze of parameter tuning. Instead, you can harness the power of automation and let AutoGL take the wheel.
?At its core, AutoGL leverages the power of artificial intelligence to streamline the entire graph learning pipeline. It intelligently automates crucial tasks such as data preprocessing, feature extraction, model selection, and hyperparameter tuning. By doing so, it relieves you of the burden of manual and time-consuming trial-and-error processes, allowing you to focus on the insights and discoveries hidden within your graphs.?
?Moreover, AutoGL is not just a black box solution. It empowers you to fine-tune and customize your graph learning journey. With its flexible configuration options, you can tailor the automated pipeline to suit your specific needs and domain expertise. This combination of automation and flexibility empowers you to strike the perfect balance between efficiency and control. Whether you are an academic researcher exploring complex network dynamics or an industry professional seeking actionable insights from your business graphs, AutoGL is your trusted companion. It unlocks the true potential of graph learning, making it accessible, efficient, and even enjoyable.?
So, step into the world of AutoGL and witness the revolution it brings to graph learning. Embrace the power of automation, unleash your creativity, and embark on a journey where the complexities of graph analysis are transformed into valuable knowledge and meaningful discoveries. With AutoGL, the future of graph learning is within your grasp.
WORKFLOW:?
The workflow below shows the overall framework of AutoGL.
Datasets for graph-based machine learning are maintained by AutoGL using AutoGL Dataset, which is based on the dataset in PyTorch Geometric or Deep Graph Library with some corporate support added using the auto solver framework.
By utilising four main parts, AutoGL Solvers are created to solve diverse graph-based machine learning tasks. These modules include Auto Model, Neural Architecture Search, Hyperparameter Optimisation, and Auto Feature Engineer. The output of various models is also combined using the Auto Ensemble module. Users can concentrate on the high-level problem details rather than the implementation details because each module is responsible for automatically addressing various aspects of a particular assignment.
The tasks in AutoGL are resolved by matching solvers, who typically carry out the following activities: processing and engineering the features
Neural architecture search is a crucial component of AutoGL Solvers, as it enables users to identify the best model architectures for their given tasks. This is achieved through the use of the "nas" module, which provides several search spaces, algorithms, and estimators for identifying optimal architectures. AutoGL Solvers are designed to automate the neural architecture search process, allowing users to focus on the problem definition rather than the implementation details. With the help of AutoGL Solvers, users can easily find the best suitable model architectures for their graph-based machine learning tasks.
The user's ability to automatically train and fine-tune popular models is a plus. The auto model and hyperparameter optimisation modules carry out this. Several well-known graph deep models and their related hyperparameter spaces are provided by Auto Model. Users can adjust these models to find the best hyperparameters for the task at hand by utilising the Hyperparameter Optimisation module.
To ensemble models found and trained in the previous stage, determine the optimum approach. The auto ensemble module carries out this function. Here, the appropriate models are combined to create a more potent learner.
________________________________________________________________
INSTALLATION : ?
Requirements: Please make sure you meet the following requirements before installing AutoGL.
Install from pip & conda
Run the following command to install this package through pip.
pip install autogl
The process flow in AutoGL generally involves the following steps:
Data preprocessing: This step involves preparing the data for use in the deep neural network. This could include tasks like resizing images, normalizing data, and splitting the data into training and validation sets.?
Network architecture selection: In this step, the user selects the type of network architecture to use for the task. AutoGL provides a range of pre-defined network architectures, but users can also create their custom architectures if needed.?
Hyperparameter tuning: After selecting the network architecture, the user needs to tune the hyperparameters of the network to optimize its performance. AutoGL provides several algorithms that automate this process to some extent, but users can also manually experiment with different hyperparameters if desired.?
Model training: Once the data has been preprocessed, the network architecture has been selected, and the hyperparameters have been tuned, the model is trained on the training data. AutoGL provides a user-friendly API for this step, which allows users to quickly train the model for a specified number of epochs.
Here's some sample code to get you started:
AUTOGL LEARNING:?
Autograph learning, which is based on the AutoML concept, seeks to automatically solve problems with data represented by graphs. Autograph learning, like AutoML, does not require humans inside the trial loop, in contrast to conventional learning frameworks. The AutoGL solver simply needs the datasets and jobs. This framework will do the searching for you when it comes to appropriate methods and hyperparameters.
Our suggested auto graph learning system is structured as follows to achieve the goal of autoML. To preserve the user-provided graph datasets, we have a dataset. It is necessary to construct a solver object in order to specify the target tasks. There are five submodules inside the solver that work together to help users achieve the autograph tasks: auto feature engineer, auto model, neural architecture search, hyperparameter optimisation, and auto ensemble.
Let’s say you want to conduct autograph learning on the Cora dataset. First, you can easily get the Cora dataset using the dataset module:
The dataset will be automatically downloaded for you.?
Please refer to AutoGL Dataset or autogl.datasets for more details of dataset constructions, available datasets, add local datasets, etc.
After deriving the dataset, you can build a node classification solver to handle auto training process:
In this way, we build a node classification solver, which will use deepgl as its feature engineer, and use anneal hyperparameter optimizer to optimise the given three models ['gcn','gat']. The derived models will then be assembled using voting ensembles.?
Then, you can fit the solver and then check the leaderboard:
To ensure that the entire signing process doesn't take longer than an hour, the time restriction is set at 3600. The models that the solver maintains will be displayed along with their performances on the validation dataset via the function solver. show().
Then, you can make the predictions and evaluate the results using the evaluation functions provided:
NOTE CLASSIFICATION FOR HETEROGENEOUS GRAPH
How to use AutoGL to automate the learning of heterogeneous graphs in Deep Graph Library (DGL).
Creating a Heterogeneous Graph
We provide two pre-built datasets called "hetero-acm-han" and "hetero-acm-hgt" for the HAN and HGT models, respectively. AutoGL Solvers support datasets that are constructed in DGL. The following code snippet shows how to load a heterogeneous graph and can be used to load these datasets.
You can also access to data stored in the dataset object for more details:
AUTOGL DATASET
Access to a number of popular datasets, including those based on PyTorch-Geometric, Deep Graph Library, and OGB, is provided through AutoGL Solvers. Users can also make use of the GeneralStaticGraph abstraction, which is made for static both homogeneous and heterogeneous graphs.
A basic example to construct an instance of GeneralStaticGraph is shown as follows.
SUPPORTING DATASETS
The following benchmarks are now supported by AutoGL for various tasks:
Base type taxonomy is based on how features are transformed. The original features are combined with newly created ones via generators, or the old features are simply overwritten. Selectors aim to choose useful features and keep learning selecting techniques in the base itself rather than creating new features. While the graph focuses on feature engineering at the graph level (modification upon each graph feature), the first two types of bases can be utilised at the node or edge level (modification upon each node or edge feature). You might want to design a new object by inheriting one of them for your convenience while developing it further. Naturally, you can also directly inherit the BaseFeature.
AUTOGL FEATURE ENGINEERING?
We provide a series of node and graph feature engineers for you to compose within a feature engineering pipeline.
# 1. Choose a dataset.
from autogl.datasets import build_dataset_from_name
领英推荐
data = build_dataset_from_name('cora')
# 2. Compose a feature engineering pipeline
from autogl.module.feature._base_feature_engineer._base_feature_engineer import _ComposedFeatureEngineer
from autogl.module.feature import EigenFeatureGenerator
from autogl.module.feature import NetLSD
# you may compose feature engineering bases through autogl.module.feature._base_feature_engineer
fe = _ComposedFeatureEngineer([
??EigenFeatureGenerator(size=32),
??NetLSD()
])
# 3. Fit and transform the data
fe.fit(data)
data1=fe.transform(data,inplace=False)
Generators, selectors, and graphs are the three types of feature engineering bases that AutoGL Solvers offer. These bases can be specified by users in setups or as solver parameters to build unique feature engineering pipelines. Additionally, when configuring the Auto Feature Engineer module, a list of base names is accessible for reference.
generators selectors graph
A technique for creating graph features is NetLSD. Refer to the document, please.
Please refer to NetworkX for further information on a set of wrapped graph feature extractors.?
Base type taxonomy is based on how features are transformed. The original features are combined with newly created ones via generators, or the old features are simply overwritten. Selectors attempt to choose valuable features and continuously learn rather than creating new ones.
A set of graph feature extractors implemented in NetworkX are wrapped, please refer to NetworkX for details.?
Base type taxonomy is based on how features are transformed. The original features are combined with newly created ones via generators, or the old features are simply overwritten. Selectors aim to choose useful features and keep learning selecting techniques in the base itself rather than creating new features. While the graph focuses on feature engineering at the graph level (modification upon each graph feature), the first two types of bases can be utilised at the node or edge level (modification upon each node or edge feature). You might?want to design a new object by inheriting one of them for your convenience while developing it further. Naturally, you can also directly inherit the BaseFeature.
Create Your Own FE
You can create your own feature engineering object by simply inheriting one of feature engineering base types ,namely generators, selectors , graph, and overloading methods extract_xx_features.
# for example : create a node one-hot feature.
AUTOGL MODEL?
In AutoGL, we use model and automodel to define the logic of graph nerual networks and make it compatible with hyper parameter optimization. Currently we support the following models for given tasks.
LAZY INITIALIZATION?
In the current AutoGL pipeline, some important hyper-parameters related to the model cannot be set outside before the pipeline (e.g. input dimensions, which can only be calculated during running after feature engineering). Therefore, in an automodel, we use lazy initialization to initialise the core model. When the automodel initialization method __init__() is called with argument init be False, only (part of) the hyper-parameters will be set. The automodel will have its core model only after initialise() is explicitly called, which will be done automatically in solver and from_hyper_parameter(), after all the hyper-parameters are set properly.
DEFINE YOUR OWN MODEL AND AUTO MODEL
We highly recommend you to define both model and automodel, although you only need your automodel to communicate with solver and trainer. The model will be responsible for the parameters initialization and forward logic declaration, while the auto model will be responsible for the hyper-parameter definition and organisation.
AUTOGL TRAINER
The AutoGL project uses a trainer to handle the auto-training of tasks. Currently, we support the following tasks:
AUTOGL SSL TRAINER?
The AutoGL project uses a trainer to implement the graph self-supervised methods. Currently, we only support the GraphCL with semi-supervised downstream tasks:
dataset: the graph dataset used to be trained
keep_valid_result: if True, save the validation result after training. Only if keep_valid_result is True and after training, the method get_valid_score, get_valid_predict_proba and get_valid_predict could output meaningful results.
dataset: the graph dataset used to be predicted
mask: "train", "val" or "test", the dataset mask
dataset: the graph dataset used to be predicted
mask: "train", "val" or "test", the dataset mask
in_log_format: if in_log_format is True, the probability will be log format
dataset: the graph dataset used to be evaluated
mask: "train", "val" or "test", the dataset mask
feval: the evaluation method used in this function. If feval is None, it will use the feval given when initiate
return_major: if return_major is True, then return only consists of the major result.
AUTOGL SOLVER
A solver is used by the AutoGL project to manage task auto-solvation. At the moment, we assist with the pursuing tasks:
CONCLUSION?
In the ever-evolving landscape of data analysis, AutoGL emerges as a true game-changer, empowering us to unravel the mysteries hidden within complex networks. By harnessing the power of automation and intelligence, AutoGL has revolutionized the way we approach graph learning. Gone are the days of wrestling with intricate graph algorithms and tedious parameter tuning.
?AutoGL's intuitive interface and intelligent automation have liberated us from these challenges, allowing us to focus on what truly matters—the insights and discoveries waiting to be unveiled. AutoGL stands as a beacon of innovation, providing a seamless and user-centric experience. Its vast array of pre-implemented graph learning algorithms offers a treasure trove of possibilities, ranging from traditional methods to cutting-edge techniques. No matter your level of expertise, AutoGL empowers you to embark on a graph learning journey with confidence and curiosity. Moreover, AutoGL's flexibility is a testament to its user-oriented design. It recognizes the importance of customization and control, allowing you to shape the automated pipeline to suit your unique needs. With AutoGL as your trusty companion, you strike the perfect harmony between efficiency and personalization.
The impact of AutoGL extends far beyond academia's hallowed halls. It permeates industries, revolutionizing the way we derive value from graphs in fields such as social networks, biology, finance, and beyond. AutoGL's automation opens doors for researchers, analysts, and professionals alike, unlocking the potential for groundbreaking discoveries and actionable insights. In a world where graphs are omnipresent, AutoGL takes us on a journey of exploration and understanding.
?It breaks down barriers, transforming the daunting complexities of graph learning into a realm of accessible knowledge. AutoGL paints a future where the power of automation amplifies our capacity for discovery, propelling us toward a new era of data-driven innovation.