码迷,mamicode.com
首页 >  
搜索关键字:shape    ( 2078个结果
opencv读写图像
import cv2 import numpy import os img = numpy.zeros((3, 3), dtype=numpy.uint8) print(img) img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) print(img) print ...
分类:其他好文   时间:2019-11-17 21:09:09    阅读次数:85
C++ 虚析构函数
防止内存泄露 子类继承父类后,在子类构造函数里,通过new 来生成一个对象实例 在析构函数里执行释放内存操作,如果父类不加上virtual 关键词 则子类执行的是父类的析构函数,不执行自己的析构函数。 父类不加virtual 子类继承后,并执行析构函数: 输出结果: 父类加上virtual关键词后, ...
分类:编程语言   时间:2019-11-16 23:36:27    阅读次数:93
axis=0 和axis=1的区别
1、先以二维数组为例:此数组为二维数组,shape=[4,3],第一个维度为4,第二个维度为3在numpy中若没有指定axis,默认对所有的数据相加axis=0表示第一个维度,axis=1表示第二个维度,以此类推(是几维数组就有几个维度)若指定了axis=0,则沿着第一个维度的方向进行计算此例中,第... ...
分类:其他好文   时间:2019-11-14 11:20:53    阅读次数:254
numpy:数组的形状与展开
先将模块导入文件中 import numpy as np 1、使用shape属性修改数组的形状 arr.shape = (4, 4) arr.shape = 4, 4 arr.shape = [4, 4] 使用shape属性修改原数组形状的方法有以上三种,只要元素个数相同,可以随意更改数组的形状 2 ...
分类:编程语言   时间:2019-11-11 00:49:22    阅读次数:170
Codeforces Round #599 (Div. 2) C. Tile Painting
Ujan has been lazy lately, but now has decided to bring his yard to good shape. First, he decided to paint the path from his house to the gate. The pa ...
分类:其他好文   时间:2019-11-10 11:44:17    阅读次数:73
TensorFlow中random_normal和truncated_normal的区别
原文链接:https://blog.csdn.net/zhangdongren/article/details/83344048 区别如下: tf.random_normal(shape,mean=0.0,stddev=1.0,dtype=tf.float32,seed=None,name=None ...
分类:其他好文   时间:2019-11-10 10:23:55    阅读次数:121
numpy
一、numpy 数组对象(numpy.ndarray) ndarray 是一个多维的数组类: 实际数据 描述信息 创建对象、索引、切片: 1 #python 2 3 import numpy as np 4 5 # 创建ndarray 对象 6 a = np.arange(6) 7 print(a. ...
分类:其他好文   时间:2019-11-09 23:29:34    阅读次数:126
tensorflow之tf.squeeze()
tf.squeeze()函数的作用是从tensor中删除所有大小(szie)是1的维度。 给定丈量输入, 此操作返回的是相同类型的张量, 并删除所有尺寸为1的维度。如果不想删除所有尺寸为1的维度, 可以通过指定squeeze_dims来删除特定维度。 下面通过例子来理解: # 't' is a te ...
分类:其他好文   时间:2019-11-09 10:09:37    阅读次数:110
C. Tile Painting (定理:任意一个合数都能够写成两个质数的乘积) 《Codeforces Round #599 (Div. 2) 》
Ujan has been lazy lately, but now has decided to bring his yard to good shape. First, he decided to paint the path from his house to the gate. The pa ...
分类:其他好文   时间:2019-11-09 00:25:44    阅读次数:99
als_tf
# -*- coding: utf-8 -*-import tensorflow as tfdef als_tf(user_item_matrix, feature_num, train_times, reg): user_num, item_num = user_item_matrix.shape ...
分类:其他好文   时间:2019-11-08 17:42:03    阅读次数:146
2078条   上一页 1 ... 30 31 32 33 34 ... 208 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!