Open maltemosbach opened 3 years ago
Implemented classes VectorEncoder
, VectorDecoder
, ImageEncoder
and ImageDecoder
. Layer hyperparameters were taken from the original PlaNet Repo. A quick sanity test for ImageEncoder
and ImageDecoder
can be found in tests/encoder_decoder.py
Top, hab den code noch nicht getestet, sieht aber gut aus. 2 Dinge, die du noch machen kannst:
observation_size
und embedding_size
ein bool argument wie is_image_based
oder visual
oder so bekommt. Wenn das true is, gibst du deinen image encoder zurück und wenn nicht den vector encoder. Beim Decoder analog.observation_size
auf eine embedding_size
gehen willst, gibt man häufig noch eine zusätzliche variable hidden_size
an. Die Layer inputs und outputs wären dann zum Beispiel (observation_size, hidden_size) und (hidden_size, hidden_size) und (hidden_size, embedding_size). Posterior von SSM stützt sich auf die Originalimplementierung: prior_mean
und prior_stddev
werden mit in das fully connected NN gegeben, nicht aber ein Zustand, der vom prior gesampled wird (das steht in meinen Notizen). Falls das nicht korrekt ist, ist es schnell geändert.
Different architectures can be used to implement the latent dynamics model for a model-based agent. Implement the following models in the subdirectories of
models/dynamics_models
. All dynamics models should inherit from the base class inlatent_dynamics_model.py
and implement the abstract methods. Implement the dynamics model:For all models you should implement an encoder e_t = enc(o_t), a decoder p(o_t | s_t), prior and posterior transition dynamics p(s_t | s_t-1, a_t-1) and q(s_t | s_t-1, a_t-1, e_t). Ideally, encoder and decoder are shared between all architectures and only the transition dynamics are implemented separately. You must also implement a reward model that maps form state to reward as it is needed by the planner. Further, in the PlaNet agent, you should create the appropriate functions to calculate your model loss, such that the parameters can be optimized. The only files that should really be relevant for you are
algos/planet.py
and the dynamics models you should implement in subdirectories ofmodels/dynamics_models
. Helpful repositories to get started are:References
Hafner, D., Lillicrap, T., Fischer, I., Villegas, R., Ha, D., Lee, H. Davidson, J.. (2019). Learning Latent Dynamics for Planning from Pixels. ICML