Hi Hanjun,
I refactored the code to be able to use different objective functions (ESS or CO objectives). The changes are as follow:
Defined an abstract class called, AbstractEvaluator. This class has a method called evaluate which needs to be overridden by any class deriving it. The evaluate method should return the objective function value given the samples. The abstract class is extended by two other classes called ESSevaluator (computes ess) and COevaluator (computes CO models objective).
The experiment class which has been responsible for computing the chains given the model and sampler, now additionally gets an instance of the evaluator class which is used to compute the objective function value by calling the evaluate method. For ESS the objective function evaluation happens at the end of the whole chain generation, for the CO, it's been called in the intermediate steps of the chain generation.
Defined a class called saver which is responsible for plotting and saving the results. Migrated the corresponding part of previous code to this class.
The refactored code was tested. Its performance was validated with the previous code.
Thank you so much and I look forward to the comments.
Hi Hanjun, I refactored the code to be able to use different objective functions (ESS or CO objectives). The changes are as follow: