examples/attention_models/baseline_model.py
def _glimpse_network(self, x_t, l_p):
        """
        Parameters:
            x_t - 28x28 image
            l_p - 2x1 focus vector
        Returns:
            4x12 matrix
        """
        sensor_output = self._refined_glimpse_sensor(x_t, l_p)
        sensor_output = T.flatten(sensor_output)
        h_g = self._relu(T.dot(sensor_output, self.W_g0))
        h_l = self._relu(T.dot(l_p, self.W_g1))
        g = self._relu(T.dot(h_g, self.W_g2_hg) + T.dot(h_l, self.W_g2_hl))
        return g
def _glimpse_network(self, x_t, l_p):
        """
        Parameters:
            x_t - 28x28 image
            l_p - 2x1 focus vector
        Returns:
            4x12 matrix
        """
        sensor_output = self._refined_glimpse_sensor(x_t, l_p)
        sensor_output = T.flatten(sensor_output)
        h_g = self._relu(T.dot(sensor_output, self.W_g0))
        h_l = self._relu(T.dot(l_p, self.W_g1))
        g = self._relu(T.dot(h_g, self.W_g2_hg) + T.dot(h_l, self.W_g2_hl))
        return g
def _glimpse_network ( self , x_t , l_p ) : sensor_output = self . _refined_glimpse_sensor ( x_t , l_p ) sensor_output = T . flatten ( sensor_output ) h_g = self . _relu ( T . dot ( sensor_output , self . W_g0 ) ) h_l = self . _relu ( T . dot ( l_p , self . W_g1 ) ) g = self . _relu ( T . dot ( h_g , self . W_g2_hg ) + T . dot ( h_l , self . W_g2_hl ) ) return g
Parameters:
            x_t - 28x28 image
            l_p - 2x1 focus vector
        Returns:
            4x12 matrix
Parameters : x_t - 28x28 image l_p - 2x1 focus vector Returns : 4x12 matrix