-
Notifications
You must be signed in to change notification settings - Fork 0
Feat adding curriculum #52
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
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
b562098
starts on coupled baiting curriculum
micahwoodard 8ad3f02
adds coupled baiting curriculum
micahwoodard 34a649c
adds unit tests
micahwoodard e53258c
adds tests
micahwoodard daddc4f
lints
micahwoodard f2e8b9b
merges with main
micahwoodard 7d3deba
seperate curriculum
micahwoodard 1be3c90
upath comment
micahwoodard c2b2519
merges with main
micahwoodard ac0c587
removes whitespace
micahwoodard 2022b71
fixes formatting
micahwoodard 7234afc
fixes pyproject.toml
micahwoodard fd495f9
updates uv lock
micahwoodard db5ad04
adds computing metrics from dataset
micahwoodard ba513f2
adds stage_changes flag
micahwoodard 8ad1ad1
adds basic unit tests
micahwoodard 4bce296
updates coupled stages
micahwoodard 59a7927
updates tests
micahwoodard fdb5ddb
computes metrics with previous metrics and trainer state contained in…
micahwoodard 7f39253
restuctures project
micahwoodard 6f6fc65
rounds distribution rates
micahwoodard 582ec35
updates readme
micahwoodard 2821f59
runs codespell
micahwoodard 46ca96d
fixes example
micahwoodard 27cfbf2
updates quiescent period
micahwoodard d45c445
remove test
micahwoodard 3d0030c
replaces dashes with underscores
micahwoodard 2b33e38
regenerates
micahwoodard 6b62c59
adds trainer state model
micahwoodard 851529e
Update aind-behavior-services to generate sgen references
bruno-f-cruz 41e13f0
Update packages and install missing distributions package
bruno-f-cruz aa198a3
Add missing scripting references
bruno-f-cruz 49a66d4
Update references to manipulator calibration
bruno-f-cruz e359915
updates metrics from dataset
micahwoodard db3a34d
Merge branch 'feat-adding-curriculum' of github.com:AllenNeuralDynami…
micahwoodard 8f91f4d
regenerates
micahwoodard 2ad6167
Merge branch 'main' into feat-adding-curriculum
micahwoodard efddded
regenerates
micahwoodard 9b419e2
adds version
micahwoodard d82c0f2
fixes warmup bug
micahwoodard db65298
restructures and gurads update calculate metrics
micahwoodard 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
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,37 @@ | ||
| import logging | ||
| import os | ||
|
|
||
| from aind_behavior_dynamic_foraging.data_contract import dataset as df_foraging_dataset | ||
| from aind_behavior_dynamic_foraging.task_logic.trial_generators.warmup_trial_generator import WarmupTrialGeneratorSpec | ||
| from aind_behavior_dynamic_foraging.task_logic.trial_models import TrialOutcome | ||
|
|
||
| logging.basicConfig( | ||
| level=logging.DEBUG, | ||
| ) | ||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def walk_through_session(data_directory: os.PathLike): | ||
| dataset = df_foraging_dataset(data_directory) | ||
| software_events = dataset["Behavior"]["SoftwareEvents"] | ||
| software_events.load_all() | ||
|
|
||
| trial_outcomes = software_events["TrialOutcome"].data["data"].iloc | ||
| warmup_trial_generator = WarmupTrialGeneratorSpec().create_generator() | ||
| for i, outcome in enumerate(trial_outcomes): | ||
| warmup_trial_generator.update(TrialOutcome.model_validate(outcome)) | ||
| trial = warmup_trial_generator.next() | ||
|
|
||
| if not trial: | ||
| print(f"Session finished at trial {i}") | ||
| return | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| import argparse | ||
|
|
||
| parser = argparse.ArgumentParser(description="Walk through a behavior session.") | ||
| parser.add_argument("--data-directory", help="Path to the session directory") | ||
| args = parser.parse_args() | ||
|
|
||
| walk_through_session(args.data_directory) |
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
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.
What I had in mind was slightly different. I think we could just move the curriculum package to ./src and use that as the workspace root instead. I think it makes the organization a bit more uniform and easier to follow.