update pg、predict and add rl
This commit is contained in:
@@ -86,6 +86,7 @@ class PolicyAgent(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)
|
||||
|
||||
Reference in New Issue
Block a user