d3rlpy.preprocessing.PixelScaler¶
-
class
d3rlpy.preprocessing.
PixelScaler
[source]¶ Pixel normalization preprocessing.
\[x' = x / 255\]from d3rlpy.dataset import MDPDataset from d3rlpy.algos import CQL dataset = MDPDataset(observations, actions, rewards, terminals) # initialize algorithm with PixelScaler cql = CQL(scaler='pixel') cql.fit(dataset.episodes)
Methods
-
fit
(episodes)[source]¶ Estimates scaling parameters from dataset.
- Parameters
episodes (List[d3rlpy.dataset.Episode]) – list of episodes.
- Return type
-
fit_with_env
(env)[source]¶ Gets scaling parameters from environment.
- Parameters
env (gym.core.Env) – gym environment.
- Return type
-
reverse_transform
(x)[source]¶ Returns reversely transformed observations.
- Parameters
x (torch.Tensor) – observation.
- Returns
reversely transformed observation.
- Return type
torch.Tensor
-
transform
(x)[source]¶ Returns processed observations.
- Parameters
x (torch.Tensor) – observation.
- Returns
processed observation.
- Return type
torch.Tensor
Attributes
-