No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
sslh Linearized BP for any pairwise MRF Feb 5, 2017
test Linearized BP for any pairwise MRF Feb 5, 2017
LICENSE.txt Initial import Sep 26, 2015 Initial import Sep 26, 2015
README.rst version log Feb 5, 2017
requirements.txt Initial import Sep 26, 2015
setup.cfg Initial import Sep 26, 2015 Initial import Sep 26, 2015


SSLH (Semi-Supervised Learning with Heterophily)

Home of SSLH on github:


This library implements efficient algorithms in linear algebra for solving various inference and estimation problems in networks with observed heteorphily between classes of nodes (Heterophily: "Opposites attract" vs. Homophily: "Birds of a feather flock together"). The technical framework is that of undirected graphical models (Markov Random Fields or Markov Networks). The key idea is that after applying certain linearization assumptions (that change the semantics) the resulting formulations allow several orders of magnitude speed-up in calculation.

The methods are described in detail in the following papers:

  1. Linearized and Single-Pass Belief Propagation. Wolfgang Gatterbauer, Stephan Günnemann, Danai Koutra, Christos Faloutsos. PVLDB 8(5): 581-592 (2015). [Paper (PDF)], [Full version (PDF)]
  2. Semi-Supervised Learning with Heterophily. Wolfgang Gatterbauer [Working paper (PDF)]

Usage & Documentation

The package consists of:

  1. A directory sslh that contains files with the main methods
  2. A directory test that contains the test files, each of which makes use of methods from the corresonding file in the sslh directory.

Thus ideally take a look in the test directory, run some files and look through the annotations in the files.


The latest version of SSLH can be installed from the master branch using pip:

pip install sslh


pip install git+

Another option is to clone the repository and install SSLH using python install or python develop.


SSLH is tested on Python 2.7 and depends on NumPy, SciPy, Sklearn, and PyAMG (see for version information).

Related initiatives

Sklearn: includes methods for semi-supervised learning (assuming homophily):

PyPGMc: focusing on directed graphical models

OpenGM: implementation in C++,


Copyright 2015 Wolfgang Gatterbauer

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Distributed in the hope that it will be useful to other researchers, however, unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. You may obtain a copy of the License at

Contact Me

Questions or comments about SSLH? Drop me an email at


Version 0.1.0

  • Initial Release: Main method 'linBP_undirected' for linearized belief propagation with one single doubly stochastic and symmetric potential as described in "Linearized and Single-pass Belief Propagation"

Version 0.2.0

  • Linearized BP for networks with one single aribtrary potentials as described in "Linearization for Pairwise MRFs."