continual-foragax 0.37.0__py3-none-any.whl → 0.38.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {continual_foragax-0.37.0.dist-info → continual_foragax-0.38.0.dist-info}/METADATA +1 -1
- {continual_foragax-0.37.0.dist-info → continual_foragax-0.38.0.dist-info}/RECORD +7 -7
- foragax/env.py +10 -1
- foragax/registry.py +18 -0
- {continual_foragax-0.37.0.dist-info → continual_foragax-0.38.0.dist-info}/WHEEL +0 -0
- {continual_foragax-0.37.0.dist-info → continual_foragax-0.38.0.dist-info}/entry_points.txt +0 -0
- {continual_foragax-0.37.0.dist-info → continual_foragax-0.38.0.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
foragax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
foragax/colors.py,sha256=rqNPiywP4Nvr0POhsGpasRk-nMMTS3DOwFRUgperlUk,2065
|
|
3
|
-
foragax/env.py,sha256=
|
|
3
|
+
foragax/env.py,sha256=9EB02GgSc80KRjj35z_UyM4VXTGuyHBAHX3d9M5AvY0,66966
|
|
4
4
|
foragax/objects.py,sha256=aVc7lD3CTyRP9wm_Vs93qo4l_B1kbiYGKPtkd_SVXjs,27061
|
|
5
|
-
foragax/registry.py,sha256=
|
|
5
|
+
foragax/registry.py,sha256=u8mv5mPTHKRsIE7FTi36J5tXp3FuVJ-AmJRb7HWW9hI,20636
|
|
6
6
|
foragax/rendering.py,sha256=bms7wvBZTofoR-K-2QD2Ggeed7Viw8uwAEiEpEM3eSo,2768
|
|
7
7
|
foragax/weather.py,sha256=KNAiwuFz8V__6G75vZIWQKPocLzXqxXn-Vt4TbHIpcA,1258
|
|
8
8
|
foragax/data/ECA_non-blended_custom/TG_SOUID100897.txt,sha256=N7URbX6VlCZvCboUogYjMzy1I-0cfNPOn0QTLSHHfQ0,1776751
|
|
@@ -128,8 +128,8 @@ foragax/data/ECA_non-blended_custom/TG_SOUID156887.txt,sha256=juzTPgJoJxfqmZkorL
|
|
|
128
128
|
foragax/data/ECA_non-blended_custom/elements.txt,sha256=OtcUBoDAHxuln79BPKGu0tsQxG_5G2BfAX3Ck130kEA,4507
|
|
129
129
|
foragax/data/ECA_non-blended_custom/metadata.txt,sha256=nudnmOCy5cPJfSXt_IjyX0S5-T7NkCZREICZSimqeqc,48260
|
|
130
130
|
foragax/data/ECA_non-blended_custom/sources.txt,sha256=1j3lSmINAoCMqPqFrHfZJriOz6sTYZNOhXzUwvTLas0,20857
|
|
131
|
-
continual_foragax-0.
|
|
132
|
-
continual_foragax-0.
|
|
133
|
-
continual_foragax-0.
|
|
134
|
-
continual_foragax-0.
|
|
135
|
-
continual_foragax-0.
|
|
131
|
+
continual_foragax-0.38.0.dist-info/METADATA,sha256=ODZtbDZHv2GRj0yRC4rR34Hu0PaN_8e4Oo8XPmhWGxU,4713
|
|
132
|
+
continual_foragax-0.38.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
133
|
+
continual_foragax-0.38.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
|
|
134
|
+
continual_foragax-0.38.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
|
|
135
|
+
continual_foragax-0.38.0.dist-info/RECORD,,
|
foragax/env.py
CHANGED
|
@@ -132,6 +132,7 @@ class ForagaxEnv(environment.Environment):
|
|
|
132
132
|
observation_type: str = "object",
|
|
133
133
|
dynamic_biomes: bool = False,
|
|
134
134
|
biome_consumption_threshold: float = 0.9,
|
|
135
|
+
dynamic_biome_spawn_empty: float = 0.0,
|
|
135
136
|
max_expiries_per_step: int = 1,
|
|
136
137
|
):
|
|
137
138
|
super().__init__()
|
|
@@ -156,6 +157,7 @@ class ForagaxEnv(environment.Environment):
|
|
|
156
157
|
self.teleport_interval = teleport_interval
|
|
157
158
|
self.dynamic_biomes = dynamic_biomes
|
|
158
159
|
self.biome_consumption_threshold = biome_consumption_threshold
|
|
160
|
+
self.dynamic_biome_spawn_empty = dynamic_biome_spawn_empty
|
|
159
161
|
if max_expiries_per_step < 1:
|
|
160
162
|
raise ValueError("max_expiries_per_step must be at least 1")
|
|
161
163
|
self.max_expiries_per_step = max_expiries_per_step
|
|
@@ -888,7 +890,7 @@ class ForagaxEnv(environment.Environment):
|
|
|
888
890
|
biome_freqs = self.biome_object_frequencies[biome_idx]
|
|
889
891
|
biome_mask = self.biome_masks_array[biome_idx]
|
|
890
892
|
|
|
891
|
-
key, spawn_key, color_key, params_key = jax.random.split(key,
|
|
893
|
+
key, spawn_key, color_key, params_key, dropout_key = jax.random.split(key, 5)
|
|
892
894
|
|
|
893
895
|
# Generate object IDs using deterministic or random spawn
|
|
894
896
|
if deterministic:
|
|
@@ -927,6 +929,13 @@ class ForagaxEnv(environment.Environment):
|
|
|
927
929
|
jnp.searchsorted(cumulative_freqs, grid_rand, side="right") - 1
|
|
928
930
|
)
|
|
929
931
|
|
|
932
|
+
# Apply random dropout if configured
|
|
933
|
+
if self.dynamic_biome_spawn_empty > 0:
|
|
934
|
+
dropout_mask = jax.random.bernoulli(
|
|
935
|
+
dropout_key, 1.0 - self.dynamic_biome_spawn_empty, object_grid.shape
|
|
936
|
+
)
|
|
937
|
+
object_grid = jnp.where(dropout_mask, object_grid, 0)
|
|
938
|
+
|
|
930
939
|
# Initialize color grid
|
|
931
940
|
color_grid = jnp.full((self.size[1], self.size[0], 3), 255, dtype=jnp.uint8)
|
|
932
941
|
|
foragax/registry.py
CHANGED
|
@@ -143,6 +143,17 @@ ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
|
|
|
143
143
|
"dynamic_biomes": True,
|
|
144
144
|
"biome_consumption_threshold": 1000,
|
|
145
145
|
},
|
|
146
|
+
"ForagaxDiwali-v5": {
|
|
147
|
+
"size": (15, 15),
|
|
148
|
+
"aperture_size": None,
|
|
149
|
+
"objects": None,
|
|
150
|
+
"biomes": (Biome(start=(0, 0), stop=(15, 15), object_frequencies=(0.2,)),),
|
|
151
|
+
"nowrap": False,
|
|
152
|
+
"deterministic_spawn": True,
|
|
153
|
+
"dynamic_biomes": True,
|
|
154
|
+
"biome_consumption_threshold": 1000,
|
|
155
|
+
"dynamic_biome_spawn_empty": 0.1,
|
|
156
|
+
},
|
|
146
157
|
"ForagaxTwoBiome-v1": {
|
|
147
158
|
"size": (15, 15),
|
|
148
159
|
"aperture_size": None,
|
|
@@ -597,6 +608,13 @@ def make(
|
|
|
597
608
|
regen_delay=(9, 11),
|
|
598
609
|
reward_repeat=100,
|
|
599
610
|
)
|
|
611
|
+
if env_id == "ForagaxDiwali-v5":
|
|
612
|
+
config["objects"] = create_fourier_objects(
|
|
613
|
+
num_fourier_terms=10,
|
|
614
|
+
reward_delay=reward_delay,
|
|
615
|
+
regen_delay=(9, 11),
|
|
616
|
+
reward_repeat=100,
|
|
617
|
+
)[:1]
|
|
600
618
|
|
|
601
619
|
if env_id == "ForagaxSineTwoBiome-v1":
|
|
602
620
|
biome1_oyster, biome1_deathcap, biome2_oyster, biome2_deathcap = (
|
|
File without changes
|
|
File without changes
|
|
File without changes
|