src/model/ddpg/ddpg.py
def predict_single(self, observation):
        """ Predict the action of a single observation

        Args:
            observation: (num_stocks + 1, window_length)

        Returns: a single action array with shape (num_stocks + 1,)

        """
        if self.obs_normalizer:
            observation = self.obs_normalizer(observation)
        action = self.actor.predict(np.expand_dims(observation, axis=0)).squeeze(axis=0)
        if self.action_processor:
            action = self.action_processor(action)
        return action
 Predict the action of a single observation

        Args:
            observation: (num_stocks + 1, window_length)

        Returns: a single action array with shape (num_stocks + 1,)

        
Predict the action of a single observation
Predict the action of a single observation
def predict_single(self, observation):
        if self.obs_normalizer:
            observation = self.obs_normalizer(observation)
        action = self.actor.predict(np.expand_dims(observation, axis=0)).squeeze(axis=0)
        if self.action_processor:
            action = self.action_processor(action)
        return action
def predict_single ( self , observation ) : if self . obs_normalizer : observation = self . obs_normalizer ( observation ) action = self . actor . predict ( np . expand_dims ( observation , axis = 0 ) ) . squeeze ( axis = 0 ) if self . action_processor : action = self . action_processor ( action ) return action
Predict the action of a single observation
Predict the action of a single observation
""" Predict the action of a single observation

        Args:
            observation: (num_stocks + 1, window_length)

        Returns: a single action array with shape (num_stocks + 1,)

        """
self
observation
(num_stocks + 1, window_length)
( num_stocks + 1 window_length )