def __init__(self, extra): database.DatasetBase.__init__(self, extra) self.name = 'lfw' self.target = 'lfw.vae' self.data_dir = '../_datasets/lfw' self.task = 'train' self.output_dir = None self.device = '0' self.log = params.Log(print_invl=20, save_summaries_invl=20, save_model_invl=1000, test_invl=1000, val_invl=1000, max_iter=999999) """ net """ self.net = params.Net('kin_vae') self.net.set_z_dim(100) """ train """ self.train = params.Phase('train') self.train.lr = [params.LearningRate(), params.LearningRate()] self.train.lr[0].set_fixed(learning_rate=0.000005) self.train.lr[1].set_fixed(learning_rate=0.00005) self.train.optimizer = [params.Optimizer(), params.Optimizer()] self.train.optimizer[0].set_rmsprop() self.train.optimizer[1].set_rmsprop() self.train.data = params.Data(batchsize=32, entry_path='train_1.txt', shuffle=True, total_num=5400, loader='load_image', reader_thread=32) self.train.data = self.set_data_attr(self.train.data) """ test """ self.test = params.Phase('test') self.test.data = params.Data(batchsize=100, entry_path='test_1.txt', shuffle=False, total_num=600, loader='load_image', reader_thread=1) self.test.data = self.set_data_attr(self.test.data) """ val """ self.val = params.Phase('val') self.val.data = params.Data(batchsize=100, entry_path='train_1.txt', shuffle=False, total_num=5400, loader='load_image', reader_thread=1) self.val.data = self.set_data_attr(self.val.data)
def __init__(self, extra): database.DatasetBase.__init__(self, extra) r = self._read_config_file """ base """ self.name = 'mnist' self.target = 'cnn.classification' # 'ml.active.sampler' self.data_dir = '../_datasets/mnist' self.task = 'train' self.output_dir = None self.device = '0' """ log """ self.log = params.Log( print_invl=20, save_summaries_invl=10, save_model_invl=500, test_invl=500, val_invl=500, max_iter=999999) """ net """ self.net = params.Net('cifarnet') self.net.set_weight_decay(0.0001) self.net.set_dropout_keep(0.5) """ train """ self.train = params.Phase('train') self.train.lr = [params.LearningRate()] self.train.lr[0].set_fixed(learning_rate=0.001) self.train.optimizer = [params.Optimizer()] self.train.optimizer[0].set_momentum() self.train.data = params.Data( batchsize=32, entry_path="train.txt", shuffle=True, total_num=55000, loader='load_image') self.train.data = self.set_data_attr(self.train.data) """ test """ self.test = params.Phase('test') self.test.data = params.Data( batchsize=50, entry_path="test.txt", shuffle=False, total_num=10000, loader='load_image', reader_thread=1) self.test.data = self.set_data_attr(self.test.data)
def __init__(self, extra): database.DatasetBase.__init__(self, extra) self.name = 'mnist' self.target = 'gan.acgan' self.data_dir = '../_datasets/mnist' self.task = 'train' self.output_dir = None self.device = '0' self.log = params.Log( print_invl=20, save_summaries_invl=10, save_model_invl=500, test_invl=500, val_invl=500, max_iter=999999) """ net """ self.net = params.Net('cvae') self.net.set_z_dim(100) """ train """ self.train = params.Phase('train') self.train.lr = [params.LearningRate(), params.LearningRate()] self.train.lr[0].set_fixed(learning_rate=0.001) self.train.lr[1].set_fixed(learning_rate=0.001) self.train.optimizer = [params.Optimizer(), params.Optimizer()] self.train.optimizer[0].set_adam(beta1=0.5) self.train.optimizer[1].set_adam(beta1=0.5) self.train.data = params.Data( batchsize=32, entry_path="train.txt", shuffle=True, total_num=55000, loader='load_image') self.train.data = self.set_data_attr(self.train.data) """ test """ self.test = params.Phase('test') self.test.data = params.Data(batchsize=100) self.test.data.set_label(num_classes=10)
def __init__(self, extra): database.DatasetBase.__init__(self, extra) r = self._read_config_file """ base """ self.name = 'avec2014.audio' self.target = 'avec.audio.cnn' self.data_dir = '../_datasets/AVEC2014_Audio' self.task = 'train' self.output_dir = None self.device = '0' """ log """ self.log = params.Log(print_invl=1, save_summaries_invl=10, save_model_invl=500, test_invl=500, val_invl=500, max_iter=999999) """ net """ self.net = params.Net('audionet') self.net.set_weight_decay(0.0001) # self.net.set_dropout_keep(0.5) """ train """ self.train = params.Phase('train') self.train.lr = [params.LearningRate()] self.train.lr[0].set_fixed(learning_rate=0.001) self.train.optimizer = [params.Optimizer()] self.train.optimizer[0].set_adam() self.train.data = params.Data(batchsize=32, entry_path="pp_trn_succ64.txt", shuffle=True, total_num=15292, loader='load_audio', reader_thread=32) self.train.data = self.set_data_attr(self.train.data) """ test """ self.test = params.Phase('test') self.test.data = params.Data(batchsize=50, entry_path="pp_tst_succ64.txt", shuffle=False, total_num=25465, loader='load_audio', reader_thread=1) self.test.data = self.set_data_attr(self.test.data)
def __init__(self, extra): database.DatasetBase.__init__(self, extra) r = self._read_config_file """ base """ self.name = r('kinface2.vae', 'name') self.target = r('kinvae.bidirect11', 'target') self.data_dir = r('../_datasets/kinface2', 'data_dir') self.task = r('train', 'task') self.output_dir = r(None, 'output_dir') self.device = '0' self.log = params.Log( print_invl=20, save_summaries_invl=20, save_model_invl=500, test_invl=500, val_invl=500, max_iter=15000) """ Net """ self.net = params.Net('kin_vae') self.net.set_z_dim(100) """ train """ self.train = params.Phase('train') self.train.lr = [params.LearningRate(), params.LearningRate()] self.train.lr[0].set_fixed(learning_rate=r(0.000005, 'train.lr0')) self.train.lr[1].set_fixed(learning_rate=r(0.00005, 'train.lr1')) self.train.optimizer = [params.Optimizer(), params.Optimizer()] self.train.optimizer[0].set_rmsprop() self.train.optimizer[1].set_rmsprop() self.train.data = params.Data( batchsize=r(32, 'train.batchsize'), entry_path=r('train_1.txt', 'train.entry_path'), shuffle=True, total_num=r(1600, 'train.total_num'), loader='load_image', reader_thread=32) self.train.data = self.set_data_attr(self.train.data) """ test """ self.test = params.Phase('test') self.test.data = params.Data( batchsize=r(100, 'test.batchsize'), entry_path=r('test_1.txt', 'test.entry_path'), shuffle=False, total_num=r(400, 'test.total_num'), loader='load_image', reader_thread=1) self.test.data = self.set_data_attr(self.test.data) """ val """ self.val = params.Phase('val') self.val.data = params.Data( batchsize=r(100, 'val.batchsize'), total_num=r(1600, 'val.total_num'), shuffle=False, entry_path=r('train_1.txt', 'val.entry_path'), loader='load_image', reader_thread=1) self.val.data = self.set_data_attr(self.val.data)