-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElasticArraySARTSTraces does not record the trajectories of MountainCarEnv()
correctly
#1067
Comments
Strange, could this be due to JuliaReinforcementLearning/ReinforcementLearningTrajectories.jl#66 @jeremiahpslewis ? |
I can't reproduce the error; there's a minor bug in the example code, this is what I have: mcenv = MountainCarEnv(; power=0.01, gravity=0.0)
agentmc = Agent(
policy = RandomPolicy(),
trajectory = Trajectory(
ElasticArraySARTSTraces(;
state = Float64 => (2,),
action = Int64 => (),
reward = Float64 => (),
terminal = Bool => (),
),
DummySampler(),
InsertSampleRatioController(),
)
)
run(agentmc, mcenv, StopAfterNSteps(5), TotalRewardPerEpisode());
agentmc.trajectory.container julia> agentmc.trajectory.container[:state]
5-element RelativeTrace:
[-0.5277521900779774, 0.0]
[-0.5177521900779773, 0.01]
[-0.49775219007797733, 0.02]
[-0.4677521900779773, 0.03]
[-0.4377521900779773, 0.03] |
@Van314159 Can you please try my example code, perhaps using a fresh environment? |
I reproduced by copy pasting OP's code. But yes indeed I did not notice the state trace was not correctly configured. |
Though, this should raise an error instead of silently failing. |
Note: same issue with |
@jeremiahpslewis Anyway, thank you very much! |
ElasticArraySARTSTraces
works perfectly in RandomWalk1D environment, but it does not record the trajectories ofMountainCarEnv()
correctly. It replaces the state in every step by the final state. My code is :It returns
I guess the problem is on the
push!(agent, PostActStage(), env, action)
.My Julia and package versions are
The text was updated successfully, but these errors were encountered: