Ejemplo n.º 1
0
def visualise_features(P, centroids):
    PC = np.dot(centroids, P.T)
    plt.figure(figsize=(12, 8))
    utils.visualise_filters(PC.T,
                            settings['patch_height'],
                            settings['patch_width'],
                            posneg=False)
    plt.draw()
Ejemplo n.º 2
0
    plt.clf()
    plt.plot(objs_train_so_far, label='train')
    plt.plot(objs_valid_so_far, label='validation')
    plt.title("objective")
    plt.legend()
    plt.draw()
    
    plt.figure(3)
    plt.clf()
    plt.plot(ces_train_so_far, label='train')
    plt.plot(ces_valid_so_far, label='validation')
    plt.title("cross-entropy")
    plt.legend()
    plt.draw()
    
    plt.figure(4)
    plt.clf()
    visualise_filters(rbm.W.var.get_value(), dim=28)
    plt.colorbar()
    plt.title("filters")
    plt.draw()
    
    
    print "Epoch %d" % epoch
    print "training set: MSE = %.6f, CE = %.6f, objective = %.6f" % (mse_train, ce_train, obj_train)
    print "validation set: MSE = %.6f, CE = %.6f, objective = %.6f" % (mse_valid, ce_valid, obj_valid)




Ejemplo n.º 3
0
    plt.draw()

    plt.figure(2)
    plt.clf()
    plt.plot(objs_train_so_far, label='train')
    plt.plot(objs_valid_so_far, label='validation')
    plt.title("objective")
    plt.legend()
    plt.draw()

    plt.figure(3)
    plt.clf()
    plt.plot(ces_train_so_far, label='train')
    plt.plot(ces_valid_so_far, label='validation')
    plt.title("cross-entropy")
    plt.legend()
    plt.draw()

    plt.figure(4)
    plt.clf()
    visualise_filters(rbm.W.var.get_value(), dim=28)
    plt.colorbar()
    plt.title("filters")
    plt.draw()

    print "Epoch %d" % epoch
    print "training set: MSE = %.6f, CE = %.6f, objective = %.6f" % (
        mse_train, ce_train, obj_train)
    print "validation set: MSE = %.6f, CE = %.6f, objective = %.6f" % (
        mse_valid, ce_valid, obj_valid)
Ejemplo n.º 4
0
def visualise_features(P, centroids):
    PC = np.dot(centroids, P.T)
    plt.figure(figsize=(12,8))
    utils.visualise_filters(PC.T, settings['patch_height'], settings['patch_width'], posneg=False)
    plt.draw()