训练1024维特征的数据集合,multi-label, 转成多个1的onehot的label, 2个全连接。很直接的顺序编程,练习、便于理解
# Import your data
#from tensorflow.examples.tutorials.mnist import input_data
import os
import tensorflow as tf
from tensorflow import gfile
from tensorflow import logging
from tensorflow import flags
from tensorflow import app
import numpy as np
# Parameters
learning_rate = 0.001
training_epochs = 5
batch_size = 512
display_step = 2
# Network Parameters
n_hidden_1 = 256 # 1st layer number of features
n_hidden_2 = 128 # 2nd layer number of features
n_input = 1024 #
n_classes = 4716
# tf Graph input
x = tf.placeholder("float", [None, n_input])
y = tf.placeholder("float", [None, n_classes])
# Create model
def multilayer_perceptron(x, weights, biases):
# Hidden layer with RELU activatio