wait for further opt
This commit is contained in:
@ -73,6 +73,9 @@ class PacmanDeepQAgent(PacmanQAgent):
|
|||||||
else:
|
else:
|
||||||
print("Initializing new model parameters")
|
print("Initializing new model parameters")
|
||||||
def save_model(self, filename="para.bin"):
|
def save_model(self, filename="para.bin"):
|
||||||
|
if model.kProductionMode:
|
||||||
|
print("in production mode, not saving model")
|
||||||
|
return
|
||||||
print(f"Saving model parameters to {filename}")
|
print(f"Saving model parameters to {filename}")
|
||||||
torch.save({
|
torch.save({
|
||||||
'model_state_dict': self.model.state_dict(),
|
'model_state_dict': self.model.state_dict(),
|
||||||
|
@ -11,7 +11,7 @@ from torch import tensor, double, optim
|
|||||||
from torch.nn.functional import relu, mse_loss
|
from torch.nn.functional import relu, mse_loss
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
kProductionMode=True
|
kProductionMode=False
|
||||||
class DeepQNetwork(Module):
|
class DeepQNetwork(Module):
|
||||||
"""
|
"""
|
||||||
A model that uses a Deep Q-value Network (DQN) to approximate Q(s,a) as part
|
A model that uses a Deep Q-value Network (DQN) to approximate Q(s,a) as part
|
||||||
|
Reference in New Issue
Block a user