[graph-tool] bipartite minimize_nested_blockmodel_dl() error: cannot move vertex across clabel barriers

2022-07-20 Thread Siwei Zhang
Hi Dr. Peixoto,

I am using graph-tool version 2.45 and I have two questions.


  1.  I am trying to reproduce the script in the document
  2.  g = gt.collection.data["celegansneural"]
state = gt.minimize_nested_blockmodel_dl(g, state_args=dict(overlap=True))

  and have the error:
   
/usr/lib/python3/dist-packages/graph_tool/inference/blockmodel.py:390: 
UserWarning: unrecognized keyword arguments: ['overlap']
 warnings.warn("unrecognized keyword arguments: " +

  It seems the argument of "overlap" is removed.

2. Regardless of the question1, I am trying to do a bipartite version 
stochastic block model and I define "clabel" to constraint labels on the 
vertices so that vertices with different label values will not be clustered in 
the same group. But I always have the error of "ValueError: cannot move vertex 
across clabel barriers". The below is the code:
 node_types = g.vp['kind']
 node_types.get_array()
Output: PropertyArray([1, 1, 1, ..., 2, 2, 2], dtype=int32)

state = gt.minimize_nested_blockmodel_dl(
g,
state_args=dict(clabel=node_types,pclabel=node_types,deg_corr=True),
multilevel_mcmc_args = dict(niter=niter,beta=beta))

Could you please help me with these questions? Thanks!

Best,
Siwei

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


[graph-tool] Re: minimize_nested_blockmodel_dl got an unexpected keyword argument 'multilevel_mcmc_args'

2022-07-13 Thread Siwei Zhang
Sorry for the trouble, I found the issue that I was using the previous version. 
I built the latest version of graph-tool in my docker image and it works.

And may I ask another question? In the paper, it mentioned "by making beta goes 
to infinity and repeated many times, which yields a reliable estimate of the 
maximum". May I double-check what "repeated many times" refers to? Does it 
refer to the number of sweeps or refer to the whole algorithm? I also noticed 
there is a warning of "multilevel_mcmc_sweep" in NestedBlockState: "This 
function performs niter sweeps at each hierarchical level once. This means that 
in order for the chain to equilibrate, we need to call this function several 
times, i.e. it is not enough to call it once with a large value of niter." I 
found that the high-level function "minimize_nested_blockmodel_dl" seems 
already done that. But I am a little bit confused, if possible, could it be 
more specific? Thank you so much for your help!

Best,
Siwei

From: Tiago de Paula Peixoto 
Sent: Wednesday, July 13, 2022 7:52
To: graph-tool@skewed.de 
Subject: [graph-tool] Re: minimize_nested_blockmodel_dl got an unexpected 
keyword argument 'multilevel_mcmc_args'

Am 13.07.22 um 01:28 schrieb Siwei Zhang:
> Hello,
>
> I have a question about minimize_nested_blockmodel_dl(). The below is my
> code:
>
> state_args = {'clabel': node_types, 'pclabel': node_types}
> multilevel_mcmc_args = {'niter': niter, 'beta': beta}
> state = gt.minimize_nested_blockmodel_dl(
>  g,
>  deg_corr = True,
>  overlap = False,
>  state_args = state_args,
>  multilevel_mcmc_args = multilevel_mcmc_args
> )
>
> And I encountered an error that "minimize_nested_blockmodel_dl got an
> unexpected keyword argument 'multilevel_mcmc_args'". I removed
> "multilevel_mcmc_args" and it works. And I also tried example
> "|minimize_blockmodel_dl(G, multilevel_mcmc_args=dict(B_min=4,
> B_max=4))|"  in https://git.skewed.de/count0/graph-tool/-/issues/725
> <https://git.skewed.de/count0/graph-tool/-/issues/725> and I encountered
> the same error. I took a look of the source code of graph-tool and I did
> not find where is the problem. Could you please help me about it? Thanks!

I cannot reproduce this. What version of graph-tool are you using?


--
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] minimize_nested_blockmodel_dl got an unexpected keyword argument 'multilevel_mcmc_args'

2022-07-12 Thread Siwei Zhang
Hello,

I have a question about minimize_nested_blockmodel_dl(). The below is my code:

state_args = {'clabel': node_types, 'pclabel': node_types}
multilevel_mcmc_args = {'niter': niter, 'beta': beta}
state = gt.minimize_nested_blockmodel_dl(
g,
deg_corr = True,
overlap = False,
state_args = state_args,
multilevel_mcmc_args = multilevel_mcmc_args
)

And I encountered an error that "minimize_nested_blockmodel_dl got an 
unexpected keyword argument 'multilevel_mcmc_args'". I removed 
"multilevel_mcmc_args" and it works. And I also tried example 
"minimize_blockmodel_dl(G, multilevel_mcmc_args=dict(B_min=4, B_max=4))"  in 
https://git.skewed.de/count0/graph-tool/-/issues/725 and I encountered the same 
error. I took a look of the source code of graph-tool and I did not find where 
is the problem. Could you please help me about it? Thanks!

Best,
Siwei

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