Network representation learning technique using structure and attributes of information networks.
Go to file
dependabot[bot] 171b86fa89
Bump numpy from 1.11.2 to 1.22.0
Bumps [numpy](https://github.com/numpy/numpy) from 1.11.2 to 1.22.0.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/HOWTO_RELEASE.rst)
- [Commits](https://github.com/numpy/numpy/compare/v1.11.2...v1.22.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 02:35:09 +00:00
data Removed unnecessary file 2019-12-19 12:57:26 +05:30
src code to generate content graph implemented 2019-03-18 18:31:47 +05:30
.gitignore gitignore reverted 2019-12-19 12:34:36 +05:30
LICENSE commit working code for MIRand 2019-03-09 09:42:45 +05:30
README.md Update README.md 2020-07-28 14:34:01 +05:30
requirements.txt Bump numpy from 1.11.2 to 1.22.0 2022-06-22 02:35:09 +00:00

The mirand algorithm learns continuous representations for nodes in any (un)directed, (un)weighted graph. Paper accepted at ECAI-2020 (http://ecai2020.eu/papers/1648_paper.pdf)

Environment Set-up

Use python version 2.7

  • Clone the repository.
  • Navigate to the base directory of mirand (the download location)
  • Create a virtual environment using the following command:
    virtualenv venv
    (If virtualenv package is not installed, please install using pip)
  • Activate the environment using:
    source venv/bin/activate
  • Install required python modules to run the code.
    pip install -r requirements.txt

Congratulations!! You are now setup to run the code.

Basic Usage

Input

  • Look at the sample dataset cora (residing inside data directory). If you want to experiment on different datasets, create a folder with name of your dataset.
  • Two files are required to run and generate the embedding - edgelist file for structure graph and edgelist file for content graph
  • Naming convention for link structure layer: <dataset_name>_struc.edgelist
  • Naming convention for content/attribute layer: <dataset_name>_attr.edgelist

Example

To run mirand on cora network, execute the following command from src directory inside the project home path:
python main.py --input-struc ../data/cora/cora_struc.edgelist --input-attr ../data/cora/cora_attr.edgelist --output ../data/cora/cora.embed --dataset=cora --dimensions=128

Options

You can check out the other options available to use with mirand using:
python src/main.py --help

Input

The supported input format is an edgelist:

node1_id_int node2_id_int <weight_float, optional>

The graph is assumed to be undirected and unweighted by default. These options can be changed by setting the appropriate flags.

Output

The output file has n+1 lines for a graph with n vertices. The first line has the following format:

num_of_nodes dim_of_representation

The next n lines are as follows:

node_id dim1 dim2 ... dimd

where dim1, ... , dimd is the d-dimensional representation learned by mirand.