Conversation
|
@jingyuanlm please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
| self.node_value_sum: dict[int, float] = {} | ||
| self.node_prior: dict[int, float] = {} | ||
|
|
||
| self.root_id = -1 |
There was a problem hiding this comment.
Make it the class attribute
| # visits = self.node_visit_count.get(node_id, 0) | ||
| # # Avoid div-by-zero; encourage exploration when visits are small | ||
| # return self.c_puct * prior * math.sqrt(max(1, self.global_visit_count)) / (1 + visits) | ||
|
|
There was a problem hiding this comment.
create a new get_parents function
| u = self._get_u(leaf) | ||
| #u = self._get_u(leaf) | ||
| #u = self._get_u_uct(leaf,trace) | ||
| u = self._get_u_uct(leaf, trace) if leaf != self.root_id else self.c_uct * math.sqrt( |
There was a problem hiding this comment.
I think this if else should be placed into the _get_u_uct function.
| if best_leaf == self.root_id: | ||
| capacity = trace.sub_trace_count + self.uncommited_rec_status.get(trace.NEW_ROOT, 0) | ||
| if capacity >= self.max_trace_num: | ||
| # capacity full: pick next best real leaf |
There was a problem hiding this comment.
I think this can be simplified
Description
Motivation and Context
How Has This Been Tested?
Screenshots of Test Results (if appropriate):
Types of changes
📚 Documentation preview 📚: https://RDAgent--1300.org.readthedocs.build/en/1300/