The Realm of Supervised Learning

Preprocessing data using different techniques

Getting ready
1
2
3
4
import numpy as np
from sklearn import preprocessing

data = np.array([[3, -1.5, 2, -5.4], [0, 4, -0.3, 2.1], [1, 3.3, -1.9, -4.3]]) ~~~~
How to do it…
1
2
3
4
# Mean removal
data_standardized = preprocessing.scale(data)
print "\nMean =", data_standardized.mean(axis=0)
print "Std deviation =", data_standardized.std(axis=0)
  • python preprocessor.py

Mean = [ 5.55111512e-17 -1.11022302e-16 -7.40148683e-17 -7.40148683e-17]

Std deviation = [ 1. 1. 1. 1.]

1
2
3
4
# Scaling 
data_scaler = preprocessing.MinMaxScaler(feature_range=(0.1))
data_scaled = data_scaler.fit_transform(data)
print "\nMin max scaled data =", data_scaled
1
2
3
# Normalization
data_normalized = preprocessing.normalize(data, norm='l1')
print "\nL1 normalized data =", data_normalized
1
2
3
# Binarization
data_binarized = preprocessing.Binarizer(threshold=1.4).transform(data)
print "\nBinarized data =", data_binarized

>

1
2
3
4
5
# One Hot Encoding
encoder = preprocessing.OneHotEncoder()
encoder.fit([[0, 2, 1, 12], [1, 3, 5, 3], [2, 3, 2, 12],[1, 2, 4, 3]])
encoded_vector = encoder.transform([[2, 3, 5, 3]]).toarray()
print "\nEncoded vector =", encoded_vector

Label encoding

How to do it…
1
2
3
4
5
6
from sklearn import preprocessing
label_encoder = preprocessing.LabelEncoder()
input_classes = ['audi', 'ford', 'audi', 'toyota', 'ford', 'bmw']
label_encoder.fit(input_classes)
print "\nClass mapping:"
for i, item in enumerate(label_encoder.classes_): print item, '-->', i

>

1
labels =

Basics of Math and Graph

Linear Algebra

  • Scalar
  • Vector

  • The norm of a vector

  • The norm of a vector
  • The norm of a vector
  • The norm of a vector
  • The distance of two vectors
  • A set of vectors are linearly independent

not exist a set of scalars which are not all 0

  • Matrix

  • Matrix product

  • determinant

  • The inverse matrix

  • The transpose of matrix

  • The Hadamard product

  • Tensor: An array with arbitrary dimension

Probability theory

  • joint probability

  • conditional probability

  • The sum rule

  • The product rule

  • Bayes formula

  • The chain rule

  • The expectation of f(x)

  • The variance of f(x)

  • The standard deviation

  • Covariance

  • Gaussian distribution

  • Bernoulli distribution

  • Binomial distribution

  • Laplace distribution

Graph theory

  • Adjacency matrix

  • Degree matrix

  • Laplacian matrix

  • Symmetric normalized Laplacian

  • Random walk normalized Laplacian
  • Incidence matrix

For a directed graph

For a undirected graph

Graph Neural Networks - A Review of Methods and Applications

Abstract

Graph neural networks are neural models that capture the dependence of graphs via message passing between the nodes of graphs.

  • propose a general design pipeline for GNN models

  • discuss the variants of each component

  • systematically categorize the applications

  • propose four open problems for future research

Introduction

Graphs can be used across various areas

social networks

Graph Convolutional Networks with Markov Random Field Reasoning for Social Spammer Detection, 2020

natural science

Graph Networks as Learnable Physics Engines for Inference and Control, 2018

Interaction Networks for Learning about Objects, Relations and Physics, 2016

protein-protein interaction networks

Protein Interface Prediction using Graph Convolutional Networks, 2017

knowledge graphs

Knowledge Transfer for Out-of-Knowledge-Base Entities: A Graph Neural Network Approach, 2017

other research areas

Learning Combinatorial Optimization Algorithms over Graphs, 2017

The fundamental motivations of graph neural networks
several comprehensive reviews on graph neural networks

Geometric deep learning: going beyond Euclidean data, 2017
Graph convolutional networks: a comprehensive review, 2019

several surveys focusing on some specific graph learning fields
contributions
  • We provide a detailed review over existing graph neural network models. We present a general design pipeline and discuss the variants of each module. We also introduce researches on theoretical and empirical analyses of GNN models.

  • We systematically categorize the applications and divide the applications into structural scenarios and non-structural scenarios. We present several major applications and their corresponding methods for each scenario.

  • We propose four open problems for future research. We provide a thorough analysis of each problem and propose future research directions.

General design pipeline of GNNs

Find graph structure

structural scenarios
non-structural scenarios

Specify graph type and scale

Directed/Undirected Graphs

Homogeneous/Heterogeneous Graphs

Static/Dynamic Graphs

Design loss function

Node-level
Edge-level
Graph-level

Supervised setting
Semi-supervised setting
Unsupervised setting

Build model using computational modules

Propagation Module
Sampling Module
Pooling Module

The general design pipeline for a GNN

NDCN(Neural Dynamics on Complex Networks) combines ordinary differential equation systems (ODEs) and GNNs.

Instantiations of computational modules

An overview of computational modules

Propagation modules - convolution operator

The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains

  • Spectral approaches

the normalized graph Laplacian

A wavelet tour of signal processing

several typical spectral methods which design different filters

Spectral Network

Spectral Networks and Locally Connected Networks on Graphs

Deep Convolutional Networks on Graph-Structured Data

ChebNet

Wavelets on Graphs via Spectral Graph Theory

Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering

Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering

GCN

  • Basic spatial approaches
  • Attention-based spatial approaches
  • General frameworks for spatial approaches
Propagation modules - recurrent operator
Propagation modules - skip connection

Reference Paper
Graph Neural Networks: A Review of Methods and Applications, 2018

GNN Paper

Review

Model

Application

Image Formation

2D points

homogeneous vector

2D projective space

inhomogeneous vector

2D lines

homogeneous vector
line equation

Reference Book
Computer Vision: Algorithms and Applications by Richard Szeliski

Anaconda Command

Anaconda Prompt Operation

Create new environment

conda create - -name environment pakage

conda create - -name python3 python=3.8

Activate environment

conda activate environment

Exit environment

deactivate environment

Delete environment

conda remove -n environment - -all

Copy environment

conda create -n environment - -clone existing_environment

View environment information

conda info -e
conda env list
conda info - -envs

View python version

python -V

Install package

conda install package

View package information

conda search package

Install package in a specify environment

conda install -n environment package

Update package in a specify environment

conda update -n environment package

Delete package in a specify environment

conda remove -n environment package

View the installed packages in the current environment

conda list

View the installed packages in a specify environment

conda list -n environment