Esempio n. 1
0
        ["conv", [3, 3, 128, 128], [1, 1, 1, 1], 0.1, "SAME", False],
        ["conv", [3, 3, 128, 128], [1, 1, 1, 1], 0.1, "SAME", False],
        ["conv", [3, 3, 128, 128], [1, 1, 1, 1], 0.1, "SAME", False],
        ["avgpool", [1, 8, 8, 1], [1, 4, 4, 1]],
        #["dropout",keep_prob_holder]
    ]
    line_shape_result, len_shape_length = net.CNN_Interface(
        image,
        CNN_LAYERS,
        bias=False,
        active_function=tf.nn.relu,
        output_each_layer=True)
    Layer[0] = len_shape_length
    label = net.FC_Interface(line_shape_result,
                             Layer,
                             keep_prob_layer=keep_prob_holder,
                             stddev=0.001,
                             active_function=tf.nn.relu)

with tf.variable_scope("Sample_Output"):
    #测试输出
    label_to_num = tf.argmax(label, 1)[0]
    label__to_num = tf.argmax(label_, 1)[0]
    label_sampel = tf.nn.softmax(label[0])

with tf.variable_scope("Train_Model"):
    #总计训练次数
    global_step = tf.Variable(0, trainable=False)
    #学习率
    LEARNING_RATE_BASE = tf.Variable(LEARNING_RATE_BASE)
    #学习率指数衰减