Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't represent a state from which there are no actions #17

Open
RichoDemus opened this issue Jul 25, 2023 · 2 comments
Open

Can't represent a state from which there are no actions #17

RichoDemus opened this issue Jul 25, 2023 · 2 comments

Comments

@RichoDemus
Copy link

Hey! cool crate, I'm playing around with it a bit. I realized that I can't seem to represent a state from which there are no actions, I'm training a model to play a game and in this game there are some "end states" like the end of the game where you're scored on your performance, but if I have my State::actions function return an empty vec I get a div/0 error here :https://github.com/milanboers/rurel/blob/40d0fa7116c528953780b74e0a19756182a70a72/src/mdp/mod.rs#L22C59-L22C59

since there are no actions. Maybe I'm just misunderstanding how this is supposed to work :)

@HyperCodec
Copy link

HyperCodec commented Oct 20, 2023

it's probably dividing by the length of your actions vec.

your State::actions should return all possible actions the AI can make, it'll select from those for the output.

edit: they should prob make an explicit panic if it detects the actions length as 0 though to not confuse people

@LeoDog896
Copy link

https://github.com/milanboers/rurel/blob/master/src/examples/weightedcoin.rs The weighted coin example demonstrates how to train with terminating states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants