Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ readme = {file = "README.md", content-type = "text/markdown"}
dependencies = [
"aind_behavior_services>=0.13.5",
"pydantic-settings",
"scikit-learn>=1.8.0",
]

[tool.uv.workspace]
Expand Down
212 changes: 207 additions & 5 deletions schema/aind_behavior_dynamic_foraging.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,56 @@
"type": "object",
"x-sgen-typename": "AllenNeuralDynamics.AindManipulator.AindManipulatorCalibration"
},
"AntiBiasParameters": {
"properties": {
"threshold": {
"$ref": "#/$defs/BiasThreshold",
"default": {
"upper": 0.7,
"lower": 0.3
},
"description": "Thresholds for bias correction intervention."
},
"intervention_interval": {
"default": 10,
"description": "Trials between bias intervention.",
"minimum": 0,
"title": "Intervention Interval",
"type": "integer"
},
"maximum_water_corrections": {
"default": 5,
"description": "Number of water correction to attempt.",
"minimum": 0,
"title": "Maximum Water Corrections",
"type": "integer"
},
"reward_fraction": {
"default": 0.8,
"description": "Fraction of full reward volume delivered during auto water (0=none, 1=full).",
"maximum": 1,
"minimum": 0,
"title": "Reward Fraction",
"type": "number"
},
"bias_window_length": {
"default": 200,
"description": "Trials to calculate bias over.",
"minimum": 0,
"title": "Bias Window Length",
"type": "integer"
},
"lickspout_offset_delta": {
"default": 0.05,
"description": "Distance (mm) to move the stage spouts by. This is a relative distance to the current value, not absolute.",
"minimum": 0,
"title": "Lickspout Offset Delta",
"type": "number"
}
},
"title": "AntiBiasParameters",
"type": "object"
},
"AuditorySecondaryReinforcer": {
"description": "Represents an auditory secondary reinforcer.",
"properties": {
Expand Down Expand Up @@ -511,7 +561,7 @@
"min_unrewarded_trials": 3,
"reward_fraction": 0.8
},
"description": "Auto water settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"description": "Autowater settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"oneOf": [
{
"$ref": "#/$defs/AutoWaterParameters"
Expand All @@ -521,6 +571,28 @@
}
]
},
"antibias_parameters": {
"default": {
"threshold": {
"lower": 0.3,
"upper": 0.7
},
"intervention_interval": 10,
"maximum_water_corrections": 5,
"reward_fraction": 0.8,
"bias_window_length": 200,
"lickspout_offset_delta": 0.05
},
"description": "Antibias settings. If set, trial generator will give water and move lickspouts to combat bias.",
"oneOf": [
{
"$ref": "#/$defs/AntiBiasParameters"
},
{
"type": "null"
}
]
},
"is_baiting": {
"default": false,
"description": "Whether uncollected rewards carry over to the next trial.",
Expand Down Expand Up @@ -656,6 +728,28 @@
"type": "object",
"x-sgen-typename": "AllenNeuralDynamics.AindBehaviorServices.Distributions.BetaDistributionParameters"
},
"BiasThreshold": {
"properties": {
"upper": {
"default": 0.7,
"description": "Absolute value of the upper bias threshold.",
"maximum": 1,
"minimum": 0,
"title": "Upper",
"type": "number"
},
"lower": {
"default": 0.3,
"description": "Absolute value of the lower bias threshold.",
"maximum": 1,
"minimum": 0,
"title": "Lower",
"type": "number"
}
},
"title": "BiasThreshold",
"type": "object"
},
"BinomialDistribution": {
"description": "A binomial probability distribution.\n\nModels the number of successes in a fixed number of independent\nBernoulli trials with constant success probability.",
"properties": {
Expand Down Expand Up @@ -811,7 +905,7 @@
"min_unrewarded_trials": 3,
"reward_fraction": 0.8
},
"description": "Auto water settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"description": "Autowater settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"oneOf": [
{
"$ref": "#/$defs/AutoWaterParameters"
Expand All @@ -821,6 +915,28 @@
}
]
},
"antibias_parameters": {
"default": {
"threshold": {
"lower": 0.3,
"upper": 0.7
},
"intervention_interval": 10,
"maximum_water_corrections": 5,
"reward_fraction": 0.8,
"bias_window_length": 200,
"lickspout_offset_delta": 0.05
},
"description": "Antibias settings. If set, trial generator will give water and move lickspouts to combat bias.",
"oneOf": [
{
"$ref": "#/$defs/AntiBiasParameters"
},
{
"type": "null"
}
]
},
"is_baiting": {
"default": false,
"description": "Whether uncollected rewards carry over to the next trial.",
Expand Down Expand Up @@ -1077,7 +1193,7 @@
"min_unrewarded_trials": 3,
"reward_fraction": 0.8
},
"description": "Auto water settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"description": "Autowater settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"oneOf": [
{
"$ref": "#/$defs/AutoWaterParameters"
Expand All @@ -1087,6 +1203,28 @@
}
]
},
"antibias_parameters": {
"default": {
"threshold": {
"lower": 0.3,
"upper": 0.7
},
"intervention_interval": 10,
"maximum_water_corrections": 5,
"reward_fraction": 0.8,
"bias_window_length": 200,
"lickspout_offset_delta": 0.05
},
"description": "Antibias settings. If set, trial generator will give water and move lickspouts to combat bias.",
"oneOf": [
{
"$ref": "#/$defs/AntiBiasParameters"
},
{
"type": "null"
}
]
},
"is_baiting": {
"default": false,
"description": "Whether uncollected rewards carry over to the next trial.",
Expand Down Expand Up @@ -1266,7 +1404,7 @@
"min_unrewarded_trials": 3,
"reward_fraction": 0.8
},
"description": "Auto water settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"description": "Autowater settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"oneOf": [
{
"$ref": "#/$defs/AutoWaterParameters"
Expand All @@ -1276,6 +1414,28 @@
}
]
},
"antibias_parameters": {
"default": {
"threshold": {
"lower": 0.3,
"upper": 0.7
},
"intervention_interval": 10,
"maximum_water_corrections": 5,
"reward_fraction": 0.8,
"bias_window_length": 200,
"lickspout_offset_delta": 0.05
},
"description": "Antibias settings. If set, trial generator will give water and move lickspouts to combat bias.",
"oneOf": [
{
"$ref": "#/$defs/AntiBiasParameters"
},
{
"type": "null"
}
]
},
"is_baiting": {
"const": true,
"default": true,
Expand Down Expand Up @@ -3403,6 +3563,26 @@
}
]
},
"TrialMetrics": {
"description": "Represents metrics of session",
"properties": {
"bias": {
"default": null,
"description": "Bias of session. Negative values correspond to left bias, positive right.",
"oneOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Bias"
}
},
"title": "TrialMetrics",
"type": "object"
},
"TrialOutcome": {
"description": "Represents the outcome of a single trial.",
"properties": {
Expand Down Expand Up @@ -3586,7 +3766,7 @@
"min_unrewarded_trials": 3,
"reward_fraction": 0.8
},
"description": "Auto water settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"description": "Autowater settings. If set, free water is delivered when the animal exceeds the ignored or unrewarded trial thresholds.",
"oneOf": [
{
"$ref": "#/$defs/AutoWaterParameters"
Expand All @@ -3596,6 +3776,28 @@
}
]
},
"antibias_parameters": {
"default": {
"threshold": {
"lower": 0.3,
"upper": 0.7
},
"intervention_interval": 10,
"maximum_water_corrections": 5,
"reward_fraction": 0.8,
"bias_window_length": 200,
"lickspout_offset_delta": 0.05
},
"description": "Antibias settings. If set, trial generator will give water and move lickspouts to combat bias.",
"oneOf": [
{
"$ref": "#/$defs/AntiBiasParameters"
},
{
"type": "null"
}
]
},
"is_baiting": {
"default": false,
"description": "Whether uncollected rewards carry over to the next trial.",
Expand Down
Loading
Loading