(self, iter_nr)
assumes same action space between all eval agents!!
assumes same action space between all eval agents!!
assumes same action space between all eval agents!!
def evaluate(self, iter_nr):
        """ assumes same action space between all eval agents!! """

        if self._is_multi_stack:
            total_of_all_stacks = []
            pm_of_all_stacks = []

        for stack_size_idx, stack_size in enumerate(self._t_prof.eval_stack_sizes):
            for e in self._eval_agents:
                e.set_stack_size(stack_size=stack_size)

            do_it = True
            for e in self._eval_agents:
                if not e.can_compute_mode():
                    do_it = False
                    break

            if do_it:
                mean, d = self._run_eval(stack_size=stack_size)
                self._log_results(iter_nr=iter_nr,
                                  agent_mode=self._eval_agents[self._REFERENCE_AGENT].get_mode(),
                                  stack_size_idx=stack_size_idx,
                                  score=mean, upper_conf95=mean + d, lower_conf95=mean - d)

            if self._is_multi_stack:
                total_of_all_stacks.append(mean)
                pm_of_all_stacks.append(d)

        if self._is_multi_stack:
            _mean = sum(total_of_all_stacks) / float(len(total_of_all_stacks))
            _d = sum(pm_of_all_stacks) / float(len(pm_of_all_stacks))
            self._log_multi_stack(agent_mode="Head2Head",
                                  iter_nr=iter_nr,
                                  score_total=_mean,
                                  lower_conf95=_mean - _d,
                                  upper_conf95=_mean + _d,
                                  )
def evaluate ( self , iter_nr ) : if self . _is_multi_stack : total_of_all_stacks = [ ] pm_of_all_stacks = [ ] for stack_size_idx , stack_size in enumerate ( self . _t_prof . eval_stack_sizes ) : for e in self . _eval_agents : e . set_stack_size ( stack_size = stack_size ) do_it = True for e in self . _eval_agents : if not e . can_compute_mode ( ) : do_it = False break if do_it : mean , d = self . _run_eval ( stack_size = stack_size ) self . _log_results ( iter_nr = iter_nr , agent_mode = self . _eval_agents [ self . _REFERENCE_AGENT ] . get_mode ( ) , stack_size_idx = stack_size_idx , score = mean , upper_conf95 = mean + d , lower_conf95 = mean - d ) if self . _is_multi_stack : total_of_all_stacks . append ( mean ) pm_of_all_stacks . append ( d ) if self . _is_multi_stack : _mean = sum ( total_of_all_stacks ) / float ( len ( total_of_all_stacks ) ) _d = sum ( pm_of_all_stacks ) / float ( len ( pm_of_all_stacks ) ) self . _log_multi_stack ( agent_mode = "Head2Head" , iter_nr = iter_nr , score_total = _mean , lower_conf95 = _mean - _d , upper_conf95 = _mean + _d , )