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
I copy a code that writes the get_obs() as follows. However the state = self.env.task.obs() return the global observation. However, the base_task.py only give the obs(), which reture the global obs. This mean the training and execution are conducted under centrialized-training-centrialized-execution framework. But, I want the centrialized-training-decentrialized-execution framwork. Therfore, is there any methods to get the local observation of each agent?
Here is the code (get_obs() ):
_def get_obs(self):
state = self.env.task.obs() # This is global obs.
obs_n = []
for a in range(self.num_agents):
agent_id_feats = np.zeros(self.num_agents, dtype=np.float32)
agent_id_feats[a] = 1.0
obs_i = np.concatenate([state, agent_id_feats])
obs_i = (obs_i - np.mean(obs_i)) / (np.std(obs_i) + 1e-8)
obs_n.append(obs_i)
return obs_n
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I copy a code that writes the get_obs() as follows. However the state = self.env.task.obs() return the global observation. However, the base_task.py only give the obs(), which reture the global obs. This mean the training and execution are conducted under centrialized-training-centrialized-execution framework. But, I want the centrialized-training-decentrialized-execution framwork. Therfore, is there any methods to get the local observation of each agent?
Here is the code (get_obs() ):
_def get_obs(self):
state = self.env.task.obs() # This is global obs.
obs_n = []
for a in range(self.num_agents):
agent_id_feats = np.zeros(self.num_agents, dtype=np.float32)
agent_id_feats[a] = 1.0
obs_i = np.concatenate([state, agent_id_feats])
obs_i = (obs_i - np.mean(obs_i)) / (np.std(obs_i) + 1e-8)
obs_n.append(obs_i)
return obs_n
Beta Was this translation helpful? Give feedback.
All reactions