src/model/supervised/cnn.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,)

        """
        obsX = observation[:, -self.window_length:, 3:4] / observation[:, -self.window_length:, 0:1]
        obsX = normalize(obsX)
        obsX = np.expand_dims(obsX, axis=0)
        with self.graph.as_default():
            return np.squeeze(self.model.predict(obsX), axis=0)
 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):
        obsX = observation[:, -self.window_length:, 3:4] / observation[:, -self.window_length:, 0:1]
        obsX = normalize(obsX)
        obsX = np.expand_dims(obsX, axis=0)
        with self.graph.as_default():
            return np.squeeze(self.model.predict(obsX), axis=0)
def predict_single ( self , observation ) : obsX = observation [ : , - self . window_length : , 3 : 4 ] / observation [ : , - self . window_length : , 0 : 1 ] obsX = normalize ( obsX ) obsX = np . expand_dims ( obsX , axis = 0 ) with self . graph . as_default ( ) : return np . squeeze ( self . model . predict ( obsX ) , axis = 0 )
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 )