English | 简体中文
gml is a Python package that provides for Gradual Machine Learning
In order to support more and more applications of gradual machine learning and help researchers quickly complete model deployment and testing, this project aims to develop a general gradual machine learning platform. Gradual machine learning mainly includes three major steps: easy instance labeling, feature extraction and influence modeling, and gradual inference. According to the different steps of gradual machine learning, multiple unified algorithms are designed and implemented. Currently, several types of factor graphs such as single-factor non-parameterize, binary-factor non-parameterize, and single-factor parameterize are supported, and support factor graph parameter learning algorithm based on stochastic gradient descent and batch gradient descent
Before using this framework, you need to prepare your data according to the following Data structure description .
After preparing the data, you can use this framework as follows. First you need to prepare a configuration file example,and set some parameters
[para]
top_m = 2000
top_k = 10
top_n = 1
update_proportion = -1
optimization_threshold = -1
balance = False
learning_epoches = 500
inference_epoches = 500
learning_method = sgd
n_process = 1
out = False
Then, call GML as follows:
with open('variables.pkl', 'rb') as v:
variables = pickle.load(v)
with open('features.pkl', 'rb') as f:
features = pickle.load(f)
graph = GML.initial("alsa.config", variables, features)
graph.inference()
Here is an example you can refer.
Easy Instance Labeling
Influence Modeling
Gradual Inference
FAQ
We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions to the core, please first open an issue and discuss the feature with us