Code Monkey home page Code Monkey logo

dynamictriad's Introduction

DynamicTriad

This project implements the DynamicTriad algorithm proposed in [1], which is a node embedding algorithm for undirected dynamic graphs.

Quick Links

Building and Testing

This project is implemented primarily in Python 2.7, with some c/c++ extensions written for time efficiency.

Though the program falls back to pure Python implementation if c/c++ extensions fail to build, we DISCOURAGE you from using these code because they might have not been actively maintained and properly tested.

The c/c++ code is ONLY compiled and tested with standard GNU gcc/g++ compilers (with c++11 and OpenMP support), and other compilers are explicitly disabled in our build scripts. If you have to use another compiler, modifications on build scripts are required.

Dependencies

  • Boost.Python. Version 1.54.0 has been tested. You can find instructions to install from source here.
  • CMake. Version >= 2.8 required. You can find installation instructions here.
  • Eigen 3. Version 3.2.8 has been tested, and later versions are expected to be compatible. You can find installation instructions here.
  • Python 2.7. Version 2.7.13 has been tested. Note that Python development headers are required to build the c/c++ extensions.
  • graph-tool. Version 2.18 has been tested. You can find installation instructions here.
  • TensorFlow. Version 1.1.0 has been tested. You can find installation instructions here. Note that the GPU support is ENCOURAGED as it greatly boosts training efficiency.
  • Other Python modules. Some other Python module dependencies are listed in requirements.txt, which can be easily installed with pip:
    pip install -r requirements.txt
    

Although not necessarily mentioned in all the installation instruction links above, you can find most of the libraries in the package repository of a regular Linux distribution.

Building the Project

Before building the project, we recommend switching the working directory to the project root directory. Assume the project root is at <dynamic_triad_root>, then run command

cd <dynamic_triad_root>

Note that we assume <dynamic_triad_root> as your working directory in all the commands presented in the rest of this documentation.

A building script build.sh is available in the root directory of this project, simplifying the building process to executing a single command

bash build.sh

Before running the actual building commands, the script requires you to configure some of the environment variables. You can either use the default values or specify your custom installation paths for certain libraries. For example,

PYTHON_LIBRARY? (default: /usr/lib64/libpython2.7.so.1.0, use a space ' ' to leave it empty) 
PYTHON_INCLUDE_DIR? (default: /usr/include/python2.7, use a space ' ' to leave it empty) 
EIGEN3_INCLUDE_DIR? (default: /usr/include, use a space ' ' to leave it empty) 
BOOST_ROOT? (default: , use a space ' ' to leave it empty) ~/boost_1_54_1

If everything goes well, the build.sh script will automate the building process and create all necessary binaries.

Note that the project also contains some Cython modules, however, they will be automatically built as soon as the module is imported if the environment is ready.

Testing the Project

A test script scripts/test.py is available, run

python scripts/test.py

to see if everything is fine with building.

Usage

Given a sequence of undirected graphs, each for a time step, this program can be used to compute a real-valued vector for each vertex at each time step.

Input Format

The input is expected to be a directory containing N input files named 0, 1, 2..., where N is the length of the graph sequence. Each file contains an adjacency list of the corresponding graph, and the adjacency list consists of multiple lines, each in the format:

<from_node_name> [<to_node_name1> <weight1> [<to_node_name2> <weight2> ...] ] 

where x_node_name can be any ascii string without white space characters in it, and weight are float or integer values. The line describes edges from from_node_name to to_node_name1 and to_node_name2 with weight weight1 and weight2 respectively.

Note that:

  • The graph is expected to be undirected, however, it should be presented in a directed format. That is, if there is an edge (u, v, w), its reciprocal edge (v, u, w) must also exists in the adjacency list.
  • The vertex set should be same for all graphs, if a vertex is missing in a certain graph, simply present it as an isolated vertex.
  • If a vertex has no outbound vertices, you should write a line with only the from_node_name, instead of ignoring this vertex.
  • If the graph is unweighted, place a 1.0 for all weight placeholders, rather than ignoring all weights in the adjacency list.
  • Loopback edges (u, u, w) will be ignored when the adjacency list is loaded.

Output Format

The program outputs to a directory creating N files named 0.out, 1.out, 2.out, ..., each corresponds to an input file (time step). Each output file contains V lines, where V is the number of vertices in each graph. And each line is in format:

<node_name> <r1> <r2> ... <rK>

where <node_name> is the name of the vertex defined in the input files, which is followed by K real values, i.e. the K-length embedding vector for vertex <node_name> at the corresponding time step.

Main Script

Now that the input data is ready, the main script will be called to compute dynamic vertex embeddings. Following the assumption that the current working directory is <dynamic_triad_root>, the help information of the main script can be obtain by executing command

python . -h
 
usage: . [-h] [-I NITERS] -d DATAFILE [-b BATCHSIZE] -n NSTEPS
               [-K EMBDIM] [-l STEPSIZE] [-s STEPSTRIDE] -o OUTDIR
               [--cachefn CACHEFN] [--lr LR] [--beta BETA [BETA ...]]
               [--negdup NEGDUP] [--validation VALIDATION]

optional arguments:
  -h, --help            show this help message and exit
  -I NITERS, --niters NITERS
                        number of optimization iterations (default: 10)
  -d DATAFILE, --datafile DATAFILE
                        input directory name (default: None)
  -b BATCHSIZE, --batchsize BATCHSIZE
                        batchsize for training (default: 5000)
  -n NSTEPS, --nsteps NSTEPS
                        number of time steps (default: None)
  -K EMBDIM, --embdim EMBDIM
                        number of embedding dimensions (default: 48)
  -l STEPSIZE, --stepsize STEPSIZE
                        size of of a time steps (default: 1)
  -s STEPSTRIDE, --stepstride STEPSTRIDE
                        interval between two time steps (default: 1)
  -o OUTDIR, --outdir OUTDIR
                        output directory name (default: None)
  --cachefn CACHEFN     prefix for data cache files (default: None)
  --lr LR               initial learning rate (default: 0.1)
  --beta-smooth BETA_SMOOTH
                        coefficients for smooth component (default: 0.1)
  --beta-triad BETA_TRIAD
                        coefficients for triad component (default: 0.1)
  --negdup NEGDUP       neg/pos ratio during sampling (default: 1)
  --validation VALIDATION
                        link_prediction, link_reconstruction, node_classify,
                        node_predict, none (default: link_reconstruction)

Some of the arguments may require extra explanation:

  • --beta-smooth/--beta-triad, two hyper parameters used in the model, see reference [1] for details about the hyper parameters of DynamicTriad. Empirically, the hyper parameters need to be tuned in order to achieve the best performance, and the best choice depends on the task and the stability of the target dynamic network.
  • -l/--stepsize and -s/--stepstride, see Time Model for details.
  • --cachefn, sometimes you find that the data preprocessing becomes intolerably time consuming (see Time Model), and a solution is to specify --cachefn so that the program creates or uses a cache file of the preprocessed data. The cache file consists of two parts -- a file named <--cachefile>.cache as well as a file named <--cachefile>.cache.args. If you have changed your configuration for preprocessing, remove <--cachefile>.cache.args and the cache will be regenerated.
  • --validation, the four tasks available for validation are as defined in [1], please refer to the paper for details.

Demo

We include a toy data set in the data directory, namely data/academic_toy.pickle, which is a subset of Academic data set in [1] stored using Python pickle module. See Data Sets for more details.

A demo script is available as scripts/demo.sh, which primarily does three things:

  • Call scripts/academic2adjlist.py to convert the toy data to the input format described in Input Format.
  • Call the main script to compute the vertex embeddings and save them to output directory.
  • Call scripts/stdtest.py to experiment on standard tasks described in paper [1].

In the demo script, you can find an example for the standard usage of the main script, as well as hints for the usage of the other two scripts, if you are interested in them.

To run the demo, execute command

bash scripts/demo.sh

Time Model

TL;DR: If you would like the main script to treat your graphs exactly as they are specified in your input files, please leave the arguments -l and -s to their default values.

For flexibility, a part of the data preprocessing functionalities are included into our main script. Specifically, if we call each graph file in the input directory a unit graph, our main script provides interfaces to create the graph for each time step out of these unit graphs.

Before describing this preprocessing step, we shall first define a time step. According to our assumption, a time step consists of <stepsize> consecutive unit graphs, where <stepsize> is a constant value shared across all time steps. There are <stepstride> - 1 unit graphs between the leading unit graphs of two adjacent time steps, where <stepstride> is also a constant value. For example, we set <stepsize>=4 and <stepstride>=2 in our demo script, as a result, the time steps are:

time step #1: unit graph 0 -- unit graph 3
time step #2: unit graph 2 -- unit graph 5
time step #3: unit graph 4 -- unit graph 7
...

Once <stepsize> and <stepstride> are given, each time step now corresponds to a subsequence of unit graphs, and the graph for this time step is created by merging these unit graphs, i.e. by summing up weights for the same edge.

Note that if you set both <stepsize> and <stepstride> to 1, the graphs will be used as is specified in the input directory. If the merging operation is found very time expensive, specifying a <--cachefile> avoids re-merging everytime you run the script, as long as the data configuration is kept unchanged.

Evaluation

Data Sets

One out of the three data sets reported in [1] -- the Academic Data Set -- was made public by AMiner, which consists of information about papers published in a recent few decades. We keep only those papers published between 1980 and 2015 (included), and we remove from the data those researchers with less than 15 publications in total and conferences with less than 20 participants in total, so that the resulting dynamic network becomes more stable.

In this data set, labels are extracted for each researcher indicating the research fields he/she focuses on. We manually specify a set of representing conferences for each research field, and try to find out for a researcher in which field he/she publishes most of his/her work, given a certain time step.

A toy data is included in this project as data/academic_toy.pickle, which was originally the ACM-Citation-network V8 data set from AMiner, and was preprocessed as we describe above, with the only difference that the vertices are further sampled to a limited size of 2000. And our full preprocessing result can be downloaded here.

Update: For those who are interested in the academic dataset and wish to avoid the bothering building process, the dataset in clean format is released here (Please cite the original publisher of the data if you wish use the dataset). See readme.txt in the package for detailed information, and feel free to contact me if there are anything wrong or unclarified in the data.

Performance

As reported in [1], the performance of DynamicTriad on Academic Data Set with embedding dimension set to 48 is:

F1-score on Academic Vertex Classification Link Reconstruction C.Link Reconstruction
DeepWalk 0.630 0.694 0.702
node2vec 0.359 0.574 0.611
Temporal Network Embedding 0.625 0.974 0.899
DynamicTriad 0.704 0.985 0.925
F1-score on Academic Vertex Prediction Link Prediction C.Link Prediction
DeepWalk 0.591 0.612 0.674
node2vec 0.355 0.548 0.617
Temporal Network Embedding 0.596 0.772 0.889
DynamicTriad 0.671 0.836 0.924

Please refer to [1] for more information about our experiments, where you can find the definition of tasks, the experimental settings, the description of unpublished data sets and the full results of our experiments.

Reference

[1] Zhou, L; Yang, Y; Ren, X; Wu, F and Zhuang, Y, 2018, Dynamic Network Embedding by Modelling Triadic Closure Process, In AAAI, 2018

@inproceedings{zhou2018dynamic,
  title = "{Dynamic Network Embedding by Modelling Triadic Closure Process}", 
  author = {{Zhou}, L. and {Yang}, Y. and {Ren}, X. and {Wu}, F. and {Zhuang}, Y.}, 
  booktitle={AAAI},
  year = 2018, 
} 

dynamictriad's People

Contributors

luckiezhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dynamictriad's Issues

experimental results

I have been debugging the experimental parameters for many times. The accuracy of this model for link prediction on Academic data set has been around 0.6. How to set the parameters to get a better result?
I hope you can reply to me as soon as possible. Thank you.

bash build.sh error (CMake Error at CMakeLists.txt:57 (include_directories))

Am getting the above error
Have installed all the required dependencies using conda install, in a virtual conda environment

-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Using custom python path /home/vishweshk/.conda/envs/triads/lib/libpython2.7.so.1.0 and /home/vishweshk/.conda/envs/triads/include/python2.7
-- Found PythonLibs: /home/vishweshk/.conda/envs/triads/lib/libpython2.7.so.1.0 (found suitable version "2.7.13", minimum required is "2.7") 
-- Found Boost 1.70.0 at /home/vishweshk/.conda/envs/triads/lib/cmake/Boost-1.70.0
--   Requested configuration: QUIET
-- Found boost_headers 1.70.0 at /home/vishweshk/.conda/envs/triads/lib/cmake/boost_headers-1.70.0
Boost 1.54.0 found.
CMake Error at CMakeLists.txt:57 (include_directories):
  include_directories given empty-string as include directory.


-- Found Boost 1.70.0 at /home/vishweshk/.conda/envs/triads/lib/cmake/Boost-1.70.0
--   Requested configuration: QUIET COMPONENTS python
-- Found boost_python 1.70.0 at /home/vishweshk/.conda/envs/triads/lib/cmake/boost_python-1.70.0
-- No suitable boost_python variant has been identified!
--   libboost_python27.so.1.70.0 (shared, BUILD_SHARED_LIBS not ON, set Boost_USE_STATIC_LIBS=OFF to override)
--   libboost_python27.a (static, Boost_USE_STATIC_LIBS=OFF)
Boost 1.54.0 found.
Found Boost components:
   python

Despite Boost being found , why is the BOOST_INCLUDE_DIR variable giving an empty string?

should I use CPU or GPU ?

hi Lukiezhou,

I tried to run a data (65000 vertices, 700000 edges) using GPU (tesla p100 16gb), the program crashed, while there was no problem for small data.
In your paper, you conducted experiments on larger data, did you use CPU or GPU?

About online training

Hi Lekui,

Thanks for your excellent work.

In

# online training disabled
, it said "online training disabled". I'm wondering what is the definition of online training here, and how to enable it.

Besides, in your paper, did you train the model with one graph per timestep, and then use the previous trained model as well as the graph at next timestep to get the next model (the downstream tasks are then evaluated by the models/embeddings obtained at each timestep), and so on...?
Or did you train the model with all graphs in one go, which gives the "overall" pre-trained model and then use this model to somehow generate embeddings at each timestep, which are then used to evaluate downstream tasks? From

for i in range(args.niters):
, It seems that all edges from all dynamic graphs are used together to train the model.

Thanks in advance.

Dataset problem

Would you like to make public the other two processed data sets mentioned in the paper?
If the data sets collected are in other formats, must be converted to .pickle format before they can be tested.
For example, the format of the data set I collected is .mat format. How should I deal with it?
I hope you can reply to me as soon as possible. Thank you.

How to use other dataset?

Demo can be run successfully. However, How to run other dataset? Such as DBLP.

  1. How did you preprocess the original dataset before you generated the pickle file? Do you mind sharing the approaches or preprocessed code that you used?

  2. I noticed that 35 files represents 35 years. However, you mentioned that each time step is a 4-year period. Would you explain more details about how you defined a timestamp?


vertices: 51,060 researchers;
edges: 794,552 coauthor relationships.
Each time step is a 4-year period and there is a 2-year interval between the start time of consecutive time steps.
At time step t, we create an edge between two users weighted by the number of coauthorships between them during that period.


  1. Which function in "stdtest" will load these 35 files?

  2. The result prints out a embedding vector with a shape of (2000, 48). What's the relationship between them?

btw, your work is great. Hope I have a chance to cite your paper.

Thanks in advance,

About academic dataset

I analyzed the published data set, the number of static edges is only 714470, which is inconsistent with the paper, is it different from the used dataset in the paper?

two questions about the paper

In the paper,
Eq(3):
image
for specific i, j, t, α(i, j, t) is a vector and can be calculated, why use accumulative symbolimage?

Eq(11):
after the transformation of Eq(3), the EM algprithms can be regarded as the following form
(1-α_k^(t,i,j) )≤C_(i,j,k)^t, how the inequality is derived?In addition, α_k^(t,i,j) is 1 when (i,j,k) is closed at t+1. What about other cases?

Could you explain more about how to do the link prediction evaluation in the paper?

Could you explain more about how to do the link prediction evaluation (predict links for t + 1) in the paper?

I am very confused about using Logistic Regression (LR) after obtaining vertex embeddings. Because you were trying to compare DeepWalk, nod2vec and TNE methods. Does it mean for every method, you will train different LR?

bash build.sh error

when i run bash build.sh, i get this error:

[100%] Linking CXX shared library dynamic_triad_cimpl.so
/usr/bin/ld: cannot find -lboost_python-2.7
collect2: error: ld returned 1 exit status
CMakeFiles/dynamic_triad.dir/build.make:83: recipe for target 'dynamic_triad_cimpl.so' failed
make[2]: *** [dynamic_triad_cimpl.so] Error 1
CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/dynamic_triad.dir/all' failed
make[1]: *** [CMakeFiles/dynamic_triad.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

so, how do i fix it, ths~

C++ error

Hey,

I'm getting the following error trying to run the code:

UserWarning: dynamic_triad_cimpl.so not found, falling back to python implementation
warnings.warn("dynamic_triad_cimpl.so not found, falling back to python implementation")
Traceback (most recent call last):
File "DynamicTriad/core/init.py", line 178, in
main()
File "DynamicTriad/core/init.py", line 100, in main
edgecnt = [g.num_edges() for g in ds.gtgraphs]
File "/home/thisistheend/DynamicTriad/core/utils_py.py", line 189, in next
ret = self._load_item(self.__iter)
File "/home/thisistheend/DynamicTriad/core/utils_py.py", line 196, in _load_item
self.__items[step - self.offset] = self.__factory(step)
File "/home/thisistheend/DynamicTriad/core/dataset/dataset_utils.py", line 109, in
lambda i: gconv.mygraph2graphtool(self._mygraphs[i], convert_to='undirected'))
File "/home/thisistheend/DynamicTriad/core/utils_py.py", line 159, in getitem
return self._load_item(key)
File "/home/thisistheend/DynamicTriad/core/utils_py.py", line 196, in _load_item
self.__items[step - self.offset] = self.__factory(step)
File "/home/thisistheend/DynamicTriad/core/dataset/dataset_utils.py", line 107, in
self._mygraphs = utils.OffsetList(self.localstep, self.nsteps, lambda step: self._load_graph(step))
File "/home/thisistheend/DynamicTriad/core/dataset/dataset_utils.py", line 128, in _load_graph
graphs.append(self._load_unit_graph(self._unit2time(u)))
File "/home/thisistheend/DynamicTriad/core/dataset/adjlist.py", line 41, in _load_unit_graph
g = mgutils.load_adjlist(fn)
File "/home/thisistheend/DynamicTriad/core/mygraph_utils.py", line 85, in load_adjlist
g = mygraph.Graph(node_type, weight_type)
Boost.Python.ArgumentError: Python argument types in
Graph.init(Graph, str, str)
did not match C++ signature:
init(_object*, int, int)

Does anyone know how to solve this problem?

Thanks,
Uriel

How to set the paths before running "bash build.sh"

How to set the paths before running "bash build.sh"? Would you give me more specific instructions?

PYTHON_LIBRARY? (default: /usr/lib64/libpython2.7.so.1.0, use a space ' ' to leave it empty)
PYTHON_INCLUDE_DIR? (default: /usr/include/python2.7, use a space ' ' to leave it empty)
EIGEN3_INCLUDE_DIR? (default: /usr/include, use a space ' ' to leave it empty)
BOOST_ROOT? (default: , use a space ' ' to leave it empty) ~/boost_1_54_1

Many Thanks,

CMakeLists.txt has not been tested/written for your compiler

After I ran bash build.sh and setup the environment variables, I got the following error:

building mygraph module ...
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:17 (MESSAGE):
  CMakeLists.txt has not been tested/written for your compiler.


-- Configuring incomplete, errors occurred!
See also "/Users/corwin/Desktop/project/DynamicTriad/core/mygraph-build/CMakeFiles/CMakeOutput.log".

My platform is macOS Mojave 10.14.3 and python2.7 with virtualenv.
PYTHON_LIBRARY and PYTHON_INCLUDE_DIR were set to default. EIGEN3_INCLUDE_DIR and BOOST_ROOT were set to be the path of downloaded and extracted directories. Name for boost_python library was set to the name of BOOST's directory(boost_1_68_0).

Can you give me some advise to solve this problem? Thanks a lot.

error while executing scripts/test.py

I am getting the following error while running test.py. I have installed all the dependencies.

here is the log:
Checking mygraph submodule ...
Traceback (most recent call last):
File "scripts/test.py", line 13, in
raise RuntimeError("mygraph submodule not avaiable: {}".format(str(e)))
RuntimeError: mygraph submodule not avaiable: /home/raavan/mountedDrives/dynamicGraphs/DynamicTriad-master/core/mygraph.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE

Dependence Conflict

Now I'm using py2.7 as your instruction.
When I was trying to install "graph-tool", it returned that:

UnsatisfiableError: The following specifications were found to be in conflict:

  • enum34
  • graph-tool

When I attempted to un-install enum34, I was required to remove py2.7 together.
Do you know how to solve this conflict?

Thanks,

About stdtest.py

Does stdtest.py have to use original pickle file that you provided?
Or this script only depends on the output?

Based on the demo.sh, it seems that data/academic_toy/academic_toy.pickle are still used in stdtest.py.

Do you have additional instruction on how to implement this code on training or evaluating other dataset?

Hope to hear from you soon.
Thanks,

error when load pickle running demo.sh

hello , i've finish configuring the env with python2.7 boost1.54 eigen3.2.8 and cmake 3.14 and pass the env test like this
image
but when i run demo.sh under the root path, it tell me i've got no mygraph module like this
image
besides, i've try import core.mygraph as mygraph in python env and got no error and finally locate the error at data = cPickle.load(open(infn, 'r')) in academic2adjlist.py.
could you please give me some hint how this could happen , i've not use pickle format before and may have blind zone about this.
look forward to your reply and thanks for your help~

error at bash build.sh

Excuse me, after I read your paper, your works are so cheerful & interesting. Hence I want to implement it, to see the progress. so I follow your "read.me" instruction. But when I dealing with the environment, the cmake always annoyed me. Now, the problem is:

Scanning dependencies of target dynamic_triad [ 50%] Building CXX object CMakeFiles/dynamic_triad.dir/dynamic_triad_cimpl.cpp.o In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0, from /root/triad/DynamicTriad/core/algorithm/dynamic_triad_cimpl.cpp:2: /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] #warning "Using deprecated NumPy API, disable it by " \ ^ /root/triad/DynamicTriad/core/algorithm/dynamic_triad_cimpl.cpp:8:22: fatal error: Eigen/Core: No such file or directory compilation terminated. CMakeFiles/dynamic_triad.dir/build.make:62: recipe for target 'CMakeFiles/dynamic_triad.dir/dynamic_triad_cimpl.cpp.o' failed make[2]: *** [CMakeFiles/dynamic_triad.dir/dynamic_triad_cimpl.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dynamic_triad.dir/all' failed make[1]: *** [CMakeFiles/dynamic_triad.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

My platform is aliyun server, Ubuntu16.04 and python2.7.
I have been google this problem but it seems didn't work.
So, can you help me to give me some advise to solve this problem? thanks.

About the performance of DynamicTriad on Academic Full dataset

Hi There,

I ran the experiments on the full academic graph.
Here are the results I got from running the stdtest.py

task: node label predict from current time step
f1 mean: 0.758781494117 std: 0.00493563473657
task: node label predict from previous time step
f1 mean: 0.74218857501 std: 0.00703456767329
task: link prediction from current time step
f1 mean: 0.965581668386 std: 0.000262895950964
task: link prediction from previous time step
f1 mean: 0.881259501445 std: 0.000573836561633
task: changed link prediction from current time step
f1 mean: 0.788477965543 std: 0.000976565646762
task: changed link prediction from previous time step
f1 mean: 0.768144620087 std: 0.0013686381365

The parameter setting I was used is:
python . -I 10 -d data/academic_full -n 16 -K 48 -l 4 -s 2 -o
output_academic_full --beta-smooth 1 --beta-triad 1
--cachefn cache_full -b 5000

python -m stdtests -f output_academic_full -d data/academic.pickle
-m 1980 -s 2 -l 4 -n 16 -t all --datasetmod core.dataset.citation
--cachefn cache_full

I was wondering why my results are quite different from the
reported table (F1-scores) under this parameter setting?
Is there any parameter setting I didn't use it correctly? Thanks.

Build errors

When I try to build it, I have following errors. Please help.

Scanning dependencies of target dynamic_triad
make[2]: Leaving directory /home/luwei.ylw/DynamicTriad/core/algorithm/build' make -f CMakeFiles/dynamic_triad.dir/build.make CMakeFiles/dynamic_triad.dir/build make[2]: Entering directory /home/luwei.ylw/DynamicTriad/core/algorithm/build'
[ 50%] Building CXX object CMakeFiles/dynamic_triad.dir/dynamic_triad_cimpl.cpp.o
/usr/bin/c++ -Ddynamic_triad_EXPORTS -I/home/luwei.ylw/DynamicTriad/core/algorithm/.. -I/home/luwei.ylw/anaconda3/envs/python27_conda/include/python2.7 -I/home/luwei.ylw/anaconda3/envs/python27_conda/lib/python2.7/site-packages/numpy/core/include -I/home/luwei.ylw/eigen-eigen-323c052e1731 -O2 -fopenmp -O3 -DNDEBUG -fPIC -std=gnu++11 -o CMakeFiles/dynamic_triad.dir/dynamic_triad_cimpl.cpp.o -c /home/luwei.ylw/DynamicTriad/core/algorithm/dynamic_triad_cimpl.cpp
In file included from /home/luwei.ylw/anaconda3/envs/python27_conda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /home/luwei.ylw/DynamicTriad/core/algorithm/dynamic_triad_cimpl.cpp:2:
/home/luwei.ylw/anaconda3/envs/python27_conda/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with "
^
[100%] Linking CXX shared library dynamic_triad_cimpl.so
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/dynamic_triad.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -fopenmp -O3 -DNDEBUG -shared -Wl,-soname,dynamic_triad_cimpl.so -o dynamic_triad_cimpl.so CMakeFiles/dynamic_triad.dir/dynamic_triad_cimpl.cpp.o -lpython2.7 -l boost_python-2.7
/usr/bin/ld: cannot find -lpython2.7
/usr/bin/ld: cannot find -lboost_python-2.7
collect2: error: ld returned 1 exit status
make[2]: *** [dynamic_triad_cimpl.so] Error 1
make[2]: Leaving directory /home/luwei.ylw/DynamicTriad/core/algorithm/build' make[1]: *** [CMakeFiles/dynamic_triad.dir/all] Error 2 make[1]: Leaving directory /home/luwei.ylw/DynamicTriad/core/algorithm/build'
make: *** [all] Error 2

Baseline Methods

How to verify the performance of static models (such as deep walk) in Academic .
I hope you can reply to me as soon as possible. Thank you.

boost_pylib

I know how to assign boostroot but CMake cannot detect the value of boost_pylib. Could you please help me?

I got the following errors:

/usr/bin/ld: cannot find -lboost_python-2.7
collect2: error: ld returned 1 exit status
CMakeFiles/mygraph.dir/build.make:188: recipe for target 'mygraph.so' failed
make[2]: *** [mygraph.so] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/mygraph.dir/all' failed
make[1]: *** [CMakeFiles/mygraph.dir/all] Error 2
Makefile:83: recipe for target 'all' failed

Appreciated in advance :)

error at running demo.sh

I built the program and ran the test script well.
when I ran the demo, it got some errors on the initialization of class Graph, seems like that parameters do not match the c code. Dependency I installed are Python2.7(Anaconda), Boost1.54.0 and Eigen3.2.10.

here is the log:
File "core/cython_src/utils_cy.pyx", line 230, in utils_cy.OffsetList._load_item
self.__items[step - self.offset] = self.__factory(step)
File "./core/dataset/dataset_utils.py", line 107, in
self._mygraphs = utils.OffsetList(self.localstep, self.nsteps, lambda step: self._load_graph(step))
File "./core/dataset/dataset_utils.py", line 128, in _load_graph
graphs.append(self._load_unit_graph(self._unit2time(u)))
File "./core/dataset/adjlist.py", line 41, in _load_unit_graph
g = mgutils.load_adjlist(fn)
File "./core/mygraph_utils.py", line 85, in load_adjlist
g = mygraph.Graph(node_type, weight_type)
Boost.Python.ArgumentError: Python argument types in
core.mygraph.Graph(str, str)
did not match C++ signature:
Graph(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)

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.