update pg、predict and add rl

This commit is contained in:
2023-05-30 18:48:27 +08:00
parent 6abf9246c6
commit 41c70802fd
9 changed files with 488 additions and 2 deletions
+2 -1
View File
@@ -43,6 +43,7 @@ class DeepLearningAgent(Agent):
@classmethod
def load(cls, path, encoder):
model = AlphaGoModel(encoder.get_input_shape(), is_policy_net=True).to('cuda')
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = AlphaGoModel(encoder.get_input_shape(), is_policy_net=True).to(device)
model.load_state_dict(torch.load(path))
return cls(model, encoder)