tvayer / pscn Goto Github PK
View Code? Open in Web Editor NEWA python implementation of Patchy-San Convolutional Network for Graph
A python implementation of Patchy-San Convolutional Network for Graph
Hi, I'm having a hard time implementing the algorithm with my own dataset.
I have a dataset of networkx objects, say, n graphs. I transformed the networkx objects to the Graph class included in the package, but I keep getting error after error. Is it possible to load a dataset different from the ones included in the data folder? What would you recommend?
EDIT: I can run the base code with no problems with any default dataset.
Hello. I'm trying to run it on Windows (Although it seems that the problem is missing directory so it will happen at Linux as well.
yehonata@YEHONATA-TP MINGW64 ~/PycharmProjects/PSCN-master/pynauty-0.6
$ make pynauty
cd nauty; ./configure CFLAGS='-O4 -fPIC'
/usr/bin/sh: line 0: cd: nauty: Not a directory
/usr/bin/sh: ./configure: No such file or directory
make: *** [nauty/config.log] Error 127
When I change the line in make file:
NAUTY_DIR = nauty27rc1
Instead of
NAUTY_DIR = nauty
(Which is a file, not a dir)
I get the following error:
`make[1]: Leaving directory `C:/Users/yehonata/PycharmProjects/PSCN-mas ter/pynauty-0.6.0/nauty27rc1'
python setup.py build
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\pynauty
copying src\graph.py -> build\lib.win32-2.7\pynauty
copying src\__init__.py -> build\lib.win32-2.7\pynauty
running build_ext
building 'pynauty.nautywrap' extension
error: Unable to find vcvarsall.bat
make: *** [pynauty] Error 1
`
What am I missing? Thanks
Hello, I've switched to Linux after I couldn't run it with windows.
Now when I execute make pynauty
I get the following error:
`build/temp.linux-x86_64-3.7/src/nautywrap.o -O4 -fPIC
In file included from src/nautywrap.c:16:0:
nauty/nauty.h:43:0: warning: "_FILE_OFFSET_BITS" redefined [enabled by default]
#define _FILE_OFFSET_BITS 0
^
In file included from /home/yehonata/miniconda3/include/python3.7m/Python.h:8:0,
from src/nautywrap.c:15:
/home/yehonata/miniconda3/include/python3.7m/pyconfig.h:1494:0: note: this is the location of the previous definition
#define _FILE_OFFSET_BITS 64
^
gcc -pthread -shared -B /home/yehonata/miniconda3/compiler_compat -L/home/yehonata/miniconda3/lib -Wl,-rpath=/home/yehonata/miniconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/nautywrap.o nauty/nauty.o nauty/nautil.o nauty/naugraph.o nauty/schreier.o nauty/naurng.o -o build/lib.linux-x86_64-3.7/pynauty/nautywrap.cpython-37m-x86_64-linux-gnu.so
/home/yehonata/miniconda3/compiler_compat/ld: nauty/naugraph.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/home/yehonata/miniconda3/compiler_compat/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
make: *** [pynauty] Error 1
`
What is wrong here?
hello,
Thanks very much! I have learned a lot from your work.
For your Function"rank_label_wrt_dict" at pscn.py, i have another thought.
We can make 'distance_to_root' and 'betweenness_centrality' as the attributes of nodes in subgraph.Then,the code like this:
iterator = G.nodes(data=True)
sorted(iterator,key=lambda item:(item[1]['distance_to_root'],-item[1]['betweenness_centrality']))
What do you think about this thought?Could you give me some advice.
the function canonical_labeling is no longer available in penalty, so the function canonicalizes doesn't work.
Hi,
nice job with Patchy sans.
I think the utils.py is missing
Hello,
I'm sorry to disturb you again.
I would like to ascertain one case:
The number of nodes selected is larger than that of all nodes in the graph (w = 30, but there are only 20 nodes in the graph). So is the dumb node added or a node selected many times?
After installing pynauty, run the first cell in receptive_field_maker_example.ipynb returned importError:
ImportError: dlopen(/Users/sunhuayan/Library/Python/3.6/lib/python/site-packages/pynauty/nautywrap.cpython-36m-darwin.so, 2): Symbol not found: _dispatch_graph
Referenced from: /Users/sunhuayan/Library/Python/3.6/lib/python/site-packages/pynauty/nautywrap.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/sunhuayan/Library/Python/3.6/lib/python/site-packages/pynauty/nautywrap.cpython-36m-darwin.so
Could you please tell me how to fix this? Many THX~
Hi,
Really appreciate the code you've published for your paper! It has been incredibly helpful.
While running the code, I noticed I was getting an intermittent error, saying that certain nodes were not in the graph when calculating single_source_dijkstra_path_length
in labeling_to_root
. This error only happened sometimes and when restarting kernels or re-running the code a few times, would disappear and reappear for later runs.
It turns out, there was an issue in rank_label_wrt_dict
. As you are looping through all_distinc_labels
(i.e. list(set(label_dict.values()))
), the labels were not always ordered, which meant that we were looping through the labels in the wrong order. For a small k, this resulted in the vertex of interested having a rank higher than k
and therefore disappearing from the subgraph of interest. This is why the error would come up. I assume that the error would disappear at times because label_dict is a dictionary so sometimes, and as dictionaries are unordered, the order of the list would change depending on how it was saved in memory at that time.
The simple fix was to add all_distinc_labels.sort()
after creating all_distinc_labels
. This has fixed my problem. I was wondering whether this might also affect some results as even though the k
was large enough to capture the majority of vertices regardless of order, the order of the resulting re-ordered vertices in the normalised receptive fields was not correct?
Note that this didn't happen very often to me but it happened enough for it to break my code 50% of the time.
Hope this helps!
Hi,
I am the author of pynauty
. I have recently moved the package to Github - pynauty and updated it. I also made it available from PyPi - pynauty, many binary wheels are also provided. If a system is not compatible with the provided binary wheels pip
attempts to build the wheel of the extension module on the local machine.
Hi,
Thanks for your great work! And I set :PSCN(w=25,k=3,epochs=10,batch_size=32,verbose=2,attr_dim=100)
but I got an issue as follow:
--> 157 train.append(np.array(result).reshape(self.k*self.w,self.attr_dim))
158 X_preprocessed=np.array(train)
159 end=time.time()
ValueError: cannot reshape array of size 7400 into shape (75,100)
I tried to solve this problem, but it was unsuccessful. Could you help me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.