深度学习进度01(深度和机器的区别、tensorflow的使用-tf数据流图)
机器学习和深度学习两者之前的区别:
特征提取方面:
数据量和计算性能要求:
算法代表:
tensorflow的使用
tf数据流图:
用tensorflow实现一个简单的加法运算:
import tensorflow as tf import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' def tensorflow_demo(): tf.compat.v1.disable_eager_execution() #保证sess.run()能够正常运行 """ TensorFlow的基本结构 :return: """ # 原生python加法运算 a = 2 b = 3 c = a + b print("普通加法运算的结果:\n", c) # TensorFlow实现加法运算 a_t = tf.constant(2) b_t = tf.constant(3) c_t = a_t + b_t print("TensorFlow加法运算的结果:\n", c_t) # 开启会话 tf.compat.v1.disable_eager_execution() sess = tf.compat.v1.Session() c_t_value = sess.run(c_t) print("c_t_value:\n", c_t_value) return None if __name__ == "__main__": # 代码1:TensorFlow的基本结构 tensorflow_demo()
tensorflow结构分析:
数据流图: