INNER CODE UNIT · Python

plot_value_prediction

MITDeepLearning/introtodeeplearning · mitdeeplearning/lab2.py:36

def plot_value_prediction(i, predictions_array, true_label):
    predictions_array, true_label = predictions_array[i], true_label[i]
    plt.grid(False)
    plt.xticks([])
    plt.yticks([])
    thisplot = plt.bar(range(10), predictions_array, color="#777777")
    plt.ylim([0, 1])
    predicted_label = np.argmax(predictions_array)

    thisplot[predicted_label].set_color("red")
    thisplot[true_label].set_color("blue")


class TrainingDatasetLoader(object):
    def __init__(self, data_path, channels_last=True):
        print("Opening {}".format(data_path))
        sys.stdout.flush()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…