- 博客(15)
- 收藏
- 关注
原创 pandas:level\axis
MultiIndex情形,level为第几层,axis=0为按行标签(index)搜,axis=1为按列标签(columns)搜
2022-03-07 16:05:38
583
原创 关于卷积层filter的一些知识
摘抄自 Image Filtering 一些规则: 1、size须为奇数,这样才能保证有中心点 2、filter各元素总和为1则卷过的图和原图的亮度相同 3、sum<1,darker;sum>1,brighter.sum=0,虽然不是完全黑暗但也很暗了 如果有的像素点作用过后不在[0,255]范围内了,可以做调整,例如<0则Set to 0或取绝对值,>255则Set to 255 还有一些gaussian blur什么的 ...
2021-10-20 14:53:32
1011
原创 在卷积层之前进行Reshape
Step 1 is to gather the data. You'll notice that there's a bit of a change here in that the training data needed to be reshaped. That's because the first convolution expects a single tensor containing everything, so instead of 60,000 28x28x1 items in a lis
2021-10-19 21:02:19
620
原创 callback 在满足要求时停止迭代
class myCallback(tf.keras.callbacks.Callback): def on_epoch_end(self, epoch, logs={}): if(logs.get('accuracy')>0.6): print("\nReached 60% accuracy so cancelling training!") self.model.stop_training = True mnist = tf.keras.datasets.fa.
2021-10-19 16:49:43
287
原创 from_tensor_slices
tensorFlow2.1下的tf.data.Dataset.from_tensor_slices()的用法 - 范仁义 - 博客园 写的很好呀! 总的来说大概就是按维度分割向量
2021-09-16 11:28:39
270
原创 单下划线作为临时变量
>>> car = ('red', 'auto', 12, 3812.4) >>> color, _, _, mileage = car >>> color 'red' >>> mileage 3812.4 >>> _ 12 有时候单个独立下划线是用作一个名字,来表示某个变量是临时的或无关紧要的 (咦,虽然这个只是写给自己看的笔记,但是不是要说一下这句话和上面的代码粘贴自知乎) (mnist_images, .
2021-09-16 11:18:23
211
原创 GradientTape
w = tf.Variable([[1.0]]) with tf.GradientTape() as tape: #命名成tape loss = w * w grad = tape.gradient(loss, w) #求解梯度,dloss/dw print(grad) # => tf.Tensor([[ 2.]], shape=(1, 1), dtype=float32)
2021-09-16 11:10:44
183
原创 numpy()
在tensorflow里,区别在于输出的是否是值 比如,a = [[1, 2], [3, 4]] print(a.numpy()) [[1 2] [3 4]] print(a) tf.Tensor( [[1 2] [3 4]], shape=(2, 2), dtype=int32) a返回的是张量
2021-09-16 10:34:16
3372
原创 “hello,{}“.format(m)
x = [[2.]] m = tf.matmul(x, x) print("hello, {}".format(m)) 输出 hello, [[4.]] hello 后面的{}指代format()括号里的东西 还可指定位置 "{1} {0} {1}".format("hello", "world") # 设置指定位置 'world hello world'
2021-09-16 10:25:39
229
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅