Skip to content

Commit 1e1520b

Browse files
committed
fix bug in state switching env
1 parent 2b7676e commit 1e1520b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neurolib/control/reinforcement_learning/environments/state_switching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def reset(self, seed=None, options=None):
105105
def _loss(self, obs, action):
106106
control_loss = abs(self.targetstate[0] - obs["exc"].item()) + abs(self.targetstate[1] - obs["inh"].item())
107107
control_strength_loss = np.abs(action).sum() * self.l1_control_strength_loss_scale
108-
control_strength_loss += np.sqrt(np.sum(action**2)) * self.l2_control_strength_loss_scale
108+
control_strength_loss += np.sqrt(np.sum(np.square(action))) * self.l2_control_strength_loss_scale
109109
return control_loss + control_strength_loss
110110

111111
def step(self, action):

0 commit comments

Comments
 (0)