Skip to content

Commit ca3922d

Browse files
committed
0.1.5 - Player legends and pytorch
1 parent 456c477 commit ca3922d

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

kaggle_environments/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from .core import *
1818
from . import utils
1919

20-
version = "0.1.4"
20+
version = "0.1.5"
2121

2222
__all__ = ["environments", "evaluate", "make", "register", "utils", "version"]
2323

kaggle_environments/envs/connectx/connectx.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"version": "1.0.0",
66
"agents": [2],
77
"configuration": {
8+
"timeout": {
9+
"description": "Seconds an agent can run before timing out.",
10+
"type": "integer",
11+
"minimum": 1,
12+
"default": 5
13+
},
814
"columns": {
915
"description": "The number of columns on the board",
1016
"type": "integer",

kaggle_environments/envs/identity/identity.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
},
3030
"observation": {},
3131
"action": {
32-
"description": "The number to return as a reward.",
33-
"type": "integer",
34-
"minimum": 0,
35-
"default": 0
32+
"description": "Reward = action if number, otherwise 0.",
33+
"type": ["number", "string", "null"]
3634
},
3735
"reset": {
3836
"status": "ACTIVE"

kaggle_environments/envs/identity/identity.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ def interpreter(state, env):
4747

4848
# Validate and assign actions as rewards !(min <= action <= max).
4949
for agent in state:
50-
if agent.action < env.configuration.min or agent.action > env.configuration.max:
51-
agent.status = f"Invalid action: {agent.action}"
50+
value = 0
51+
if isinstance(agent.action, (int, float)):
52+
value = agent.action
53+
if value < env.configuration.min or value > env.configuration.max:
54+
agent.status = f"Invalid action: {value}"
5255
else:
53-
agent.reward = agent.action + \
56+
agent.reward = value + \
5457
gauss(0, 1) * env.configuration.noise // 1
5558
agent.status = "DONE"
5659

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
gym
22
jsonschema
33
numpy
4-
scipy
4+
scipy
5+
https://download.pytorch.org/whl/cpu/torch-1.3.1%2Bcpu-cp37-cp37m-linux_x86_64.whl
6+
https://download.pytorch.org/whl/cpu/torchvision-0.4.2%2Bcpu-cp37-cp37m-linux_x86_64.whl

0 commit comments

Comments
 (0)