On 13.02.2017 15:30, P-M wrote:
> I have just run the following snippet of code:
>
> mcmc_args=dict(parallel = True,niter=10)
> history = gt.mcmc_equilibrate(state, wait=1000,
> history=True,mcmc_args=mcmc_args)
> with open('history1.pkl','wb') as his1_pkl:
> pickle.dump(history,his1_pkl,-1)
>
> According to the manual history is a "list of tuples of the form (iteration,
> entropy)". When unpickling it however I get a list of length 2000. Each
> element in the list is another list of length two containing `nan` as first
> entry and then a single-digit integer as second entry.
>
> A couple of questions:
> 1) I would expect a tuple, not a list for each entry in the list. Is the
> manual wrong or is the code wrong? Or did I do something wrong?The point of the documentation was that two values for each step are returned, not that the actual type was a tuple. Most code should not care about this. > 2) Why am I receiving `nan` rather than a value for "iteration" as first > entry of my list? I have no idea. I can't reproduce this. You have to send a complete example that shows the problem > 3) Is there a particular reason why the length of the list is precisely 2000 > in this case? (Obviously there is, I just haven't quite figured it out yet.) As stated in the documentation, this is a stochastic algorithm which will stop after equilibration has been detected (using a record-breaking heuristic). Hence, the length of the history will be different each time. Best, Tiago -- Tiago de Paula Peixoto <[email protected]>
signature.asc
Description: OpenPGP digital signature
_______________________________________________ graph-tool mailing list [email protected] https://lists.skewed.de/mailman/listinfo/graph-tool
