Mcts-simple

Latest version: v1.0.3

Safety actively analyzes 688917 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.0.3

* Hotfix for `expansion()` function. When selecting a node that supposedly has an outcome, no children, and was generated via the expansion phase in a previous episode, `node.has_outcome = False` as it has never gone through the backpropagation phase. This causes the `AssertionError` for `len(node.children) > 0` to be triggered in `expansion()`. This update fixes this bug!

1.0.1

* Implementing a more lightweight, faster, and memory efficient version of MCTS.
* More than 10x reduction in space and time complexity.
* Linear instead of exponential time complexity.
* Automatic hashing of state using `str()` which can be reverted using Python's in-built `eval()`.
* Now your game state can be returned as a list! However, do ensure that typings of both state and action remain constant throughout.
* Type hints are now supported for better documentation of code.
* Different variants of MCTS are split into different files for improved readability of code.
* cPickle is now used in place of JSONPickle to speed up the exporting and importing process of MCTS.
* tqdm now automatically detects the IDE that is used and outputs the progress bar accordingly.
* Removed `delete_last_action()` method from game environment class.
* `_import()` and `_export()` methods are now referred to as `save()` and `load()` respectively.
* Player name is automatically paired with state and used as key when searching through transposition table.

0.1.2

Added open-loop MCTS and UCT.
Removed gc.collect() for immensely faster simulations.
Added examples: Fighting Game, Cart Pole (examples on how to prepare gym environments for MCTS)

**Side note:** Cart Pole example was improved on after this release was created. While Cart Pole example will be updated accordingly in v0.2, you can still access it through the repository.

0.0.3

Added closed-loop MCTS and UCT.

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.