[graph-tool] Re: overlap/mixed-membership sbm help

2021-11-11 Thread Tiago de Paula Peixoto

Am 11.11.21 um 03:03 schrieb Eli Draizen:

Hi everyone,

I was wondering if it would be possible to provide some more examples of 
how to run a nested mixed membership SBM with edge weights. The new 
version seems to have removed the "overlap=True" option for state_args 
in the minimize_* functions.


Indeed, I will add more examples about this. Could you please open an 
issue in the website so I don't forget?



Is this the correct way to do it now?

import graph_tool as gta
import numpy as np
g =  # build graph
e_score =  #Set edge weights
state_args = dict(
     deg_corr=deg_corr,
     base_type=gta.inference.overlap_blockmodel.OverlapBlockState,
     B=2*g.num_edges(), #B_max
     deg_corr=True,
     recs=[e_score],
     rec_types=["real-normal"])
state = gta.inference.minimize_nested_blockmodel_dl(
     g,
     state_args=state_args,
     multilevel_mcmc_args=dict(verbose=True))
# improve solution with merge-split
state = state.copy(bs=state.get_bs() + [np.zeros(1)] * 4, sampling=True)

for i in range(100):
     if i%10==0: print(".", end="")
     ret = state.multiflip_mcmc_sweep(niter=10, beta=np.inf,
verbose=True)
This is correct. But note that the "sampling=True" option is no longer 
needed.


I am currently running this for a fully connected bipartite graph with 
3454 nodes and 55008 edges. I understand it would take longer than the 
non-overlapping version, but do you have any suggestions on how to speed 
it up? The non-overlapping version takes about 15 minutes, while the 
overlapping version is still running after 1 day.

The new version will contain a much faster code for the overlapping case!

But in the mean-time, what you can do is to fit the non-overlapping 
model first, and use that as a starting point to the MCMC with overlap. 
You do that simply by doing:


   state = state.copy(state_args=dict(overlap=True))

Best,
Tiago




--
Tiago de Paula Peixoto 
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de


[graph-tool] Core dump

2021-11-11 Thread Monecke, Stephan
Hi together,


I have an algorithm whose results incl. the graph I save to disk at the end.
When I load it again, on some vertices, shortest_distance() crashes python:

```
munmap_chunk(): invalid pointer
Aborted (core dumped)
```


Any ideas on how I can debug this?


All the property maps are internal and my custom vertex lists are converted to 
int before pickling and restored using gt.Graph().vertex() afterwards.



Thank a lot for ideas!



Cheers,


Stephan
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de


[graph-tool] Re: Core dump

2021-11-11 Thread Tiago de Paula Peixoto

Am 11.11.21 um 10:47 schrieb Monecke, Stephan:

Any ideas on how I can debug this?



Yes: try to isolate the problem by constructing a minimal, 
self-contained program that reproduces the crash.


--
Tiago de Paula Peixoto 
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de


[graph-tool] Re: Core dump

2021-11-11 Thread Monecke, Stephan
I bisected manually until I found the problem: shortest_path() segfaults when 
the vertex is not present.


- - MWE - -


import graph_tool.all as gt
gt.shortest_path(gt.Graph(), 1, 2)
Segmentation fault (core dumped)

- - o - -


I wrote a ticket for that.


Thanks for your help!


Von: Tiago de Paula Peixoto 
Gesendet: Donnerstag, 11. November 2021 11:05
An: graph-tool@skewed.de
Betreff: [graph-tool] Re: Core dump

Am 11.11.21 um 10:47 schrieb Monecke, Stephan:
> Any ideas on how I can debug this?
>

Yes: try to isolate the problem by constructing a minimal,
self-contained program that reproduces the crash.

--
Tiago de Paula Peixoto 
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de