tr = DataSet([cfg.te_data[0]], cfg) else: tr = DataSet([cfg.tr_data[0]], cfg) tr.avg_correction2(avg_file) iterations = 10000 loop = cfg.loop print "input attribute", cfg.att, "LR", cfg.lr, \ 'feature', cfg.feature_len, 'add', cfg.add_len inputs = {} output = {} lr = cfg.lr learning_rate = tf.placeholder(tf.float32, shape=[]) cfg.Nout = cfg.fc_Nout * 2 cfg.Nout = 3 cfg.ref_node = cfg.fc_nodes[0][-1] cfg.refs = np.ones(cfg.ref_node) cfg.refs = cfg.refs.reshape((1, cfg.ref_node)) inputs[0] = tf.placeholder(tf.float32, [None, cfg.ref_node]) for a in range(cfg.feature_len): inputs[a + 1] = tf.placeholder(tf.float32, [None, cfg.att]) input_dic = {} for a in range(cfg.feature_len + 1): input_dic['input_{}'.format(a)] = inputs[a] net = rNet(input_dic)
cfg = Config(config_file) avg_file = Utils.avg_file_name(cfg.netFile) if test == 'te': tr = DataSet([cfg.te_data[0]], cfg, sub_sample=0.1) else: tr = DataSet([cfg.tr_data[0]], cfg) tr.subtract_avg(avg_file, save_im=False) inputs = {} output = {} cfg.Nout = 3 cfg.att = 4 cfg.ref_node = cfg.nodes[0][-1] cfg.refs = np.ones(cfg.ref_node) cfg.refs = cfg.refs.reshape((1, cfg.ref_node)) inputs[0] = tf.placeholder(tf.float32, [None, cfg.ref_node]) for a in range(cfg.feature_len): inputs[a + 1] = tf.placeholder(tf.float32, [None, cfg.att]) input_dic = {} for a in range(cfg.feature_len + 1): input_dic['input_{}'.format(a)] = inputs[a] net = rNet(input_dic)