forked from octo-models/octo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request octo-models#138 from rail-berkeley/final-dataset-r…
…efactor Dataset refactor pt. ???
- Loading branch information
Showing
37 changed files
with
1,774 additions
and
1,501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""Episode transforms for custom (non-OXE) RLDS datasets to canonical dataset definition.""" | ||
from typing import Any, Dict | ||
|
||
import tensorflow as tf | ||
|
||
|
||
def r2_d2_dataset_transform(trajectory: Dict[str, Any]) -> Dict[str, Any]: | ||
# every input feature is batched, ie has leading batch dimension | ||
trajectory["action"] = tf.concat( | ||
( | ||
trajectory["action_dict"]["cartesian_velocity"], | ||
trajectory["action_dict"]["gripper_velocity"], | ||
), | ||
axis=-1, | ||
) | ||
return trajectory | ||
|
||
|
||
def fmb_dataset_transform(trajectory: Dict[str, Any]) -> Dict[str, Any]: | ||
# every input feature is batched, ie has leading batch dimension | ||
trajectory["observation"]["state"] = tf.concat( | ||
( | ||
trajectory["observation"]["state"], | ||
trajectory["observation"]["gripper_state"][..., None], | ||
), | ||
axis=-1, | ||
) | ||
return trajectory | ||
|
||
|
||
def aloha_dataset_transform(trajectory: Dict[str, Any]) -> Dict[str, Any]: | ||
return trajectory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.