TensorFlowAPI_

L2 L2

!/usr/bin/env python -*- coding: utf-8 -*- import numpy as np import tensorflow as tf input_data = tf.Variable( np.random.rand(2, 3), dtype = tf.float32 ) output = tf.nn.l2_loss(input_data) with tf.Session() as sess: init = itialize_all_variables() sess.run(init) print sess.run(input_data) print sess.run(output) print sess.run(tf.shape(output))

tf.nn.sigmoid_cross_entropy_with_logits(logits, targets, name=None)

logits sigmoid

x = logitsz = targets Logistic

!/usr/bin/env python -*- coding: utf-8 -*- import numpy as np import tensorflow as tf input_data = tf.Variable( np.random.rand(1,3), dtype = tf.float32 ) output = tf.nn.sigmoid_cross_entropy_with_logits(input_data, [[1.0,0.0,0.0]]) with tf.Session() as sess: init = tf.initialize_all_variables() sess.run(init) print sess.run(input_data) print sess.run(output) print sess.run(tf.shape(output))

!/usr/bin/env python -*- coding: utf-8 -*- import numpy as np import tensorflow as tf input_data = tf.Variable( [[0.2, 0.1, 0.9]] , dtype = tf.float32 ) output = tf.nn.softmax(input_data) with tf.Session() as sess: init = tf.initialize_all_variables() sess.run(init) print sess.run(input_data) print sess.run(output) print sess.run(tf.shape(output))

tf.nn.log_softmax(logits, name=None)

tf.nn.softmax_cross_entropy_with_logits(logits, labels, name=None)

logits softmax

CIFAR-10 tf.nn.sigmoid_cross_entropy_with_logits(logits, targets, name=None)API

APIlogitsAPI softmax logitsAPI softmax API softmax

logitslabels[batch_size, num_classes]float32float64

!/usr/bin/env python -*- coding: utf-8 -*- import numpy as np import tensorflow as tf input_data = tf.Variable( [[0.2, 0.1, 0.9]] , dtype = tf.float32 ) output = tf.nn.softmax_cross_entropy_with_logits(input_data, [[1,0,0]]) with tf.Session() as sess: init = tf.initialize_all_variables() sess.run(init) print sess.run(input_data) print sess.run(output) print sess.run(tf.shape(output))

tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels, name=None)

logits softmax softmax_cross_entropy_with_logitslogitsshape[batch, class], labelshape[batch]one_hot

pipPermissionError: [WinError 5]

Windows7CD/DVD

win7IPipconfigIPV4 169.254

Windows8.1-KB2999226-x64

–Windows server 2016RemoteFX-GPU