Skip to content

jianshu93/graphembed-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

install with bioconda

graphembed-analysis

Repo for installing and analyzing results from graphembed crate

Install

prebuilt binaries for Linux

wget https://github.com/jianshu93/graphembed/releases/download/v0.1.2/graphembed_Linux_x86-64_v0.1.1.zip
unzip graphembed_Linux_x86-64_v0.1.1.zip
chmod a+x ./graphembed
./graphembed -h

### put this binary into you system/user path

If you have conda installed on Linux

conda install -c bioconda -c conda-forge graphembed

If you are macOS with homebrew installed

brew tap jianshu93/graphembed
brew update
brew install graphembed

Usage

### First download test data
wget https://github.com/jianshu93/graphembed/releases/download/v0.1.1/BlogCatalog.txt

## symetric graph
### embedding alone (no accuracy evaluation and benchmark)

#### sketching via nodesketch algorithm
graphembed --csv ./BlogCatalog.txt --symetric true embedding -o embed_output sketching --dim 128 --decay 0.3 --nbiter 5 --symetric

#### sketching via HOPE algorithm, only for small datasets (e.g., less than 10,000 nodes)
graphembed --csv ./BlogCatalog.txt --symetric true embedding -o embed_output hope rank --targetrank 128 --nbiter 5

### accuracy evaluation and benchmark via the validation subcommand
#### sketching
graphembed --csv ./BlogCatalog.txt --symetric true validation --nbpass 1  --skip 0.2 --centric sketching --symetric --dim 128 --decay 0.3 --nbiter 5
#### HOPE
graphembed --csv ./BlogCatalog.txt --symetric true validation --nbpass 1  --skip 0.2 --centric hope rank --targetrank 128 --nbiter 5



## asymetric graph (directed graph)
## download data
wget https://github.com/jianshu93/graphembed/releases/download/v0.1.1/wiki-Vote.txt

### embedding alone (no accuracy evaluation and benchmark)
#### sketching via nodesketch algorithm
graphembed --csv ./wiki-Vote.txt --symetric false embedding -o embed_output sketching --dim 128 --decay 0.3 --nbiter 5
#### sketching via HOPE algorithm, only for small datasets (e.g., less than 10,000 nodes)
graphembed --csv ./wiki-Vote.txt --symetric false embedding -o embed_output hope precision --epsil 0.1 --maxrank 5 --blockiter 3


### accuracy evaluation and benchmark via the validation subcommand
#### sketching
graphembed --csv ./wiki-Vote.txt --symetric false validation --nbpass 1  --skip 0.2 --centric sketching  --dim 128 --decay 0.3 --nbiter 5
#### HOPE
graphembed --csv ./wiki-Vote.txt --symetric false validation --nbpass 1  --skip 0.2 --centric hope precision --epsil 0.1 --maxrank 1000 --blockiter 3


## weighted graph (directed or not)

Benchmark analysis

  1. Install MongoDB Database Tools here: https://www.mongodb.com/docs/database-tools/installation/installation-linux/
### Use the copy in the release page
wget https://github.com/jianshu93/graphembed-analysis/releases/download/v0.0.1/mongodb-database-tools-rhel93-x86_64-100.10.0.tgz
tar -zxvf mongodb-database-tools-rhel93-x86_64-100.10.0.tgz
cd mongodb-database-tools-rhel93-x86_64-100.10.0/bin
chmod a+x ./*
### add to path
echo 'export PATH="'$PWD':$PATH"' >> ~/.bashrc
source ~/.bashrc
./bsondump --help

### for MacOS, simply install via homebrew
brew tap mongodb/brew
brew install mongodb-database-tools
  1. Run graphembed for your dataset
  2. Transfrom from BSON output file to JSON output format
bsondump --bsonFile=in.bson  --outFile=out.json

Performance note

By default, graphembed relies on Intel Math Kernel Library (intel-mkl-static feature) as the BLAS backend to make full use of x86 CPU performance on Linux machines. However, it is possible to use the open source OpenBLAS (openblas-static feature) as the BLAS backend. Our tests showed that OpenBLAS is slightly slower than Intel MKL on x86-64 Linux. On x86-64/Intel MacOS, OpenBLAS/Intel-MKL performance is significantly decreased compared to Linux but still supported (openblas-system/intel-mkl-system feature). We also provide the native BLAS framework support from MacOS called Accelerate Framework (macos-accelerate feature). On aarch64 MacOS (M1, M2, M3 and M4 series chips), only the OpenBLAS and Accelerate Framework backend is supported (macos-accelerate feature). Again, performance decreased for both compared to Linux.

References