@@ -686,14 +686,20 @@ def plot_activation_per_layer(hyperopt_dataframe):
686686 return fig
687687
688688@figure
689- def plot_cumulative_logp_chi2 (hyperopt_dataframe ):
689+ def plot_cumulative_logp_chi2 (hyperopt_dataframe , commandline_args ):
690+ """
691+ Generate a plot of the running average of the log-likelihood (chi2)
692+ on the left (right) axis as a function of the trial index
693+ """
690694
695+ args = SimpleNamespace (** commandline_args )
696+ chi2max = args .chi2_threshold
691697 results , _ = hyperopt_dataframe
692698 mlogp_ = results ['hyper_loss_logp' ].to_numpy ()
693699 chi2_ = results ['hyper_loss_chi2' ].to_numpy ()
694700
695701 # don t look at samples with -logp or chi2 too big
696- idx_ok = np .where (chi2_ < 5. )
702+ idx_ok = np .where (chi2_ < chi2max )
697703 fig , ax1 = plt .subplots ()
698704 color = 'tab:blue'
699705 mlogp = mlogp_ [idx_ok ]
@@ -715,15 +721,21 @@ def plot_cumulative_logp_chi2(hyperopt_dataframe):
715721 return fig
716722
717723@figure
718- def plot_cumulative_loss (hyperopt_dataframe ):
724+ def plot_cumulative_loss (hyperopt_dataframe , commandline_args ):
725+ """
726+ Generate a plot of the running average of the log-likelihood
727+ as a function of the trial index
728+ """
719729
730+ args = SimpleNamespace (** commandline_args )
731+ chi2exp_max = args .chi2exp_threshold
720732 results , _ = hyperopt_dataframe
721733
722734 mloss_ = results ['loss' ].to_numpy ()
723735 chi2_ = results ['hyper_loss_chi2' ].to_numpy ()
724736 chi2exp = results ['trvl_loss_chi2exp' ].to_numpy ()
725737
726- idx_ok = np .where (chi2exp < 1.35 )
738+ idx_ok = np .where (chi2exp < chi2exp_max )
727739 fig , ax = plt .subplots ()
728740 mloss = mloss_ [idx_ok ]
729741 xlabels = np .arange (len (mloss ))
0 commit comments