在用户手册中,它显示了下面的不同kernel_initializer
https://keras.io/initializers/
主要目的是初始化神经网络中的权重矩阵.
任何人都知道默认的初始化程序是什么?该文档未显示默认值.
我是 Keras 新手,我正在尝试获取 Keras 中的权重。我知道如何在 Python 中的 Tensorflow 中执行此操作。
代码:
data = np.array(attributes, 'int64')
target = np.array(labels, 'int64')
feature_columns = [tf.contrib.layers.real_valued_column("", dimension=2, dtype=tf.float32)]
learningRate = 0.1
epoch = 10000
# https://www.tensorflow.org/api_docs/python/tf/metrics
validation_metrics = {
"accuracy": tf.contrib.learn.MetricSpec(metric_fn = tf.contrib.metrics.streaming_accuracy ,
prediction_key = tf.contrib.learn.PredictionKey.CLASSES),
"precision": tf.contrib.learn.MetricSpec(metric_fn = tf.contrib.metrics.streaming_precision ,
prediction_key = tf.contrib.learn.PredictionKey.CLASSES),
"recall": tf.contrib.learn.MetricSpec(metric_fn = tf.contrib.metrics.streaming_recall ,
prediction_key = tf.contrib.learn.PredictionKey.CLASSES),
"mean_absolute_error": tf.contrib.learn.MetricSpec(metric_fn = tf.contrib.metrics.streaming_mean_absolute_error ,
prediction_key = tf.contrib.learn.PredictionKey.CLASSES),
"false_negatives": tf.contrib.learn.MetricSpec(metric_fn = tf.contrib.metrics.streaming_false_negatives ,
prediction_key = tf.contrib.learn.PredictionKey.CLASSES),
"false_positives": tf.contrib.learn.MetricSpec(metric_fn = tf.contrib.metrics.streaming_false_positives ,
prediction_key …Run Code Online (Sandbox Code Playgroud) python machine-learning neural-network conv-neural-network keras