continual-foragax 0.5.0__tar.gz → 0.6.0__tar.gz
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.6.0/PKG-INFO +16 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/pyproject.toml +6 -5
- continual_foragax-0.6.0/src/continual_foragax.egg-info/PKG-INFO +16 -0
- continual_foragax-0.6.0/src/continual_foragax.egg-info/requires.txt +10 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/foragax/env.py +8 -8
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/foragax/registry.py +1 -1
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/tests/test_foragax.py +3 -1
- continual_foragax-0.5.0/PKG-INFO +0 -10
- continual_foragax-0.5.0/src/continual_foragax.egg-info/PKG-INFO +0 -10
- continual_foragax-0.5.0/src/continual_foragax.egg-info/requires.txt +0 -1
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/README.md +0 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/setup.cfg +0 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/continual_foragax.egg-info/SOURCES.txt +0 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/continual_foragax.egg-info/dependency_links.txt +0 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/continual_foragax.egg-info/entry_points.txt +0 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/continual_foragax.egg-info/top_level.txt +0 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/foragax/__init__.py +0 -0
- {continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/foragax/objects.py +0 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: continual-foragax
|
3
|
+
Version: 0.6.0
|
4
|
+
Summary: A continual reinforcement learning benchmark
|
5
|
+
Author-email: Steven Tang <stang5@ualberta.ca>
|
6
|
+
Requires-Python: >=3.9
|
7
|
+
Description-Content-Type: text/markdown
|
8
|
+
Requires-Dist: gymnax
|
9
|
+
Requires-Dist: six; python_version == "3.9"
|
10
|
+
Provides-Extra: dev
|
11
|
+
Requires-Dist: pre-commit>=4.3.0; extra == "dev"
|
12
|
+
Requires-Dist: pytest>=8.4.1; extra == "dev"
|
13
|
+
Requires-Dist: pytest-benchmark>=5.1.0; extra == "dev"
|
14
|
+
Requires-Dist: ruff>=0.12.9; extra == "dev"
|
15
|
+
|
16
|
+
# foragax
|
@@ -1,17 +1,18 @@
|
|
1
1
|
[project]
|
2
2
|
name = "continual-foragax"
|
3
|
-
version = "0.
|
3
|
+
version = "0.6.0"
|
4
4
|
description = "A continual reinforcement learning benchmark"
|
5
5
|
readme = "README.md"
|
6
6
|
authors = [
|
7
7
|
{ name = "Steven Tang", email = "stang5@ualberta.ca" }
|
8
8
|
]
|
9
|
-
requires-python = ">=3.
|
9
|
+
requires-python = ">=3.9"
|
10
10
|
dependencies = [
|
11
|
-
"gymnax
|
11
|
+
"gymnax",
|
12
|
+
"six; python_version == '3.9'",
|
12
13
|
]
|
13
14
|
|
14
|
-
[
|
15
|
+
[project.optional-dependencies]
|
15
16
|
dev = [
|
16
17
|
"pre-commit>=4.3.0",
|
17
18
|
"pytest>=8.4.1",
|
@@ -29,6 +30,6 @@ build-backend = "setuptools.build_meta"
|
|
29
30
|
[tool]
|
30
31
|
[tool.commitizen]
|
31
32
|
name = "cz_conventional_commits"
|
32
|
-
version = "0.
|
33
|
+
version = "0.6.0"
|
33
34
|
tag_format = "$version"
|
34
35
|
version_files = ["pyproject.toml"]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: continual-foragax
|
3
|
+
Version: 0.6.0
|
4
|
+
Summary: A continual reinforcement learning benchmark
|
5
|
+
Author-email: Steven Tang <stang5@ualberta.ca>
|
6
|
+
Requires-Python: >=3.9
|
7
|
+
Description-Content-Type: text/markdown
|
8
|
+
Requires-Dist: gymnax
|
9
|
+
Requires-Dist: six; python_version == "3.9"
|
10
|
+
Provides-Extra: dev
|
11
|
+
Requires-Dist: pre-commit>=4.3.0; extra == "dev"
|
12
|
+
Requires-Dist: pytest>=8.4.1; extra == "dev"
|
13
|
+
Requires-Dist: pytest-benchmark>=5.1.0; extra == "dev"
|
14
|
+
Requires-Dist: ruff>=0.12.9; extra == "dev"
|
15
|
+
|
16
|
+
# foragax
|
@@ -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, 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,7 +103,7 @@ 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."""
|
@@ -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),
|
@@ -246,8 +246,10 @@ def test_respawn():
|
|
246
246
|
assert reward == FLOWER.reward_val
|
247
247
|
assert state.object_grid[4, 3] < 0
|
248
248
|
|
249
|
+
steps_until_respawn = -state.object_grid[4, 3] // 2
|
250
|
+
|
249
251
|
# Step until it respawns
|
250
|
-
for i in range(
|
252
|
+
for i in range(steps_until_respawn):
|
251
253
|
key, step_key = jax.random.split(key)
|
252
254
|
_, state, _, _, _ = env.step_env(step_key, state, Actions.UP, params)
|
253
255
|
assert state.object_grid[4, 3] < 0
|
continual_foragax-0.5.0/PKG-INFO
DELETED
@@ -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,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 +0,0 @@
|
|
1
|
-
gymnax>=0.0.9
|
File without changes
|
File without changes
|
{continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/continual_foragax.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/continual_foragax.egg-info/entry_points.txt
RENAMED
File without changes
|
{continual_foragax-0.5.0 → continual_foragax-0.6.0}/src/continual_foragax.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|