fix more bugs in normalization

This commit is contained in:
Cadene
2024-03-11 11:03:13 +00:00
parent a7ef4a6a33
commit 816b2e9d63
5 changed files with 14 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ class AbstractExperienceReplay(TensorDictReplayBuffer):
return {
("observation", "state"): "b c -> 1 c",
("observation", "image"): "b c h w -> 1 c 1 1",
"action": "b c -> 1 c",
("action",): "b c -> 1 c",
}
@property
@@ -73,8 +73,12 @@ class AbstractExperienceReplay(TensorDictReplayBuffer):
def num_episodes(self) -> int:
return len(self._storage._storage["episode"].unique())
@property
def transform(self):
return self._transform
def set_transform(self, transform):
self.transform = transform
self._transform = transform
def compute_or_load_stats(self, num_batch=100, batch_size=32) -> TensorDict:
stats_path = self.data_dir / "stats.pth"