pyRDDLGym-jax 2.8__tar.gz → 3.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.
Files changed (70) hide show
  1. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/PKG-INFO +22 -23
  2. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/README.md +21 -22
  3. pyrddlgym_jax-3.0/pyRDDLGym_jax/__init__.py +1 -0
  4. pyrddlgym_jax-3.0/pyRDDLGym_jax/core/compiler.py +2087 -0
  5. pyrddlgym_jax-3.0/pyRDDLGym_jax/core/logic.py +1647 -0
  6. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/model.py +75 -86
  7. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/planner.py +883 -935
  8. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/simulator.py +20 -17
  9. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/tuning.py +11 -7
  10. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/visualization.py +115 -78
  11. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/entry_point.py +2 -1
  12. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Cartpole_Continuous_gym_drp.cfg +15 -0
  13. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/Cartpole_Continuous_gym_replan.cfg +5 -7
  14. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Cartpole_Continuous_gym_slp.cfg +17 -0
  15. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/HVAC_ippc2023_drp.cfg +7 -8
  16. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/HVAC_ippc2023_slp.cfg +17 -0
  17. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/MountainCar_Continuous_gym_slp.cfg +5 -7
  18. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/MountainCar_ippc2023_slp.cfg +5 -7
  19. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/PowerGen_Continuous_drp.cfg +17 -0
  20. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/PowerGen_Continuous_replan.cfg +6 -7
  21. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/PowerGen_Continuous_slp.cfg +17 -0
  22. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Quadcopter_drp.cfg +17 -0
  23. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Quadcopter_physics_drp.cfg +17 -0
  24. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Quadcopter_physics_slp.cfg +17 -0
  25. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Quadcopter_slp.cfg +17 -0
  26. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/Reservoir_Continuous_drp.cfg +4 -7
  27. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/Reservoir_Continuous_replan.cfg +5 -7
  28. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Reservoir_Continuous_slp.cfg +16 -0
  29. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/UAV_Continuous_slp.cfg +5 -7
  30. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/Wildfire_MDP_ippc2014_drp.cfg +6 -7
  31. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/Wildfire_MDP_ippc2014_replan.cfg +6 -7
  32. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/Wildfire_MDP_ippc2014_slp.cfg +19 -0
  33. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/default_drp.cfg +5 -8
  34. pyrddlgym_jax-3.0/pyRDDLGym_jax/examples/configs/default_replan.cfg +18 -0
  35. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/default_slp.cfg +5 -8
  36. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/tuning_drp.cfg +6 -8
  37. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/tuning_replan.cfg +6 -8
  38. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/tuning_slp.cfg +6 -8
  39. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/run_plan.py +2 -2
  40. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/run_tune.py +2 -2
  41. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax.egg-info/PKG-INFO +22 -23
  42. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax.egg-info/SOURCES.txt +2 -1
  43. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/setup.py +1 -1
  44. pyrddlgym_jax-2.8/pyRDDLGym_jax/__init__.py +0 -1
  45. pyrddlgym_jax-2.8/pyRDDLGym_jax/core/compiler.py +0 -1913
  46. pyrddlgym_jax-2.8/pyRDDLGym_jax/core/logic.py +0 -1479
  47. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/Cartpole_Continuous_gym_drp.cfg +0 -17
  48. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/Cartpole_Continuous_gym_slp.cfg +0 -18
  49. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/HVAC_ippc2023_slp.cfg +0 -18
  50. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/PowerGen_Continuous_drp.cfg +0 -18
  51. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/PowerGen_Continuous_slp.cfg +0 -18
  52. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/Quadcopter_drp.cfg +0 -19
  53. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/Quadcopter_slp.cfg +0 -19
  54. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/Reservoir_Continuous_slp.cfg +0 -19
  55. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/Wildfire_MDP_ippc2014_slp.cfg +0 -20
  56. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/configs/default_replan.cfg +0 -21
  57. pyrddlgym_jax-2.8/pyRDDLGym_jax/examples/run_gradient.py +0 -102
  58. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/LICENSE +0 -0
  59. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/__init__.py +0 -0
  60. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/assets/__init__.py +0 -0
  61. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/core/assets/favicon.ico +0 -0
  62. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/__init__.py +0 -0
  63. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/configs/__init__.py +0 -0
  64. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/run_gym.py +0 -0
  65. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax/examples/run_scipy.py +0 -0
  66. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax.egg-info/dependency_links.txt +0 -0
  67. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax.egg-info/entry_points.txt +0 -0
  68. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax.egg-info/requires.txt +0 -0
  69. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/pyRDDLGym_jax.egg-info/top_level.txt +0 -0
  70. {pyrddlgym_jax-2.8 → pyrddlgym_jax-3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyRDDLGym-jax
3
- Version: 2.8
3
+ Version: 3.0
4
4
  Summary: pyRDDLGym-jax: automatic differentiation for solving sequential planning problems in JAX.
5
5
  Home-page: https://github.com/pyrddlgym-project/pyRDDLGym-jax
6
6
  Author: Michael Gimelfarb, Ayal Taitler, Scott Sanner
@@ -76,6 +76,10 @@ Some demos of solved problems by JaxPlan:
76
76
  <img src="https://github.com/pyrddlgym-project/pyRDDLGym-jax/blob/main/Images/reservoir.gif" width="120" height="120" margin=0/>
77
77
  </p>
78
78
 
79
+ > [!WARNING]
80
+ > Starting in version 3.0 (major release), the structure of the config files and internal API have changed.
81
+ > Please make sure your config files follow the new format. See [examples here](https://github.com/pyrddlgym-project/pyRDDLGym-jax/tree/main/pyRDDLGym_jax/examples/configs).
82
+
79
83
  > [!WARNING]
80
84
  > Starting in version 1.0 (major release), the ``weight`` parameter in the config file was removed,
81
85
  and was moved to the individual logic components which have their own unique weight parameter assigned.
@@ -168,35 +172,32 @@ The simplest way to configure the planner is to write and pass a configuration f
168
172
  The basic structure of a configuration file is provided below for a straight-line planner:
169
173
 
170
174
  ```ini
171
- [Model]
172
- logic='FuzzyLogic'
173
- comparison_kwargs={'weight': 20}
174
- rounding_kwargs={'weight': 20}
175
- control_kwargs={'weight': 20}
175
+ [Compiler]
176
+ method='DefaultJaxRDDLCompilerWithGrad'
177
+ sigmoid_weight=20
176
178
 
177
- [Optimizer]
179
+ [Planner]
178
180
  method='JaxStraightLinePlan'
179
181
  method_kwargs={}
180
182
  optimizer='rmsprop'
181
183
  optimizer_kwargs={'learning_rate': 0.001}
182
184
 
183
- [Training]
185
+ [Optimize]
184
186
  key=42
185
187
  epochs=5000
186
188
  train_seconds=30
187
189
  ```
188
190
 
189
191
  The configuration file contains three sections:
190
- - ``[Model]`` specifies the fuzzy logic operations used to relax discrete operations to differentiable approximations; the ``weight`` dictates the quality of the approximation,
191
- and ``tnorm`` specifies the type of [fuzzy logic](https://en.wikipedia.org/wiki/T-norm_fuzzy_logics) for relacing logical operations in RDDL (e.g. ``ProductTNorm``, ``GodelTNorm``, ``LukasiewiczTNorm``)
192
- - ``[Optimizer]`` generally specify the optimizer and plan settings; the ``method`` specifies the plan/policy representation (e.g. ``JaxStraightLinePlan``, ``JaxDeepReactivePolicy``), the gradient descent settings, learning rate, batch size, etc.
193
- - ``[Training]`` specifies computation limits, such as total training time and number of iterations, and options for printing or visualizing information from the planner.
192
+ - ``[Compiler]`` specifies the fuzzy logic operations used to relax discrete operations to differentiable approximations; the ``weight`` dictates the quality of the approximation
193
+ - ``[Planner]`` generally specify the optimizer and plan settings; the ``method`` specifies the plan/policy representation (e.g. ``JaxStraightLinePlan``, ``JaxDeepReactivePolicy``), the gradient descent settings, learning rate, batch size, etc.
194
+ - ``[Optimize]`` specifies computation limits, such as total training time and number of iterations, and options for printing or visualizing information from the planner.
194
195
 
195
- For a policy network approach, simply change the ``[Optimizer]`` settings like so:
196
+ For a policy network approach, simply change the ``[Planner]`` settings like so:
196
197
 
197
198
  ```ini
198
199
  ...
199
- [Optimizer]
200
+ [Planner]
200
201
  method='JaxDeepReactivePolicy'
201
202
  method_kwargs={'topology': [128, 64], 'activation': 'tanh'}
202
203
  ...
@@ -224,7 +225,7 @@ and visualization of the policy or model, and other useful debugging features. T
224
225
 
225
226
  ```ini
226
227
  ...
227
- [Training]
228
+ [Planner]
228
229
  dashboard=True
229
230
  ...
230
231
  ```
@@ -251,19 +252,17 @@ It is easy to tune a custom range of the planner's hyper-parameters efficiently.
251
252
  First create a config file template with patterns replacing concrete parameter values that you want to tune, e.g.:
252
253
 
253
254
  ```ini
254
- [Model]
255
- logic='FuzzyLogic'
256
- comparison_kwargs={'weight': TUNABLE_WEIGHT}
257
- rounding_kwargs={'weight': TUNABLE_WEIGHT}
258
- control_kwargs={'weight': TUNABLE_WEIGHT}
255
+ [Compiler]
256
+ method='DefaultJaxRDDLCompilerWithGrad'
257
+ sigmoid_weight=TUNABLE_WEIGHT
259
258
 
260
- [Optimizer]
259
+ [Planner]
261
260
  method='JaxStraightLinePlan'
262
261
  method_kwargs={}
263
262
  optimizer='rmsprop'
264
263
  optimizer_kwargs={'learning_rate': TUNABLE_LEARNING_RATE}
265
264
 
266
- [Training]
265
+ [Optimize]
267
266
  train_seconds=30
268
267
  print_summary=False
269
268
  print_progress=False
@@ -272,7 +271,7 @@ train_on_reset=True
272
271
 
273
272
  would allow to tune the sharpness of model relaxations, and the learning rate of the optimizer.
274
273
 
275
- Next, you must link the patterns in the config with concrete hyper-parameter ranges the tuner will understand, and run the optimizer:
274
+ Next, link the hyperparameters in the config with concrete ranges that the optimizer will use, and run the optimizer:
276
275
 
277
276
  ```python
278
277
  import pyRDDLGym
@@ -29,6 +29,10 @@ Some demos of solved problems by JaxPlan:
29
29
  <img src="https://github.com/pyrddlgym-project/pyRDDLGym-jax/blob/main/Images/reservoir.gif" width="120" height="120" margin=0/>
30
30
  </p>
31
31
 
32
+ > [!WARNING]
33
+ > Starting in version 3.0 (major release), the structure of the config files and internal API have changed.
34
+ > Please make sure your config files follow the new format. See [examples here](https://github.com/pyrddlgym-project/pyRDDLGym-jax/tree/main/pyRDDLGym_jax/examples/configs).
35
+
32
36
  > [!WARNING]
33
37
  > Starting in version 1.0 (major release), the ``weight`` parameter in the config file was removed,
34
38
  and was moved to the individual logic components which have their own unique weight parameter assigned.
@@ -121,35 +125,32 @@ The simplest way to configure the planner is to write and pass a configuration f
121
125
  The basic structure of a configuration file is provided below for a straight-line planner:
122
126
 
123
127
  ```ini
124
- [Model]
125
- logic='FuzzyLogic'
126
- comparison_kwargs={'weight': 20}
127
- rounding_kwargs={'weight': 20}
128
- control_kwargs={'weight': 20}
128
+ [Compiler]
129
+ method='DefaultJaxRDDLCompilerWithGrad'
130
+ sigmoid_weight=20
129
131
 
130
- [Optimizer]
132
+ [Planner]
131
133
  method='JaxStraightLinePlan'
132
134
  method_kwargs={}
133
135
  optimizer='rmsprop'
134
136
  optimizer_kwargs={'learning_rate': 0.001}
135
137
 
136
- [Training]
138
+ [Optimize]
137
139
  key=42
138
140
  epochs=5000
139
141
  train_seconds=30
140
142
  ```
141
143
 
142
144
  The configuration file contains three sections:
143
- - ``[Model]`` specifies the fuzzy logic operations used to relax discrete operations to differentiable approximations; the ``weight`` dictates the quality of the approximation,
144
- and ``tnorm`` specifies the type of [fuzzy logic](https://en.wikipedia.org/wiki/T-norm_fuzzy_logics) for relacing logical operations in RDDL (e.g. ``ProductTNorm``, ``GodelTNorm``, ``LukasiewiczTNorm``)
145
- - ``[Optimizer]`` generally specify the optimizer and plan settings; the ``method`` specifies the plan/policy representation (e.g. ``JaxStraightLinePlan``, ``JaxDeepReactivePolicy``), the gradient descent settings, learning rate, batch size, etc.
146
- - ``[Training]`` specifies computation limits, such as total training time and number of iterations, and options for printing or visualizing information from the planner.
145
+ - ``[Compiler]`` specifies the fuzzy logic operations used to relax discrete operations to differentiable approximations; the ``weight`` dictates the quality of the approximation
146
+ - ``[Planner]`` generally specify the optimizer and plan settings; the ``method`` specifies the plan/policy representation (e.g. ``JaxStraightLinePlan``, ``JaxDeepReactivePolicy``), the gradient descent settings, learning rate, batch size, etc.
147
+ - ``[Optimize]`` specifies computation limits, such as total training time and number of iterations, and options for printing or visualizing information from the planner.
147
148
 
148
- For a policy network approach, simply change the ``[Optimizer]`` settings like so:
149
+ For a policy network approach, simply change the ``[Planner]`` settings like so:
149
150
 
150
151
  ```ini
151
152
  ...
152
- [Optimizer]
153
+ [Planner]
153
154
  method='JaxDeepReactivePolicy'
154
155
  method_kwargs={'topology': [128, 64], 'activation': 'tanh'}
155
156
  ...
@@ -177,7 +178,7 @@ and visualization of the policy or model, and other useful debugging features. T
177
178
 
178
179
  ```ini
179
180
  ...
180
- [Training]
181
+ [Planner]
181
182
  dashboard=True
182
183
  ...
183
184
  ```
@@ -204,19 +205,17 @@ It is easy to tune a custom range of the planner's hyper-parameters efficiently.
204
205
  First create a config file template with patterns replacing concrete parameter values that you want to tune, e.g.:
205
206
 
206
207
  ```ini
207
- [Model]
208
- logic='FuzzyLogic'
209
- comparison_kwargs={'weight': TUNABLE_WEIGHT}
210
- rounding_kwargs={'weight': TUNABLE_WEIGHT}
211
- control_kwargs={'weight': TUNABLE_WEIGHT}
208
+ [Compiler]
209
+ method='DefaultJaxRDDLCompilerWithGrad'
210
+ sigmoid_weight=TUNABLE_WEIGHT
212
211
 
213
- [Optimizer]
212
+ [Planner]
214
213
  method='JaxStraightLinePlan'
215
214
  method_kwargs={}
216
215
  optimizer='rmsprop'
217
216
  optimizer_kwargs={'learning_rate': TUNABLE_LEARNING_RATE}
218
217
 
219
- [Training]
218
+ [Optimize]
220
219
  train_seconds=30
221
220
  print_summary=False
222
221
  print_progress=False
@@ -225,7 +224,7 @@ train_on_reset=True
225
224
 
226
225
  would allow to tune the sharpness of model relaxations, and the learning rate of the optimizer.
227
226
 
228
- Next, you must link the patterns in the config with concrete hyper-parameter ranges the tuner will understand, and run the optimizer:
227
+ Next, link the hyperparameters in the config with concrete ranges that the optimizer will use, and run the optimizer:
229
228
 
230
229
  ```python
231
230
  import pyRDDLGym
@@ -0,0 +1 @@
1
+ __version__ = '3.0'