You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The upper limit of the action space has the wrong unit. According to your code, the insulin unit input by the simulator is U/min, but in fact the upper limit unit of your pump parameters is U/hour.
defbolus(self, amount):
bol=bol*self.U2PMOL# convert from U/min to pmol/minbol=np.round(bol/self._params['inc_bolus']) *self._params['inc_bolus']
bol=bol/self.U2PMOL# convert from pmol/min to U/minbol=min(bol, self._params['max_bolus'])
bol=max(bol, self._params['min_bolus'])
returnbol
The basal insulin injection rate is usually 1 U/hour, and the bolus is about 10 U/hour. Obviously pump parameters are U/hour, not U/min, which results in the upper limit of the action space being too large and the agent unable to converge.
<style>
</style>
Name
min_bolus
max_bolus
inc_bolus
min_basal
max_basal
inc_basal
sample_time
Cozmo
0
75
0.05
0
35
0.05
1
Insulet
0
30
0.05
0
30
0.05
1
A simple scaling works.
defbolus(self, amount):
bol=amount/60# convert from U/hour to U/minbol=bol*self.U2PMOL# convert from U/min to pmol/minbol=np.round(bol/self._params['inc_bolus']) *self._params['inc_bolus']
bol=bol/self.U2PMOL# convert from pmol/min to U/minbol=min(bol, self._params['max_bolus'])
bol=max(bol, self._params['min_bolus'])
returnbol
Scenario setting error
I use gym to implement simglucose, but the CHO intake is inconsistent with my scenario settings.(Code was modified to customize the termination condition, just ignore it)
I set start time at 0:00, and the rendering is OK. It seems that start time of the scenario setting does not take effect during simulation, but it has an impact on the coordinate axes. Maybe you should check the start time in CustomScenario.
Insulin unit error
The upper limit of the action space has the wrong unit. According to your code, the insulin unit input by the simulator is U/min, but in fact the upper limit unit of your pump parameters is U/hour.
The basal insulin injection rate is usually 1 U/hour, and the bolus is about 10 U/hour. Obviously pump parameters are U/hour, not U/min, which results in the upper limit of the action space being too large and the agent unable to converge.
<style> </style>A simple scaling works.
Scenario setting error
I use gym to implement simglucose, but the CHO intake is inconsistent with my scenario settings.(Code was modified to customize the termination condition, just ignore it)
No CHO at 7:00.
The text was updated successfully, but these errors were encountered: