import tensorflow as tf import numpy as np from TTGP.covariance import SE_multidim, BinaryKernel from TTGP.projectors import LinearProjector, Identity from TTGP.gpstruct_runner import GPStructRunner with tf.Graph().as_default(): data_dir = 'data_struct/' n_inputs = 10 mu_ranks = 10 # D = 6438 # P = np.load('P.npy') # projector = LinearProjector(D=D, d=5, trainable=True) D = 5 projector = Identity(D=D) n_labels = 3 cov = SE_multidim(n_labels, 0.7, 0.2, 0.1, projector) bin_cov = BinaryKernel(n_labels, alpha=1.) lr = 5e-4 decay = (10, 0.2) n_epoch = 30 batch_size = 100 log_dir = None save_dir = None model_dir = save_dir load_model = False runner = GPStructRunner(data_dir, n_inputs, mu_ranks, cov, bin_cov, lr=lr, decay=decay, n_epoch=n_epoch, batch_size=batch_size,
noise = 0.1 X, y = make_classification(n_samples=N_samples, n_features=N_dim, n_classes=2, n_clusters_per_class=2, n_informative=N_dim, n_redundant=0) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33) batch_size = 100 n_epochs = 111 y_p, m = 0, 0 with tf.Graph().as_default(): data_dir = "data_class/" n_inputs = 30 mu_ranks = 10 projector = Identity(D=N_dim) C = 2 cov = SE_multidim(C, 0.7, 1.0, 0.1, projector) # cov = SE(0.7, 0.2, 0.1,projector) lr = 1e-2 runner = GPCRunner(n_inputs, mu_ranks, cov, X=X, X_test=X_test, y=y.reshape(-1, 1), y_test=y_test, lr=lr, n_epoch=n_epochs, batch_size=batch_size, batch_test=False)