else: x_mat = np.loadtxt('in_data/gauss_train.txt') n = '' NP_SEED = 8 OPT_SEED = 3 LOG_NAME = 'gauss_l1_' + n + str(NP_SEED) + '_' + str(OPT_SEED) #Train with l1 penalty until convergence path_pen(x_mat=x_mat, y_mat=x_mat, NP_SEED=NP_SEED, TF_SEED=OPT_SEED, BATCH_DIV=5, LOAD_APDX=None, DIM_H=dim_h, DIM_Z=dim_z, EPOCHS=epochs1, LBDA_L1=LBDA_L1, START_BEST=100, LOG_NAME=LOG_NAME, PRINT=True) os.system('bash ../copy_params.sh phase0_' + LOG_NAME + '_best ' + LOG_NAME + '_best') #Find thershold with 4 remaining connections zero_thresh = 0.01 while count_conns('phase0_' + LOG_NAME + '_best', zero_thresh) > 4: zero_thresh += 0.01 #Threshold and train without penalty with fixed zeros until convergennce
exec(sys.argv[arg]) if NOISE: x_mat = np.loadtxt('in_data/gauss_train_n.txt') n = 'n_' NP_SEED = 4 OPT_SEED = 2 else: x_mat = np.loadtxt('in_data/gauss_train.txt') n = '' NP_SEED = 2 OPT_SEED = 1 LOG_NAME = 'gauss_spae_' + n + str(NP_SEED) + '_' + str(OPT_SEED) #Train with KL penalty until convergence path_pen(x_mat=x_mat, y_mat=x_mat, NP_SEED=OPT_SEED, TF_SEED=OPT_SEED, BATCH_DIV=5, LOAD_APDX=None, DIM_H=dim_h, DIM_Z=dim_z, EPOCHS=epochs1, LBDA_KL=LBDA_KL, START_BEST=1000, LOG_NAME=LOG_NAME) os.system('bash ../copy_params.sh phase0_' + LOG_NAME + '_best ' + LOG_NAME + '_best')
import sys,os sys.path.insert(1,'..') from path_pen import path_pen x_mat=np.loadtxt('in_data/news_train.txt') OPT_SEED=1 LBDA_L1=0.004 ZERO_THRESH=.0081 DIM_Z=4 epochs1=100000 epochs2=100000 epochs3=100000 epochs4=100000 dim_h=50 LOG_NAME = 'news_l14' ##Train with l1 penalty until convergence path_pen(x_mat=x_mat, y_mat=x_mat, NP_SEED=OPT_SEED, TF_SEED=OPT_SEED, BATCH_DIV=5, LOAD_APDX=None, DIM_H=dim_h, DIM_Z=DIM_Z, EPOCHS=epochs1, LBDA_L1=LBDA_L1, LOG_NAME=LOG_NAME, START_BEST=2000) os.system('bash ../copy_params.sh phase0_'+LOG_NAME+'_best '+LOG_NAME+'_best') #Threshold and train without penalty with fixed zeros until convergennce path_pen(x_mat=x_mat, y_mat=x_mat, NP_SEED=OPT_SEED, TF_SEED=OPT_SEED, BATCH_DIV=5, LOAD_APDX='phase0_'+LOG_NAME+'_best', DIM_H=dim_h, DIM_Z=DIM_Z, EPOCHS=epochs2, ZERO_THRESH=ZERO_THRESH, LOG_NAME=LOG_NAME, START_BEST=1000) os.system('bash ../copy_params.sh phase4_'+LOG_NAME+'_best '+LOG_NAME+'_best')
epochs1 = 100000 epochs2 = 100000 epochs3 = 100000 epochs4 = 100000 dim_h = 50 LOG_NAME = 'news_pl4' SAVE_NAME = LOG_NAME #Train without penalty until convergence path_pen(x_mat=x_mat, y_mat=x_mat, NP_SEED=OPT_SEED, TF_SEED=OPT_SEED, BATCH_DIV=5, LOAD_APDX=None, DIM_H=dim_h, DIM_Z=DIM_Z, EPOCHS=epochs1, LOG_NAME=LOG_NAME, START_BEST=2000) os.system('bash ../copy_params.sh phase0_' + LOG_NAME + '_best ' + LOG_NAME + '_best') #Train with exclusive lasso until convergence path_pen(x_mat=x_mat, y_mat=x_mat, NP_SEED=OPT_SEED, TF_SEED=OPT_SEED, BATCH_DIV=5, LOAD_APDX='phase0_' + SAVE_NAME + '_best',
exec(sys.argv[arg]) if NOISE: x_mat = np.loadtxt('in_data/gauss_train_n.txt') n = 'n_' NP_SEED = 5 OPT_SEED = 2 else: x_mat = np.loadtxt('in_data/gauss_train.txt') n = '' NP_SEED = 4 OPT_SEED = 1 LOG_NAME = 'gauss_ae_' + n + str(NP_SEED) + '_' + str(OPT_SEED) #Train without penalty until convergence path_pen(x_mat=x_mat, y_mat=x_mat, NP_SEED=NP_SEED, TF_SEED=OPT_SEED, BATCH_DIV=5, LOAD_APDX=None, DIM_H=dim_h, DIM_Z=dim_z, EPOCHS=epochs1, START_BEST=100, LOG_NAME=LOG_NAME, PRINT=True) os.system('bash ../copy_params.sh phase0_' + LOG_NAME + '_best ' + LOG_NAME + '_best')