continual-foragax 0.5.0__py3-none-any.whl → 0.7.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.7.0.dist-info/METADATA +16 -0
- continual_foragax-0.7.0.dist-info/RECORD +9 -0
- foragax/env.py +10 -10
- foragax/registry.py +1 -1
- continual_foragax-0.5.0.dist-info/METADATA +0 -10
- continual_foragax-0.5.0.dist-info/RECORD +0 -9
- {continual_foragax-0.5.0.dist-info → continual_foragax-0.7.0.dist-info}/WHEEL +0 -0
- {continual_foragax-0.5.0.dist-info → continual_foragax-0.7.0.dist-info}/entry_points.txt +0 -0
- {continual_foragax-0.5.0.dist-info → continual_foragax-0.7.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: continual-foragax
|
3
|
+
Version: 0.7.0
|
4
|
+
Summary: A continual reinforcement learning benchmark
|
5
|
+
Author-email: Steven Tang <stang5@ualberta.ca>
|
6
|
+
Requires-Python: >=3.8
|
7
|
+
Description-Content-Type: text/markdown
|
8
|
+
Requires-Dist: gymnax
|
9
|
+
Requires-Dist: six; python_version < "3.10"
|
10
|
+
Provides-Extra: dev
|
11
|
+
Requires-Dist: pre-commit; extra == "dev"
|
12
|
+
Requires-Dist: pytest; extra == "dev"
|
13
|
+
Requires-Dist: pytest-benchmark; extra == "dev"
|
14
|
+
Requires-Dist: ruff; extra == "dev"
|
15
|
+
|
16
|
+
# foragax
|
@@ -0,0 +1,9 @@
|
|
1
|
+
foragax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
foragax/env.py,sha256=ykSjKvm5zeO_24Y1tsWWwAoUCkxRQjzj_QdXjsZkSQI,15188
|
3
|
+
foragax/objects.py,sha256=j0sQ_qAjx_tGu4Xt7SXmwd9hsEHJXAGFY5I5VIf9_SM,4000
|
4
|
+
foragax/registry.py,sha256=ISaqGMCy-IL9QCk7pmbYw59QVaSurKgLK8RS4wzf-pg,2187
|
5
|
+
continual_foragax-0.7.0.dist-info/METADATA,sha256=DM4D9vZxvv3PgjA2kbq2_4NphitquabxuQoj-GvO_Ug,486
|
6
|
+
continual_foragax-0.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
continual_foragax-0.7.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
|
8
|
+
continual_foragax-0.7.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
|
9
|
+
continual_foragax-0.7.0.dist-info/RECORD,,
|
foragax/env.py
CHANGED
@@ -6,7 +6,7 @@ Source: https://github.com/andnp/Foragax
|
|
6
6
|
from dataclasses import dataclass
|
7
7
|
from enum import IntEnum
|
8
8
|
from functools import partial
|
9
|
-
from typing import Any, Tuple
|
9
|
+
from typing import Any, Dict, Tuple, Union
|
10
10
|
|
11
11
|
import jax
|
12
12
|
import jax.numpy as jnp
|
@@ -37,13 +37,13 @@ DIRECTIONS = jnp.array(
|
|
37
37
|
class Biome:
|
38
38
|
# Object generation frequencies for this biome
|
39
39
|
object_frequencies: Tuple[float, ...] = ()
|
40
|
-
start: Tuple[int, int]
|
41
|
-
stop: Tuple[int, int]
|
40
|
+
start: Union[Tuple[int, int], None] = None
|
41
|
+
stop: Union[Tuple[int, int], None] = None
|
42
42
|
|
43
43
|
|
44
44
|
@struct.dataclass
|
45
45
|
class EnvParams(environment.EnvParams):
|
46
|
-
max_steps_in_episode: int
|
46
|
+
max_steps_in_episode: Union[int, None]
|
47
47
|
|
48
48
|
|
49
49
|
@struct.dataclass
|
@@ -53,13 +53,13 @@ class EnvState(environment.EnvState):
|
|
53
53
|
time: int
|
54
54
|
|
55
55
|
|
56
|
-
class ForagaxEnv(environment.Environment
|
56
|
+
class ForagaxEnv(environment.Environment):
|
57
57
|
"""JAX implementation of Foragax environment."""
|
58
58
|
|
59
59
|
def __init__(
|
60
60
|
self,
|
61
|
-
size: Tuple[int, int]
|
62
|
-
aperture_size: Tuple[int, int]
|
61
|
+
size: Union[Tuple[int, int], int] = (10, 10),
|
62
|
+
aperture_size: Union[Tuple[int, int], int] = (5, 5),
|
63
63
|
objects: Tuple[BaseForagaxObject, ...] = (),
|
64
64
|
biomes: Tuple[Biome, ...] = (Biome(object_frequencies=()),),
|
65
65
|
):
|
@@ -103,9 +103,9 @@ class ForagaxEnv(environment.Environment[EnvState, EnvParams]):
|
|
103
103
|
self,
|
104
104
|
key: jax.Array,
|
105
105
|
state: EnvState,
|
106
|
-
action: int
|
106
|
+
action: Union[int, float, jax.Array],
|
107
107
|
params: EnvParams,
|
108
|
-
) ->
|
108
|
+
) -> Tuple[jax.Array, EnvState, jax.Array, jax.Array, Dict[Any, Any]]:
|
109
109
|
"""Perform single timestep state transition."""
|
110
110
|
num_obj_types = len(self.object_ids)
|
111
111
|
# Decode the object grid: positive values are objects, negative are timers (treat as empty)
|
@@ -167,7 +167,7 @@ class ForagaxEnv(environment.Environment[EnvState, EnvParams]):
|
|
167
167
|
|
168
168
|
def reset_env(
|
169
169
|
self, key: jax.Array, params: EnvParams
|
170
|
-
) ->
|
170
|
+
) -> Tuple[jax.Array, EnvState]:
|
171
171
|
"""Reset environment state."""
|
172
172
|
key, subkey = jax.random.split(key)
|
173
173
|
|
foragax/registry.py
CHANGED
@@ -12,7 +12,7 @@ from foragax.env import (
|
|
12
12
|
from foragax.objects import LARGE_MOREL, LARGE_OYSTER, MEDIUM_MOREL
|
13
13
|
|
14
14
|
ENV_CONFIGS: Dict[str, Dict[str, Any]] = {
|
15
|
-
"ForagaxTwoBiomeSmall": {
|
15
|
+
"ForagaxTwoBiomeSmall-v1": {
|
16
16
|
"size": (16, 8),
|
17
17
|
"aperture_size": (5, 5),
|
18
18
|
"objects": (LARGE_MOREL, LARGE_OYSTER),
|
@@ -1,10 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: continual-foragax
|
3
|
-
Version: 0.5.0
|
4
|
-
Summary: A continual reinforcement learning benchmark
|
5
|
-
Author-email: Steven Tang <stang5@ualberta.ca>
|
6
|
-
Requires-Python: >=3.11
|
7
|
-
Description-Content-Type: text/markdown
|
8
|
-
Requires-Dist: gymnax>=0.0.9
|
9
|
-
|
10
|
-
# foragax
|
@@ -1,9 +0,0 @@
|
|
1
|
-
foragax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
foragax/env.py,sha256=m1LcFyi-RBCViEiaF3LqQ_K-2vy4yu8nTK1rujZ8f4A,15161
|
3
|
-
foragax/objects.py,sha256=j0sQ_qAjx_tGu4Xt7SXmwd9hsEHJXAGFY5I5VIf9_SM,4000
|
4
|
-
foragax/registry.py,sha256=IpoE5iiHXQIcIwdAr0fXjOwiy9qyWF7DBnDGnGAFUSI,2184
|
5
|
-
continual_foragax-0.5.0.dist-info/METADATA,sha256=Me0ilQ4e3nLSruu4-_c4sNXR8_CS_PwgE03u-uzu7Kc,266
|
6
|
-
continual_foragax-0.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
-
continual_foragax-0.5.0.dist-info/entry_points.txt,sha256=Qiu6iE_XudrDO_bVAMeA435h4PO9ourt8huvSHiuMPc,41
|
8
|
-
continual_foragax-0.5.0.dist-info/top_level.txt,sha256=-z3SDK6RfLIcLI24n8rdbeFzlVY3hunChzlu-v1Fncs,8
|
9
|
-
continual_foragax-0.5.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|