![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
文章平均质量分 92
小的时候可菜了
这个作者很懒,什么都没留下…
展开
-
Keras
线性回归 import keras import numpy as np import matplotlib.pyplot as plt # Sequential按顺序构成的模型 from keras.models import Sequential # Dense全连接层 from keras.layers import Dense # 使用numpy生成100个随机点 x_data = np...原创 2019-12-12 21:20:51 · 1015 阅读 · 0 评论 -
Tensorflow2.0中的Tensor维度操作
改变Tensor的维度 a = tf.constant([[1,2,3],[4,5,6]]) # shape (2,3) # change dimention of a to (2,3,1) b = tf.expand_dims(a,2) # shape(2,3,1) c = a[:,:,tf.newaxis] # shape(2,3,1) d = tf.reshape(a,(2,3...原创 2020-02-02 16:41:20 · 600 阅读 · 0 评论 -
Tensorflow
import tensorflow as tf 常量 # 创建一个常量 m1 = tf.constant([[3,3]]) # 创建一个常量 m2 = tf.constant([[2],[3]]) # 矩阵乘法op product = tf.matmul(m1, m2) print(product) 会话 # 定义会话 sess = tf.Session() # 调用sess中的run方法来执...原创 2019-12-10 19:05:33 · 221 阅读 · 0 评论