def main():
    #  convert_to_numpy()
    print 'Loading data...'
    data = load_data_set('Data/trainData.npy')

    obj = DimReductionMissingData(data, reduced_dim=100)
    obj.optimize(num_epochs=5, batch_size=1000)
def main():
    data_set, _, _ = mnist_loader()
    data = np.asarray(data_set[0][0:20000])
    np.random.shuffle(data)
    data_org = data.copy()
    set_random_missing_values(data, 0.70)
    dim_red_object = DimReductionMissingData(data, reduced_dim=60)
    B = dim_red_object.optimize(num_epochs=5, batch_size=1000)
    data_reduced = dim_red_object.get_reduced_dimensions(B=B, X=dim_red_object.X,  mask=dim_red_object.X_mask)
    data_reconstructed = np.dot(data_reduced, B) + dim_red_object.X_mean
    show_mnist_image(data_org, data, data_reconstructed)