Code Monkey home page Code Monkey logo

mancalog's Introduction

MANCaLog

Implementation of MANCaLog: A Logic for Multi-Attribute Network Cascades.

Paper: https://arxiv.org/abs/1301.0302

Table of Contents

Table of Contents
  1. Usage
  2. Setup & Run
  3. Profiling

1. Usage

To run mancalog you need 3 files:

  1. A YAML file containing the mancalog rules
  2. A YAML file containing the mancalog facts
  3. A YAML file containing the mancalog labels

The format of these files is very important. Please refer to the example YAML files provided when making your own rules/facts/labels.

An example file is provided to illustrate how mancalog works on a subset of a Honda supply chain graph.

To run the example, clone the repository, then:

cd mancalog
python3 -m mancalog.examples.example

This example file uses the example yaml files for rules, facts and labels.

2. Setup & Run

There are three ways of running MANCaLog:

  1. interactive session (on Agave cluster)
  2. sbatch (on Agave cluster)
  3. locally

To Run mancalog, you need to provide the following as command line arguments:

  1. The path to a graphml file
  2. The number of timesteps you want to run the diffusion
  3. The path to the YAML rules file
  4. The path to the YAML facts file
  5. The path to the YAML labels file

2.1 Setup & Run on the ASU Agave Cluster (interactive)

To create an Anaconda environment and activate it, and then clone the repository, type the following in your Agave terminal:

module load anaconda/py3
conda create -n mancalog
source activate mancalog
git clone https://github.com/DyumanAditya/mancalog
cd mancalog
pip install -r requirements.txt

Now create an interavtive session with:

interactive -N 1 -n 50 -p htc -t 0-0:10

This starts an interactive session using 50 cores on one node for 10 minutes. You can change the time parameter based on your needs.

To run MANCaLog, type the following in your Agave terminal. Make sure you are in the top mancalog directory. Don't forget to replace the placeholders with the correct values.

python3 -m mancalog.scripts.diffuse --graph_path /path/to/graphml/file --timesteps {number of timesteps to run} --rules_yaml_path /path/to/rules.yaml --facts_yaml_path /path/to/facts.yaml --labels_yaml_path /path/to/labels.yaml

2.2 Setup & Run on the ASU Agave Cluster (sbatch)

Open the run_on_agave.sh in a text editor, and modify the paths for the graph file, the rules file, the facts file and the labels file. In addition specify the number of timesteps to run for. Then in your Agave terminal, type:

sbatch run_on_agave.sh

This will submit a job to the cluster

2.3 Setup & Run on your Local System

Clone the repository and install the necessary packages to make mancalog run

git clone https://github.com/DyumanAditya/mancalog
cd mancalog
pip install -r requirements.txt

To run MANCaLog, type the following in your Agave terminal. Make sure you are in the top mancalog directory. Don't forget to replace the placeholders with the correct values.

python3 -m mancalog.scripts.diffuse --graph_path /path/to/graphml/file --timesteps {number of timesteps to run} --rules_yaml_path /path/to/rules.yaml --facts_yaml_path /path/to/facts.yaml --labels_yaml_path /path/to/labels.yaml

3. Profiling

To Profile the code with cProfile:

python3 -m mancalog.scripts.diffuse --graph_path /path/to/graphml/file --timesteps {integer number of timesteps to run} --rules_yaml_path /path/to/rules.yaml --facts_yaml_path /path/to/facts.yaml --labels_yaml_path /path/to/labels.yaml --profile true --profile_output output.txt

mancalog's People

Contributors

dyumanaditya avatar jnparedes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.