ravens/models/transport.py
def visualize_logits(self, logits):
        """Given logits (BEFORE tf.nn.convolution), get heatmap.

        Here we apply a softmax to make it more human-readable. However, the
        tf.nn.convolution with the learned kernels happens without a softmax
        on the logits.
        """
        original_shape = logits.shape
        logits = tf.reshape(logits, (1, np.prod(original_shape)))
        logits = tf.nn.softmax(logits)
        vis_transport = np.float32(logits).reshape(original_shape)
        vis_transport = vis_transport[0]
        vis_transport = vis_transport - np.min(vis_transport)
        vis_transport = 255 * vis_transport / np.max(vis_transport)
        vis_transport = cv2.applyColorMap(np.uint8(vis_transport), cv2.COLORMAP_RAINBOW)
        # Only if we're saving with cv2.imwrite
        #vis_transport = cv2.cvtColor(vis_transport, cv2.COLOR_RGB2BGR)
        plt.subplot(1, 1, 1)
        plt.title(f'Logits', fontsize=15)
        plt.imshow(vis_transport)
        plt.tight_layout()
        plt.show()
Given logits (BEFORE tf.nn.convolution), get heatmap.

        Here we apply a softmax to make it more human-readable. However, the
        tf.nn.convolution with the learned kernels happens without a softmax
        on the logits.
        
Given logits (BEFORE tf.nn.convolution), get heatmap.
Here we apply a softmax to make it more human-readable. However, the
tf.nn.convolution with the learned kernels happens without a softmax
on the logits.
Given logits ( BEFORE tf . nn . convolution ) get heatmap . Here we apply a softmax to make it more human - readable . However the tf . nn . convolution with the learned kernels happens without a softmax on the logits .
def visualize_logits(self, logits):
        original_shape = logits.shape
        logits = tf.reshape(logits, (1, np.prod(original_shape)))
        logits = tf.nn.softmax(logits)
        vis_transport = np.float32(logits).reshape(original_shape)
        vis_transport = vis_transport[0]
        vis_transport = vis_transport - np.min(vis_transport)
        vis_transport = 255 * vis_transport / np.max(vis_transport)
        vis_transport = cv2.applyColorMap(np.uint8(vis_transport), cv2.COLORMAP_RAINBOW)
        plt.subplot(1, 1, 1)
        plt.title(f'Logits', fontsize=15)
        plt.imshow(vis_transport)
        plt.tight_layout()
        plt.show()
def visualize_logits ( self , logits ) : original_shape = logits . shape logits = tf . reshape ( logits , ( 1 , np . prod ( original_shape ) ) ) logits = tf . nn . softmax ( logits ) vis_transport = np . float32 ( logits ) . reshape ( original_shape ) vis_transport = vis_transport [ 0 ] vis_transport = vis_transport - np . min ( vis_transport ) vis_transport = 255 * vis_transport / np . max ( vis_transport ) vis_transport = cv2 . applyColorMap ( np . uint8 ( vis_transport ) , cv2 . COLORMAP_RAINBOW ) plt . subplot ( 1 , 1 , 1 ) plt . title ( f'Logits' , fontsize = 15 ) plt . imshow ( vis_transport ) plt . tight_layout ( ) plt . show ( )
Given logits (BEFORE tf.nn.convolution), get heatmap.
Given logits ( BEFORE tf . nn . convolution ) get heatmap .
"""Given logits (BEFORE tf.nn.convolution), get heatmap.

        Here we apply a softmax to make it more human-readable. However, the
        tf.nn.convolution with the learned kernels happens without a softmax
        on the logits.
        """ # Only if we're saving with cv2.imwrite #vis_transport = cv2.cvtColor(vis_transport, cv2.COLOR_RGB2BGR)
self
logits