From 35df8f44da208cdb51670c0b2195cbecbd7d04b0 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 21 May 2023 17:37:45 +0200 Subject: [PATCH] Performance Optimizations when skip_conditioning=True --- priorConditionedAnnealing/pca.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/priorConditionedAnnealing/pca.py b/priorConditionedAnnealing/pca.py index b71efaa..db13ef9 100644 --- a/priorConditionedAnnealing/pca.py +++ b/priorConditionedAnnealing/pca.py @@ -183,6 +183,9 @@ class PCA_Distribution(SB3_Distribution): return traj[:, -self.window:, :] def _conditioning_engine(self, trajectory, pi_mean, pi_std): + if self.skip_conditioning: + return pi_mean, pi_std + traj = self._pad_and_cut_trajectory(trajectory) y_np = np.append(np.swapaxes(traj, -1, -2), np.expand_dims(pi_mean, -1), -1)