-
Notifications
You must be signed in to change notification settings - Fork 1
feat: undersample episodes by loss distribution #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
naidenovaleksei
wants to merge
11
commits into
main
Choose a base branch
from
alex/loss-resampling-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c40dda3
add sampling by loss
naidenovaleksei daee2ed
add optional filtration and sampling
naidenovaleksei 094e5a4
add headings in input
naidenovaleksei 50ee04b
refactoring
naidenovaleksei f3823d0
refactor configs for policy
naidenovaleksei 2642f97
add pretrained loss calculation
naidenovaleksei 8e6484a
refactoring
naidenovaleksei 40ca57c
fix pretrained sampling
naidenovaleksei e1eabca
allow enable/disable resampling
naidenovaleksei 9359bce
Merge branch 'main' into alex/loss-resampling-pr
naidenovaleksei c9299d6
fix test with logit_bias
naidenovaleksei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -156,7 +156,7 @@ CLAUDE.md | |
|
|
||
| # artifacts | ||
| inference_results/ | ||
| .rbyte_cache | ||
| .rbyte_cache* | ||
|
|
||
| .dprint.json | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,17 @@ | ||
| --- | ||
| defaults: | ||
| - /dataset/yaak/train@predict.dataset | ||
| - _self_ | ||
|
|
||
| _target_: rmind.datamodules.GenericDataModule | ||
| predict: | ||
| _target_: rbyte.dataloader.TorchDataNodeDataLoader | ||
| batch_size: 128 | ||
| shuffle: false | ||
| collate_fn: | ||
| _target_: rbyte.types.Batch.to_dict | ||
| _partial_: true | ||
|
|
||
| num_workers: 2 | ||
| pin_memory: true | ||
| method: thread |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
37 changes: 37 additions & 0 deletions
37
config/inference/yaak/control_transformer/policy_loss_only.yaml
This file contains hidden or 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,37 @@ | ||
| # @package _global_ | ||
| --- | ||
| defaults: | ||
| - /model: yaak/control_transformer/finetuned | ||
| - /datamodule: yaak/predict | ||
| - /paths: yaak/default | ||
| - /logger: yaak/rerun/prediction_policy | ||
| - _self_ | ||
|
|
||
| trainer: | ||
| _target_: pytorch_lightning.Trainer | ||
| _convert_: all | ||
| accelerator: gpu | ||
| devices: 1 | ||
| benchmark: true | ||
| precision: "bf16-mixed" | ||
| logger: false | ||
| callbacks: | ||
| - _target_: rmind.callbacks.PredictionConfigSetter | ||
| config: | ||
| objectives: | ||
| - loss | ||
|
|
||
| - _target_: rmind.callbacks.DataFramePredictionWriter | ||
| write_interval: batch | ||
| path: ${hydra:run.dir}/predictions/${oc.select:model.artifact,}/{batch_idx:06}.parquet | ||
| final_path: ${oc.select:scores_output} | ||
| select: | ||
| - [batch, data, meta/sample_id] | ||
| - [batch, data, meta/ImageMetadata.cam_front_left/time_stamp] | ||
| - [batch, data, meta/ImageMetadata.cam_front_left/frame_idx] | ||
| - [policy, loss, value] | ||
| writer: | ||
| _target_: polars.DataFrame.write_parquet | ||
| _partial_: true | ||
| - _target_: pytorch_lightning.callbacks.ModelSummary | ||
| max_depth: 5 |
39 changes: 39 additions & 0 deletions
39
config/inference/yaak/control_transformer/pretrained_loss_only.yaml
This file contains hidden or 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,39 @@ | ||
| # @package _global_ | ||
| --- | ||
| defaults: | ||
| - /model: yaak/control_transformer/pretrained | ||
| - /datamodule: yaak/predict | ||
| - /paths: yaak/default | ||
| - /logger: yaak/rerun/prediction_pretrain | ||
| - _self_ | ||
|
|
||
| trainer: | ||
| _target_: pytorch_lightning.Trainer | ||
| _convert_: all | ||
| accelerator: gpu | ||
| devices: 1 | ||
| benchmark: true | ||
| precision: "bf16-mixed" | ||
| logger: false | ||
| callbacks: | ||
| - _target_: rmind.callbacks.PredictionConfigSetter | ||
| config: | ||
| objectives: | ||
| - loss | ||
|
|
||
| - _target_: rmind.callbacks.DataFramePredictionWriter | ||
| write_interval: batch | ||
| path: ${hydra:run.dir}/predictions/${oc.select:model.artifact,}/{batch_idx:06}.parquet | ||
| final_path: ${oc.select:scores_output} | ||
| select: | ||
| - [batch, data, meta/sample_id] | ||
| - [batch, data, meta/ImageMetadata.cam_front_left/time_stamp] | ||
| - [batch, data, meta/ImageMetadata.cam_front_left/frame_idx] | ||
| - [inverse_dynamics, loss, value] | ||
| - [forward_dynamics, loss, value] | ||
| - [memory_extraction, loss, value] | ||
| writer: | ||
| _target_: polars.DataFrame.write_parquet | ||
| _partial_: true | ||
| - _target_: pytorch_lightning.callbacks.ModelSummary | ||
| max_depth: 5 |
This file contains hidden or 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,11 @@ | ||
| select: | ||
| - "policy/loss/value/continuous/gas_pedal" | ||
| - "policy/loss/value/continuous/brake_pedal" | ||
| - "policy/loss/value/continuous/steering_angle" | ||
| - "policy/loss/value/discrete/turn_signal" | ||
|
|
||
| columns: | ||
| - "policy/loss/value/continuous/gas_pedal" | ||
| - "policy/loss/value/continuous/brake_pedal" | ||
| - "policy/loss/value/continuous/steering_angle" | ||
| - "policy/loss/value/discrete/turn_signal" |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please collect statistics how the new filter affects the number of episodes to ensure we are not accidentally dropping high signal datapoints