香港科技大学TensorFlow课件4.pdf

香港科技大学TensorFlow课件4.pdf

此“教育”领域文档为创作者个人分享资料,不作为权威性指导和指引,仅供参考
  1. 1、本文档共118页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
TensorFlow @UST Day 3: RNN Sung Kim <hunkim+tfust@> TensorFlow @UST Day 3: RNN Sung Kim <hunkim+tfust@> Gifts from Google and Line Feedback TensorFlow Mechanics feed data and run graph (operation) sess.run (op, feed_dict={x: x_data}) Build graph using TensorFlow operations update variables in the graph (and return values) Machine Learning Basics •Linear Regression •Logistic Regression (Binary classification) •Softmax Classification •Neural Networks •CNN Linear Regression W = tf.Variable(tf.random_normal([1]), name='weight') b = tf.Variable(tf.random_normal([1]), name='bias') # Our hypothesis XW+b hypothesis = X * W + b # cost/loss function cost = tf.reduce_mean(tf.square(hypothesis - y_train)) GradientDescent # Minimize train = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(cost) Logistic Regression Model? (Hypothesis?) hypothesis = tf.sigmoid(tf.matmul(X, W) + b) Cost? # cost/loss function cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y) * tf.log(1 - hypothesis)) GradientDescent =0.01 Softmax Classifier Model? (Hypothesis?) logits = tf.matmul(X,W)+b hypothesis = tf.nn.softmax(logits) Cost? # Cross entropy cost/loss cost = tf.reduce_mean (-tf.reduce_sum(Y * tf.log(hypothesis), axis=1)) GradientDescent train = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(cost) Softmax Classifier Model? (H

文档评论(0)

wendangchuan + 关注
实名认证
内容提供者

高级工程师持证人

该用户很懒,什么也没介绍

领域认证该用户于2023年09月22日上传了高级工程师

1亿VIP精品文档

相关文档