Skip to content

Commit 0eb3bb2

Browse files
committed
update examples with upper/lower bounds
1 parent a84a0dd commit 0eb3bb2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/brax_with_goals.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
{
3434
"cell_type": "code",
35-
"execution_count": 2,
35+
"execution_count": null,
3636
"metadata": {},
3737
"outputs": [
3838
{
@@ -46,7 +46,7 @@
4646
"source": [
4747
"seed = 0\n",
4848
"context_distributions = [\n",
49-
" NormalFloatContextFeature(\"target_distance\", mu=9.8, sigma=1),\n",
49+
" NormalFloatContextFeature(\"target_distance\", mu=9.8, sigma=1, upper=50, lower=0),\n",
5050
" CategoricalContextFeature(\"target_direction\", choices=directions),\n",
5151
"]\n",
5252
"context_sampler = ContextSampler(\n",
@@ -119,7 +119,7 @@
119119
},
120120
{
121121
"cell_type": "code",
122-
"execution_count": 6,
122+
"execution_count": null,
123123
"metadata": {},
124124
"outputs": [
125125
{
@@ -134,8 +134,8 @@
134134
],
135135
"source": [
136136
"context_distributions = [\n",
137-
" NormalFloatContextFeature(\"goal_position_x\", mu=9.8, sigma=1),\n",
138-
" NormalFloatContextFeature(\"goal_position_y\", mu=9.8, sigma=1),\n",
137+
" NormalFloatContextFeature(\"goal_position_x\", mu=9.8, sigma=1, upper=50, lower=0),\n",
138+
" NormalFloatContextFeature(\"goal_position_y\", mu=9.8, sigma=1, upper=50, lower=0),\n",
139139
"]\n",
140140
"context_sampler = ContextSampler(\n",
141141
" context_distributions=context_distributions,\n",

examples/carl_with_sb3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from carl.context.sampler import ContextSampler
99

1010
# Create environment
11-
context_distributions = [NormalFloatContextFeature("GRAVITY_X", mu=9.8, sigma=1)]
11+
context_distributions = [NormalFloatContextFeature("GRAVITY_X", mu=9.8, sigma=1, upper=50, lower=0)]
1212
context_sampler = ContextSampler(
1313
context_distributions=context_distributions,
1414
context_space=CARLLunarLander.get_context_space(),

examples/sample_contexts_with_brax.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
},
8282
{
8383
"cell_type": "code",
84-
"execution_count": 3,
84+
"execution_count": null,
8585
"metadata": {},
8686
"outputs": [
8787
{
@@ -94,7 +94,7 @@
9494
],
9595
"source": [
9696
"seed = 0\n",
97-
"context_distributions = [NormalFloatContextFeature(\"gravity\", mu=9.8, sigma=1)]\n",
97+
"context_distributions = [NormalFloatContextFeature(\"gravity\", mu=9.8, sigma=1, upper=50, lower=0)]\n",
9898
"context_sampler = ContextSampler(\n",
9999
" context_distributions=context_distributions,\n",
100100
" context_space=CARLBraxAnt.get_context_space(),\n",

0 commit comments

Comments
 (0)