import tensorflow as tf
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
# load data
digits = load_digits()
X = digits.data
y = digits.target
y = LabelBinarizer().fit_transform(y)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size =.3)
def add_layer(inputs, in_size, out_size, layer_name, activation_function = None):
# add one more layer and return he output of this layer
Weights = tf.Variable(tf.random_normal([in_size, out_size
用dropout解决过拟合
最新推荐文章于 2024-01-13 23:08:54 发布