Skip to content

Commit

Permalink
polish(pu): polish config
Browse files Browse the repository at this point in the history
  • Loading branch information
puyuan1996 committed Jan 27, 2025
1 parent 08e264a commit 7fde0e4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
5 changes: 0 additions & 5 deletions lzero/mcts/buffer/game_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,10 @@ def _push_game_segment(self, data: Any, meta: Optional[dict] = None) -> None:
# print(f'valid_len is {valid_len}')

if meta['priorities'] is None:
# try:
if self.game_segment_buffer:
max_prio = self.game_pos_priorities.max() if len(self.game_pos_priorities) > 0 else 1
else:
max_prio = 1
# except Exception as e:
# print(e)
# print(f'self.game_pos_priorities:{self.game_pos_priorities}')
# print(f'self.game_segment_buffer:{self.game_segment_buffer}')

# if no 'priorities' provided, set the valid part of the new-added game history the max_prio
self.game_pos_priorities = np.concatenate((self.game_pos_priorities, [max_prio for _ in range(valid_len)] + [0. for _ in range(valid_len, data_length)]))
Expand Down
1 change: 0 additions & 1 deletion lzero/model/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
# for atari 64,8,8 = 4096 -> 768
x = self.sim_norm(x)


return x


Expand Down
5 changes: 1 addition & 4 deletions lzero/model/sampled_muzero_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@

import torch
import torch.nn as nn
from ding.model.common import ReparameterizationHead
from ding.torch_utils import MLP
from ding.utils import MODEL_REGISTRY, SequenceType

from .common import MZNetworkOutput, RepresentationNetwork
from .sampled_efficientzero_model import PredictionNetwork

from .muzero_model import DynamicsNetwork
from .sampled_efficientzero_model import PredictionNetwork
from .utils import renormalize


Expand Down

0 comments on commit 7fde0e4

Please sign in to comment.