Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Expectations on observation type #25

Closed
zsunberg opened this issue Nov 16, 2019 · 6 comments
Closed

Expectations on observation type #25

zsunberg opened this issue Nov 16, 2019 · 6 comments

Comments

@zsunberg
Copy link
Member

I'm thinking about making a bridge from POMDPs.jl to this package. Are there any expectations/requirements on what the output of observe is? Should it be an AbstractVector for example?

@zsunberg
Copy link
Member Author

Oh, is it supposed to be an Observation? If so, are there any expectations on the type of Observation.state

@zsunberg
Copy link
Member Author

Ah, I see that there actually is already some integration with POMDPs! Cool! I may make a PR with some updates to support more features of POMDPs.jl

@findmyway
Copy link
Member

Great!

There's no constraint of Observation. It's just a very thin wrapper of NameTuple to make things easier for multiple dispatch.

I remember that POMDP related environments are written by @jbrea . He may provide help with your PR.

@findmyway
Copy link
Member

Hi @zsunberg,

The observation can be an arbitrary type now, as long as if the interfaces are implemented.

Inspired by RLInterface.jl, I add the support for POMDP models here.

I'm not very familiar with the code in POMDP. So currently, for a (PO)MDPModel, I tried to implement the get_action_space interface like this here:

RLBase.get_action_space(m::Union{<:POMDP,<:MDP}) = convert(AbstractSpace, actions(m))

But it won't work for (Multi)ContinuousSpace (because I didn't implement the convert functions for them). Is there any methods in POMDP to detect whether a model is continuous or discrete?

Besides, the get_observation_space is also not implemented. One can manually specify it when it is useful. (For example, like this)

@zsunberg
Copy link
Member Author

Nice, very cool! Where did you get the @interface macro? I am very interested in what you are using for that.

Also, is it necessary for all spaces to be AbstractSpaces? I have found it very convenient to let the action space be a Vector or Set.

There is not currently an interface to determine whether spaces continuous or discrete. We have not taken the time to develop any types to represent bounded continuous spaces since we found that most problems are hybrid anyways and it is actually convenient in many solvers to not make the distinction between continuous and discrete.

@findmyway
Copy link
Member

Where did you get the @interface macro? I am very interested in what you are using for that.

Inspired by

I just use it for in-line export. And when the function body is missing, an error expression will be inserted.

is it necessary for all spaces to be AbstractSpaces?

Good question. If the action space is just Vector or Set. Then interfaces of AbstractSpace are implemented by default. So there shouldn't be any problem at least for now.

it is actually convenient in many solvers to not make the distinction between continuous and discrete.

I see. Thanks for the message.

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

No branches or pull requests

2 participants