@@ -4,6 +4,8 @@ export estimate_parameters!,
44 update_pc_params_from_pbc!,
55 estimate_parameters_em_multi_epochs!
66
7+
8+ using DirectedAcyclicGraphs: parent_stats
79using LogicCircuits: num_nodes
810using StatsFuns: logsumexp, logaddexp, logsubexp
911using CUDA
@@ -482,27 +484,27 @@ function estimate_parameters_em_multi_epochs!(circuit::ProbCircuit, train_data;
482484 println (stat)
483485 end
484486 println (" ----Parent Stats-----" )
485- for stat in LogicCircuits . Utils . parent_stats (circuit)
487+ for stat in parent_stats (circuit)
486488 println (stat)
487489 end
488490 end
489491
490492 epoch_callback (iter_name, iter, total_iter, t) = begin
491493 if verbose & (iter % verbose_log_rate == 0 )
492494 t = round (t, digits= 2 )
493- print (" [$iter_name Iter $(iter) /$(total_iter) ; took $(t) s]" )
495+ print (" [$iter_name Iter $(iter) /$(total_iter) ; last iter took $(t) s]" )
494496 t = @elapsed begin
495497 train_ll = marginal_log_likelihood_avg (pbc, train_data)
496498 valid_ll = isnothing (valid_data) ? nothing : marginal_log_likelihood_avg (pbc, valid_data)
497499 test_ll = isnothing (test_data) ? nothing : marginal_log_likelihood_avg (pbc, test_data)
498500 end
499501 t = round (t, digits= 2 )
500- println (" [Marginal log-likelihoods Avg took $(t) s; train $(train_ll) , valid $(valid_ll) , test $(test_ll) ]" )
502+ println (" [Marginal log-likelihoods Avg last iter took $(t) s; train $(train_ll) , valid $(valid_ll) , test $(test_ll) ]" )
501503 end
502504 if ! isnothing (save_path) && (iter % save_rate == 0 )
503505 update_pc_params_from_pbc! (circuit, pbc)
504506 if verbose
505- println (" \t - Saving circuit at $(save_path) " )
507+ println (" - Saving circuit at $(save_path) " )
506508 write (save_path, circuit)
507509 end
508510 end
0 commit comments