Files
Gymnasium/gym/envs/algorithmic/repeat_copy.py

17 lines
532 B
Python
Raw Normal View History

2016-04-27 08:00:58 -07:00
"""
Task is to copy content multiple times from the input tape to
2016-04-27 08:00:58 -07:00
the output tape. http://arxiv.org/abs/1511.07275
"""
import numpy as np
from gym.envs.algorithmic import algorithmic_env
class RepeatCopyEnv(algorithmic_env.TapeAlgorithmicEnv):
MIN_REWARD_SHORTFALL_FOR_PROMOTION = -.1
2016-04-27 08:00:58 -07:00
def __init__(self, base=5):
super(RepeatCopyEnv, self).__init__(base=base, chars=True)
2016-04-27 08:00:58 -07:00
self.last = 50
def target_from_input_data(self, input_data):
return input_data + list(reversed(input_data)) + input_data