Module Import alias Import alias identifier Import alias identifier ImportFrom alias alias ImportFrom alias alias ImportFrom alias FunctionDef arguments args NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpPow Num Num Print Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore BinOpAdd BinOpMult Num Call AttributeLoad NameLoad attr NameLoad BinOpMult Num BinOpSub Num Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict Str Str Str NameLoad BinOpDiv Num NameLoad NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call NameLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Call AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Assign NameStore Dict Str Str Str Str NameLoad BinOpDiv Num NameLoad Num Num Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr ExtSlice Index NameLoad Slice keyword Str keyword Str keyword BinOpDiv Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Num Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body If CompareEq BinOpMod NameLoad Num Num body Print Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr ExtSlice Index NameLoad Slice Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareGt NameLoad Num body If CompareLt BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num body Print Str Print Call AttributeLoad NameLoad attr NameLoad Raise Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Print Str AttributeLoad AttributeLoad NameLoad attr attr Print Str SubscriptLoad NameLoad ExtSlice Slice Num Slice Assign NameStore ListLoad Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list Expr Call NameLoad
N/A N/A copy N/A numpy np N/A matplotlib.pyplot plt sklearn.metrics adjusted_mutual_info_score adjusted_rand_score pyhawkes.models DiscreteTimeNetworkHawkesModelSpikeAndSlab DiscreteTimeNetworkHawkesModelGammaMixture pyhawkes.plotting.plotting plot_network test_sbm_mf N/A N/A seed N/A None N/A N/A 
    Create a discrete time Hawkes model and generate from it.

    :return:
     N/A N/A seed None N/A N/A seed N/A N/A N/A np random randint N/A 2 32 N/A Setting seed to  seed N/A N/A N/A N/A np random seed seed N/A C 5 N/A K 100 N/A T 1000 N/A dt 1.0 N/A B 3 N/A p N/A N/A 0.4 N/A N/A np eye C N/A 0.05 N/A 1 N/A N/A np eye C N/A network_hypers N/A C beta p C N/A 1.0 K p N/A true_model N/A DiscreteTimeNetworkHawkesModelSpikeAndSlab K dt dt B B network_hypers network_hypers N/A c N/A N/A true_model network c N/A perm N/A N/A np argsort c N/A N/A N/A plt ion N/A N/A plot_network N/A N/A N/A true_model weight_model A N/A N/A N/A np ix_ perm perm N/A N/A N/A true_model weight_model W N/A N/A N/A np ix_ perm perm N/A N/A N/A plt pause 0.001 N/A test_network_hypers N/A C beta tau0 tau1 C N/A 1.0 K 0.5 0.5 N/A test_model N/A DiscreteTimeNetworkHawkesModelGammaMixture K K dt dt B B network_hypers test_network_hypers N/A N/A N/A N/A test_model weight_model initialize_from_gibbs N/A N/A true_model weight_model A N/A N/A true_model weight_model W N/A N/A N/A plt figure N/A im N/A N/A plt imshow N/A N/A N/A test_model network mf_m N/A N/A perm N/A interpolation none cmap Greys aspect N/A N/A float C K N/A N/A N/A plt xlabel C N/A N/A N/A plt ylabel K N/A N/A N/A plt show N/A N/A N/A plt pause 0.001 N/A N_iters 20 N/A c_samples N/A N/A vlbs N/A N/A itr N/A xrange N_iters N/A N/A N/A N/A itr 5 0 N/A N/A Iteration:  itr N/A N/A N/A im set_data N/A N/A N/A test_model network mf_m N/A N/A perm N/A N/A N/A N/A plt pause 0.001 N/A N/A N/A N/A test_model network resample_from_mf N/A N/A N/A c_samples append N/A N/A copy deepcopy N/A N/A test_model network c N/A N/A N/A vlbs append N/A N/A N/A N/A test_model network get_vlb N/A N/A N/A test_model weight_model get_vlb N/A N/A itr 0 N/A N/A N/A N/A N/A vlbs N/A -1 N/A vlbs N/A -2 -0.001 N/A N/A VLBS are not increasing N/A N/A N/A np array vlbs N/A N/A Exception VLBS are not increasing! N/A N/A N/A N/A test_model network meanfieldupdate N/A test_model weight_model N/A N/A N/A plt ioff N/A c_samples N/A N/A np array c_samples N/A vlbs N/A N/A np array vlbs N/A True c:  N/A N/A true_model network c N/A Test c:  N/A c_samples N/A N/A -10 N/A N/A amis N/A N/A arss N/A N/A c c_samples N/A N/A N/A N/A amis append N/A adjusted_mutual_info_score N/A N/A true_model network c c N/A N/A N/A arss append N/A adjusted_rand_score N/A N/A true_model network c c N/A N/A N/A plt figure N/A N/A N/A plt plot N/A N/A np arange N_iters amis -r N/A N/A N/A plt plot N/A N/A np arange N_iters arss -b N/A N/A N/A plt xlabel Iteration N/A N/A N/A plt ylabel Clustering score N/A N/A N/A plt figure N/A N/A N/A plt plot N/A N/A np arange N_iters vlbs N/A N/A N/A plt xlabel Iteration N/A N/A N/A plt ylabel VLB N/A N/A N/A plt show N/A N/A N/A test_sbm_mf