-
Notifications
You must be signed in to change notification settings - Fork 113
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
Environment creates the same scenario between resets #10
Comments
Thanks for bringing up the issue. If a seed is set, I don't think reset should reset the seed as well. For example, in this basic environment, reset won't reset the seed. So the example you show here is expected. But as you said, the environment generates the same episode after changing the seed. This is definitely a bug. I have a temporary fix in my local branch. Will submit the fix soon. Thanks! |
The fix is submitted. Now the results will be like this: import gym
from gym.envs.registration import register
register(
id='simglucose-adult001-v0',
entry_point='simglucose.envs:T1DSimEnv',
kwargs={'patient_name': 'adult#001'}
)
env = gym.make('simglucose-adult001-v0')
env.seed(0)
print(env.reset()) # >>> Observation(CGM=157.25395877711873)
print(env.reset()) # >>> Observation(CGM=157.25395877711873)
env.seed(1)
print(env.reset()) # >>> Observation(CGM=134.48866253152116)
print(env.reset()) # >>> Observation(CGM=134.48866253152116) Note that |
Hi, I am not sure about the fix. Can we discuss it? Is this the intended behavior? If it actually is, could you explain why? Thanks a lot @jxx123
|
@eseglo Thanks for the latest gym document (somehow my old version gym does not document this). I see the problem now. I misunderstood it before. So the requirement is that reset() won't change the seed or random state, but the episode should be different from the previous one after calling reset(). Cool, let me reopen this issue. Will work on a fix soon. Thanks! |
@jxx123 Thank you for trying to fix this! I was using the workaround presented below. Basically, I was changing the seed to the sensor and the scenario every time after I call the
So, if we set these two seeds inside the old I was wondering how else do you plan to generate new episodes without changing these 2 seeds. In my understanding, they are the only sources of randomness in the model outside the random number generators. Could you please explain? It will help expedite my research without having to wait for the fix. On a different note, for research purposes, I am curious about how you've generated the patient information for this simulator. Is it the same as the UVA Padova in silico patient data? I thought that's private information given UVA Padova is a paid simulator. I'm trying to understand the benefits of having the full UVA Padova matlab simulator and which data sources of this simulator I need to change if I get hold of the UVA Padova. Thanks again for your time, effort, and enthusiasm! |
@sumanabasu Thank you so much for your comments!
|
The fix is in. Will make the initial BG settable in another PR. |
Consider this minimal example:
The environment produces the same scenario
Observation(CGM=126.63092222821054)
onreset()
, even on changing the seed unless Imake
the environment again. This shouldn't be the case as it keeps on generating the same episode.Is this a potential bug, or am I missing something here? @jxx123
The text was updated successfully, but these errors were encountered: