Comments (7)
It is already considered in here.
dreamer-pytorch/dreamer/algos/dreamer_algo.py
Lines 194 to 196 in 47bd509
from dreamer-pytorch.
Hi, shouldn't it be
observation = samples.all_observation[:-1] # [t, t+batch_length+1] -> [t, t+batch_length]
action = samples.all_action[:-1] # [t-1, t+batch_length] -> [t-1, t+batch_length-1]
reward = samples.all_reward[1:] # [t-1, t+batch_length] -> [t, t+batch_length]
so that
self.representation_model(obs_embed[t], action[t], prev_state)
will be
Current code is computing
from dreamer-pytorch.
all_observation is observation. not state. check the comment in lines :)
from dreamer-pytorch.
Hi sorry maybe I was not clear. My question was about indexing the action. The code is
observation = samples.all_observation[:-1] # [t, t+batch_length+1] -> [t, t+batch_length]
action = samples.all_action[1:] # [t-1, t+batch_length] -> [t, t+batch_length]
reward = samples.all_reward[1:] # [t-1, t+batch_length] -> [t, t+batch_length]
reward = reward.unsqueeze(2)
done = samples.done
done = done.unsqueeze(2)
# Extract tensors from the Samples object
# They all have the batch_t dimension first, but we'll put the batch_b dimension first.
# Also, we convert all tensors to floats so they can be fed into our models.
lead_dim, batch_t, batch_b, img_shape = infer_leading_dims(observation, 3)
# squeeze batch sizes to single batch dimension for imagination roll-out
batch_size = batch_t * batch_b
# normalize image
observation = observation.type(self.type) / 255.0 - 0.5
# embed the image
embed = model.observation_encoder(observation)
prev_state = model.representation.initial_state(batch_b, device=action.device, dtype=action.dtype)
# Rollout model by taking the same series of actions as the real model
prior, post = model.rollout.rollout_representation(batch_t, embed, action, prev_state)
which means embed
is
from dreamer-pytorch.
no. action is [t, t+batch_length+1]
by [:-1]
and action sequence timestep is like [t-1, t+batch_length]
by [1:]
from dreamer-pytorch.
Because the comment for observation is
# [t, t+batch_length+1] -> [t, t+batch_length]
and for action is
# [t-1, t+batch_length] -> [t, t+batch_length]
So that's why I thought it was wrong because both are
from dreamer-pytorch.
Okay. Every code is fine. Depending on where you cut the array, you can create data starting from t-1 or data starting from t. Thanks.
from dreamer-pytorch.
Related Issues (13)
- Observation decoder cannot reconstruct images other than size 3, 64, 64
- Make hyperparameters aligned with dreamer HOT 1
- main.py does not run on pytorch==1.5.0
- Probability of Continuing / Discount Modeling
- Error with gradients
- Does this repo reproduce original result HOT 1
- Very minor bug in RSSM HOT 1
- Gradient and loss are shown as Nan(Atari game) HOT 2
- What are the results of this on atari envs?
- some bug with "python main.py" ~v~ HOT 1
- batch_length doesn't seem to work
- Issue in Adjusting Exploration Amount in Dreamer Agent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dreamer-pytorch.