Commit Graph

1491 Commits

Author SHA1 Message Date
Christopher Hesse
405f1b36f6 Discrete contains may not handle numpy types correctly
```
np.uint8(0).dtype.kind in np.typecodes['AllInteger'] == False
np.uint8(0).dtype.char in np.typecodes['AllInteger'] == True
```

```
dtype.kind	A character code (one of ‘biufcmMOSUV’) identifying the general kind of data.
dtype.char	A unique character code for each of the 21 different built-in types.
```
2020-01-24 14:45:19 -08:00
pzhokhov
7854e2d020 remove opencv-python from core requirements (#1764)
* remove opencv-python from core requirements

* fail on AtariWrapper construction if opencv-python is not installed
2020-01-24 14:05:12 -08:00
Christopher Hesse
8e5a7ca3e6 Update environments.md 2019-12-13 22:35:33 -08:00
Pavel Shutov
bd68ec33f3 Fix sampling bug (#1761) 2019-12-13 15:25:37 +01:00
Jan Keromnes
064a53ae65 Fully automated dev setup + online live demo (#1754)
* Add automated dev setup using Gitpod

* Updating README to make instuctions more clear.

* Updating gitpod config to avoid directory change

* Moved Gitpod environment files to external repository

They're now in https://github.com/gitpod-io/definitely-gp/tree/master/gym
2019-12-12 10:57:20 +01:00
Xingdong Zuo
a99e8d153e [Update registration.py]: Clean-up of unused arguments (#1626)
* Update registration.py

* Update registration.py
2019-12-06 16:04:44 +01:00
Zach Dwiel
3ee7e678bf Respect the order of keys in a Dict's observation space when flattening (#1748)
* Respect the order of keys in a Dict's observation space when flattening

Prior to this change, the order of the key/values in the observation was used instead of the order in the Dict's observation space. unflatten already uses the order specified by the Dict's observation space.

* add tests for FlattenObservation
2019-12-06 15:49:56 +01:00
Guillermo González de Garibay
59d401ea3b Warn when Box dtype is casted to lower precision (#1744)
* Force explicit Box dtype

Having the `dtype` argument defaut to `np.float32` without warning can generate some unexpected issues.

For example:
```python
import gym
import numpy as np

num = np.array(3.1415926035897932)

gym.spaces.Box(-num, num).contains(num)  # returns False
```

* Warn on lowered precision
2019-12-06 14:13:46 +01:00
Peter Zhokhov
52e66f3808 release 0.15.4; bump version; release notes 2019-11-08 14:46:06 -08:00
Julien Jerphanion
5ea025d87d Replace np.cos, np.sin, np.pi for readability (#1733)
Remove the `np.` prefix as those two functions and this constant are imported directly.
2019-11-08 14:22:50 -08:00
MalteEbner
bf783192b8 Bugfix: spaces.MultiDiscrete.contains() can handle different shapes (#1740)
See also space.Box.contains(), it already has this change

Reproduce Error with following lines:

from gym import spaces
import numpy as np
space_Multidiscrete = spaces.MultiDiscrete(np.ones((10,3)))
sample_test = np.ones((9,3))
space_Multidiscrete.contains(sample_test) #errors: ValueError: operands could not be broadcast together with shapes (9,3) (10,3)
2019-11-08 14:19:02 -08:00
Tristan Trim
857bddc168 duplicate line of code (#1738) 2019-11-08 14:14:55 -08:00
Christopher Hesse
5fb359971a only support mujoco-py <2.0 2019-11-08 14:12:42 -08:00
Anurag Koul
21bd4f304b added assertion of 'NoFrameskip' in AtariPreprocessing (#1725)
* added assertion of noframeskip in atari pre-proecessing

* - corrected frameskipping assertion
- added non-op assertion as well
2019-11-04 09:48:21 -08:00
Gowtham.R
7a97c89b44 fix sampling bug (#1730)
* fix sampling bug

* remove clipping and do floor samples before type conversion
2019-11-01 16:22:11 -07:00
Xingdong Zuo
f90ca4b69f [Update vector_env.py]: add VectorEnvWrapper (#1633)
* Update vector_env.py

* Update vector_env.py
2019-11-01 14:29:39 -07:00
Xingdong Zuo
97ac555c03 [Wrapper]: RecordEpisodeStatistics (#1628)
* Create record_episode_statistics.py

* Create test_record_episode_statistics.py

* Update __init__.py

* Update record_episode_statistics.py

* Update record_episode_statistics.py

* Update test_record_episode_statistics.py

* Update record_episode_statistics.py

* Update test_record_episode_statistics.py
2019-11-01 14:27:39 -07:00
Xingdong Zuo
0cd9266d98 Update core.py (#1627) 2019-10-25 15:48:21 -07:00
Xingdong Zuo
53b301af5e Update vector_env.py (#1630) 2019-10-25 15:38:52 -07:00
Xingdong Zuo
fe244fadf6 [gym.vector]: a genericclose with user-defined close_extras (#1631)
* Update vector_env.py

* Update sync_vector_env.py

* Update async_vector_env.py

* Update vector_env.py

* Update async_vector_env.py
2019-10-25 15:18:54 -07:00
DanielPBak
e37717ce98 Changed repr of Dict space so that it supports non-string keys. (#1658) 2019-10-25 14:28:19 -07:00
Ben Wiener
af6d98fd98 Unified the physical constants in the constructor (#1716)
Thought this was more readable.
2019-10-25 14:22:10 -07:00
Xingdong Zuo
1a5c786ef9 [Wrappers]: RescaleAction (#1491)
* Create normalize_action.py

* Update __init__.py

* Create test_normalize_action.py

* Update normalize_action.py

* Update normalize_action.py

* Rename normalize_action.py to rescale_action.py

* Update __init__.py

* Update rescale_action.py

* Update and rename test_normalize_action.py to test_rescale_action.py

* Update test_rescale_action.py

* Update rescale_action.py

* Update rescale_action.py

* Update gym/wrappers/rescale_action.py

Thanks a lot @hartikainen !

Co-Authored-By: Kristian Hartikainen <kristian.hartikainen@gmail.com>

* Update gym/wrappers/rescale_action.py

That's a very clean way ! Thanks !

Co-Authored-By: Kristian Hartikainen <kristian.hartikainen@gmail.com>

* Update gym/wrappers/rescale_action.py

Co-Authored-By: Kristian Hartikainen <kristian.hartikainen@gmail.com>

* Update rescale_action.py

* Update gym/wrappers/rescale_action.py

Co-Authored-By: Kristian Hartikainen <kristian.hartikainen@gmail.com>

* Update rescale_action.py

* Update rescale_action.py
2019-10-25 14:20:53 -07:00
Xingdong Zuo
b6b060036b [Update vector_env.py]: add some documentations (#1629)
* Update vector_env.py

* Update vector_env.py
2019-10-25 14:17:29 -07:00
wkirgsn
19cb6bd358 add gym-electric-motor env to third party list (#1718) 2019-10-25 14:16:55 -07:00
Christopher Hesse
c072172d64 mention pybullet in readme 2019-10-18 16:02:25 -07:00
Dmitry Nikulin
9a7f912989 Use list comprehension instead of += (#1654) 2019-10-18 16:00:15 -07:00
Xingdong Zuo
8962984eed [Update atari_preprocessing.py]: Remove FireReset (#1661)
* Update atari_preprocessing.py

* Update test_atari_preprocessing.py

* Update test_atari_preprocessing.py
2019-10-18 15:59:43 -07:00
Eddie Huang
f610d54103 Added an environment for the board game Go (#1660)
* Added GymGo to environments list

* Update environments.md

moved gym environment to bottom of list
2019-10-18 15:58:37 -07:00
Xingdong Zuo
f304c94cbd [Delete dict.py]: replace with FilterObservation + FlattenObservation (#1669)
* Delete dict.py

* Update __init__.py

* Update nested_dict_test.py

* update nested_dict_test

* oh huh revert commented out part of the test, now the test fails due to the lack of proper error :(

* remove incorrect argument test - now all combinations of spaces and dtypes are possible to flatten (eveything is reduced to float32, discrete are one-hot encoded)
2019-10-18 15:53:24 -07:00
Minkyu Jo
24d78b1026 Fix FlattenObservation to refer to correct observation space (#1710)
* fix FlattenObservation to refer to correct observation_space

* modify test_flatten_observation to test non-Box spaces
2019-10-18 14:59:56 -07:00
Xingdong Zuo
dd39836a98 Update pixel_observation.py (#1708) 2019-10-18 14:57:17 -07:00
Mohamad H. Danesh
2b7a774f49 Update setup.py (#1713) 2019-10-18 14:41:09 -07:00
Xingdong Zuo
ed8b13e11a [Wrappers]: add TransformObservation (#1670)
* Create transform_observation.py

* Create test_transform_observation.py

* Update __init__.py
2019-10-11 14:58:04 -07:00
ZexDC
5e62533d2c Fix typo (#1705) 2019-10-11 14:54:56 -07:00
Peter Zhokhov
f4a127bdcf bump version to 0.15.3, release notes 2019-10-09 15:09:56 -07:00
pzhokhov
51136b1290 vector env updates (#1706)
* make daemon=True an option of async_vector_env

* custom worker in async_vector_env

* add compatibility methods to SyncVectorEnv

* fix name in sync_vector_env

* vectorenv api cleanup

* add docstrings for daemon and worker options in AsyncVectorEnv
2019-10-09 15:08:10 -07:00
Xingdong Zuo
1d31c12437 Move test_pixel_observation.py under gym.wrappers (#1671)
* Create test_pixel_observation.py

* Delete pixel_observation_test.py
2019-10-04 15:40:06 -07:00
Anurag Koul
1b5671e36c Adding Frame Normalization in Atari Pre-Processing (#1680)
* added frame scaling in atari preprocessing
- default value is False

* added frame scaling in atari preprocessing
- default value is False

* corrected logic for selection of observation_space params

* initial commit for scale test

* added test-case for observation scaling in atari

* added message related to framestack in docstring.

* refactored scaled obs test for atari preprocessing
2019-10-04 14:19:00 -07:00
Christopher Hesse
12b3bb6a0c Update environments.md 2019-10-02 17:43:23 -07:00
Christopher Hesse
d69e6c8a79 Update environments.md 2019-10-02 17:43:23 -07:00
Christopher Hesse
69b625c214 Update environments.md 2019-10-02 17:43:23 -07:00
Christopher Hesse
c655ed4484 Update environments.md 2019-10-02 17:43:23 -07:00
Christopher Hesse
7b1abb0fc3 add stale bot config 2019-09-27 15:39:24 -07:00
AminHP
bce79003d0 Add gym-anytrading 2019-09-27 15:17:52 -07:00
Peter Zhokhov
c33cfd8b2c fix test_envs 2019-08-23 16:19:10 -07:00
Peter Zhokhov
be326a7553 replace release notes with 0.15.1, update Taxi env registration logic to Taxi-v3 2019-08-23 15:55:35 -07:00
pzhokhov
fd5314780d re-enable and fix atari preprocessing wrappers pixel test (#1652) 2019-08-23 15:45:55 -07:00
kobotics
a0264410f2 Updated Taxi-v2 to Taxi-v3 (map correction + cleaner domain description) (#1653) 2019-08-23 15:43:09 -07:00
Peter Zhokhov
5fef6458a7 fix mujoco tests 2019-08-23 15:39:03 -07:00