Related to Fixing errors with _obtain_steps function #27 #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 rollout_lengths 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 'logged_dataset_'
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 💯