675 Commits

Author SHA1 Message Date
Maximilian Huettenrauch
f2e10b04bb Merge branch 'thuml_master' into feature/algo-eval 2024-04-02 11:03:38 +02:00
Erni
bf0d632108
Naming and typing improvements in Actor/Critic/Policy forwards (#1032)
Closes #917 

### Internal Improvements
- Better variable names related to model outputs (logits, dist input
etc.). #1032
- Improved typing for actors and critics, using Tianshou classes like
`Actor`, `ActorProb`, etc.,
instead of just `nn.Module`. #1032
- Added interfaces for most `Actor` and `Critic` classes to enforce the
presence of `forward` methods. #1032
- Simplified `PGPolicy` forward by unifying the `dist_fn` interface (see
associated breaking change). #1032
- Use `.mode` of distribution instead of relying on knowledge of the
distribution type. #1032

### Breaking Changes

- Changed interface of `dist_fn` in `PGPolicy` and all subclasses to
take a single argument in both
continuous and discrete cases. #1032

---------

Co-authored-by: Arnau Jimenez <arnau.jimenez@zeiss.com>
Co-authored-by: Michael Panchenko <m.panchenko@appliedai.de>
2024-04-01 17:14:17 +02:00
Michael Panchenko
5bf923c9bd Removed more references to Chinese docs [skip ci] 2024-03-28 18:17:25 +01:00
Michael Panchenko
23a33a9aa3 Removed link to Chinese docs [skip ci] 2024-03-28 18:13:15 +01:00
Michael Panchenko
ecb272c61b
Update CHANGELOG.md [skip ci] 2024-03-28 18:06:00 +01:00
bordeauxred
4f65b131aa
Feat/refactor collector (#1063)
Closes: #1058 

### Api Extensions
- Batch received two new methods: `to_dict` and `to_list_of_dicts`.
#1063
- `Collector`s can now be closed, and their reset is more granular.
#1063
- Trainers can control whether collectors should be reset prior to
training. #1063
- Convenience constructor for `CollectStats` called
`with_autogenerated_stats`. #1063

### Internal Improvements
- `Collector`s rely less on state, the few stateful things are stored
explicitly instead of through a `.data` attribute. #1063
- Introduced a first iteration of a naming convention for vars in
`Collector`s. #1063
- Generally improved readability of Collector code and associated tests
(still quite some way to go). #1063
- Improved typing for `exploration_noise` and within Collector. #1063

### Breaking Changes

- Removed `.data` attribute from `Collector` and its child classes.
#1063
- Collectors no longer reset the environment on initialization. Instead,
the user might have to call `reset`
expicitly or pass `reset_before_collect=True` . #1063
- VectorEnvs now return an array of info-dicts on reset instead of a
list. #1063
- Fixed `iter(Batch(...)` which now behaves the same way as
`Batch(...).__iter__()`. Can be considered a bugfix. #1063

---------

Co-authored-by: Michael Panchenko <m.panchenko@appliedai.de>
2024-03-28 18:02:31 +01:00
Maximilian Huettenrauch
929dd10267 Merge branch 'thuml_master' into feature/algo-eval 2024-03-28 14:10:55 +01:00
maxhuettenrauch
edae9e4403
fixed env seeding in test_sac_with_il.py (#1081) 2024-03-28 12:52:35 +01:00
Maximilian Huettenrauch
ec2c5c19d1 added primitive joblib launcher 2024-03-27 17:38:01 +01:00
Maximilian Huettenrauch
9c645ff4a0 pleased the mypy gods 2024-03-27 15:37:19 +01:00
Maximilian Huettenrauch
ce5fa0dfac fixed logger test 2024-03-27 13:55:22 +01:00
Maximilian Huettenrauch
9055eb5924 removed attributes from pandas logger 2024-03-27 13:55:13 +01:00
Maximilian Huettenrauch
6d9b697efe restructured and moved RLiableExperimentResult 2024-03-27 12:03:31 +01:00
Maximilian Huettenrauch
18d8ffa576 removed name shortener 2024-03-27 12:02:43 +01:00
Maximilian Huettenrauch
e95fa26a14 replace assert with exception in wandb logger 2024-03-27 11:38:55 +01:00
Maximilian Huettenrauch
dffe8cddf6 fix pandas dependency 2024-03-26 14:40:08 +01:00
Maximilian Huettenrauch
5a3f2291c2 added pandas dependency 2024-03-26 14:37:43 +01:00
Maximilian Huettenrauch
85204b175c added matplotlib dependency 2024-03-26 14:32:42 +01:00
Maximilian Huettenrauch
2e3f0b5e99 move doc string 2024-03-26 14:26:27 +01:00
Maximilian Huettenrauch
d9a201754c updates 2024-03-26 14:23:54 +01:00
Maximilian Huettenrauch
516c956d58 Merge branch 'thuml_master' into feature/algo-eval 2024-03-25 10:32:42 +01:00
Michael Panchenko
61bf9adaff
Update CHANGELOG.md [skip ci] 2024-03-20 23:09:26 +01:00
Michael Panchenko
5f96a57bbb
Add CHANGELOG.md 2024-03-20 23:08:34 +01:00
Michael Panchenko
1a4d7deca6
Update publish.yaml, typo [skip ci[ v1.0.0 2024-03-20 00:41:46 +01:00
Michael Panchenko
72df9a580d
Update publish.yaml [skip ci] 2024-03-20 00:41:17 +01:00
Michael Panchenko
55e9bee373
Update publish.yaml [skip ci] 2024-03-20 00:39:54 +01:00
Michael Panchenko
e3661c11e3
Update publish.yaml, missing / [skip ci] 2024-03-20 00:26:11 +01:00
Maximilian Huettenrauch
5259d5f3fb Merge branch 'thuml_master' into feature/algo-eval
# Conflicts:
#	examples/mujoco/mujoco_env.py
2024-03-15 09:42:17 +01:00
maxhuettenrauch
e82379c47f
Allow explicit setting of multiprocessing context for SubprocEnvWorker (#1072)
Running multiple training runs in parallel (with, for example, joblib)
fails on macOS due to a change in the standard context for
multiprocessing (see
[here](https://stackoverflow.com/questions/65098398/why-using-fork-works-but-using-spawn-fails-in-python3-8-multiprocessing)
or
[here](https://www.reddit.com/r/learnpython/comments/g5372v/multiprocessing_with_fork_on_macos/)).
This PR adds the ability to explicitly set a multiprocessing context for
the SubProcEnvWorker (similar to gymnasium's
[AsyncVecEnv](https://github.com/Farama-Foundation/Gymnasium/blob/main/gymnasium/vector/async_vector_env.py)).
---------

Co-authored-by: Maximilian Huettenrauch <m.huettenrauch@appliedai.de>
Co-authored-by: Michael Panchenko <35432522+MischaPanch@users.noreply.github.com>
2024-03-14 11:07:56 +01:00
Maximilian Huettenrauch
a7898b15b8 small fix 2024-03-12 15:17:33 +01:00
Maximilian Huettenrauch
d9a612a997 format, type check and small fixes 2024-03-12 15:01:50 +01:00
Maximilian Huettenrauch
f730782f29 Merge branch 'thuml_master' into feature/algo-eval 2024-03-12 11:46:08 +01:00
Maximilian Huettenrauch
6c1bd85521 add mujoco example with multiple runs and performance plots 2024-03-12 11:44:48 +01:00
Maximilian Huettenrauch
5762d2c2e0 extend hl experiment builder 2024-03-12 11:43:52 +01:00
Maximilian Huettenrauch
734119ec00 logger updates 2024-03-12 11:31:41 +01:00
Maximilian Huettenrauch
32cd3b4357 logger updates
- introduced logger manager
- loggers can reload logged data from disk
2024-03-11 10:29:17 +01:00
Dominik Jain
1714c7f2c7
High-level API: Fix number of test episodes being incorrectly scaled by number of envs (#1071) 2024-03-07 08:57:11 -08:00
Maximilian Huettenrauch
95cbfe6cdf added explicit env seeding for train and test envs 2024-03-06 17:09:06 +01:00
Michael Panchenko
6746a80f6d
Add publish workflow, first preparation for next release (#1067) 2024-03-04 12:21:49 +01:00
Michael Panchenko
fdb69f1273
Improve README, minor changes in procedural example (#1068) 2024-03-03 15:07:07 +01:00
Dominik Jain
b6b2c95ac7 Improve README, minor changes in procedural example 2024-03-03 15:06:40 +01:00
Erni
1aee41fa9c
Using dist.mode instead of logits.argmax (#1066)
changed all the occurrences where an action is selected deterministically

- **from**: using the outputs of the actor network.
- **to**: using the mode of the PyTorch distribution.

---------

Co-authored-by: Arnau Jimenez <arnau.jimenez@zeiss.com>
2024-03-03 00:09:39 +01:00
maxhuettenrauch
7c970df53f
Fix/add watch env with obs rms (#1061)
Supports deciding whether to watch the agent performing on the env using high-level interfaces
2024-02-29 15:59:11 +01:00
Dominik Jain
49781e715e
Fix high-level examples (#1060)
The high-level examples were all broken by changes made to make mypy
pass.
This PR fixes them, making a type change in logging.run_cli instead to
make mypy happy.
2024-02-23 23:17:14 +01:00
Ashok Arora
0b61bf8caf
Fix the link to the contributing guide. (#1062) 2024-02-23 23:15:41 +01:00
Carlo Cagnetta
ce371ae736
remove old python versions from poetry classifier (#1059) 2024-02-21 15:27:53 +01:00
Michael Panchenko
9b6cb6903e
Improvements in High-Level API and Poe Tasks (#1055)
* Add an option to SamplingConfig which allows to configure number of
test episodes
* Make OptimizerFactory more flexible, adding method
`create_optimizer_for_params`
* Fix AutoAlphaFactoryDefault using hard-coded Adam optimizer
* Fix mypy issues that were platform/installation-dependent
* Limit scope of nbqa, resolving issues with files generated by old
versions of the build

Fixes #1054
2024-02-15 12:02:16 +01:00
Dominik Jain
26e210a6ae Apply nbqa only to the docs/ folder and exclude the (old) jupyter_execute folder 2024-02-15 11:39:45 +01:00
Dominik Jain
08728ad35e Resolve platform-specific/installation-specific mypy issues
by adding ignores and ignoring unused ignores locally
2024-02-15 11:26:54 +01:00
Dominik Jain
f2e0fd165d Fix gitignore applying to tianshou/env on platfoms with case-insensitive file system 2024-02-15 11:26:39 +01:00