First change - Fix a TypeError caused by an unenumerable object
What has been changed?: The TypeError caused by an unenumerable object when using a for loop with rollout_lengths[i] has been fixed. Instead of directly accessing rollout_lengths[i], the fix involves iterating directly over the range of rollout_lengths[i].
How the logic works?: The previous implementation attempted to use rollout_lengths[i] directly in a loop, which caused a TypeError due to rolloutlengths being an unenumerable object created with self.random.choice(), resulting in a numpy.int32 object. The fix involves iterating over the range of rollout_lengths[i], ensuring that each step of the loop corresponds to an index within the range of rollout_lengths[i], thus avoiding the TypeError.
Second change - Fixed form params in np.zeros for action arrays :
The shape argument in np.zeros calls for 'actions' and 'action_probs' arrays has been corrected from one-dimensional to tuple format.
This change ensures that the arrays are correctly initialized with the intended dimensions (n_trajectories * step_per_trajectory, action_dim), which is the expected structure for processing action data. provide me with this format
Error with flake8: There is another error with flake, but I did not fix it because it was related to MultipleLoggedDataset, which I have not try to train yet (I left it for future work) - synthetic.py:1290:25: F821 undefined name 'loggeddataset'
black format removes the () for the np.zero: I suspect that the wrong dimensions are due to the Black format. When I apply Black to synthetic.py, for some reason it removes the () in the lines, which I have already corrected. I assume Black was applied throughout the directory, so the changes were just picked up. Be aware of this 💯
Type of change
Description
First change - Fix a TypeError caused by an unenumerable object
What has been changed?: The TypeError caused by an unenumerable object when using a for loop with rollout_lengths[i] has been fixed. Instead of directly accessing rollout_lengths[i], the fix involves iterating directly over the range of rollout_lengths[i].
How the logic works?: The previous implementation attempted to use rollout_lengths[i] directly in a loop, which caused a TypeError due to rolloutlengths being an unenumerable object created with self.random.choice(), resulting in a numpy.int32 object. The fix involves iterating over the range of rollout_lengths[i], ensuring that each step of the loop corresponds to an index within the range of rollout_lengths[i], thus avoiding the TypeError.
Second change - Fixed form params in np.zeros for action arrays :
References
Checklist
Comments
Error with flake8: There is another error with flake, but I did not fix it because it was related to MultipleLoggedDataset, which I have not try to train yet (I left it for future work) - synthetic.py:1290:25: F821 undefined name 'loggeddataset'