mirror of
https://github.com/wassname/DeepRL.git
synced 2026-09-09 11:13:47 +08:00
Update ACVP
This commit is contained in:
@@ -302,8 +302,8 @@ def action_conditional_video_prediction():
|
|||||||
# a2c_pixel_atari(game)
|
# a2c_pixel_atari(game)
|
||||||
|
|
||||||
# Generate a dataset with the trained model
|
# Generate a dataset with the trained model
|
||||||
a2c_model_file = './data/A2CAgent-vanilla-model-%s.bin' % (game)
|
# a2c_model_file = './data/A2CAgent-vanilla-model-%s.bin' % (game)
|
||||||
generate_dataset(game, a2c_model_file, prefix)
|
# generate_dataset(game, a2c_model_file, prefix)
|
||||||
|
|
||||||
# Train the action conditional video prediction model
|
# Train the action conditional video prediction model
|
||||||
acvp_train(game, prefix)
|
acvp_train(game, prefix)
|
||||||
@@ -334,7 +334,7 @@ if __name__ == '__main__':
|
|||||||
# ddpg_continuous()
|
# ddpg_continuous()
|
||||||
# ppo_continuous()
|
# ppo_continuous()
|
||||||
|
|
||||||
action_conditional_video_prediction()
|
# action_conditional_video_prediction()
|
||||||
|
|
||||||
# plot()
|
# plot()
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
# declaration at the top #
|
# declaration at the top #
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
|
__all__ = ['acvp_train']
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
from torch.autograd import Variable
|
from torch.autograd import Variable
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ def generate_dataset(game, a2c_model, prefix):
|
|||||||
config.gradient_clip = 0.5
|
config.gradient_clip = 0.5
|
||||||
config.logger = Logger('./log', logger, skip=True)
|
config.logger = Logger('./log', logger, skip=True)
|
||||||
agent = A2CAgent(config)
|
agent = A2CAgent(config)
|
||||||
|
agent.close()
|
||||||
|
|
||||||
agent.load(a2c_model)
|
agent.load(a2c_model)
|
||||||
task = PixelAtari(game, frame_skip=4, history_length=4, log_dir=None, dataset=True)
|
task = PixelAtari(game, frame_skip=4, history_length=4, log_dir=None, dataset=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user