import tensorflow as tf x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] with tf.Session() as sess: a = tf.reshape(x, [2, 2, 3]) a = sess.run(a) print(a) p ...
分类:
其他好文 时间:
2020-01-31 22:33:29
阅读次数:
92
Keras的Layer其实就是一个Class, 要具有以下几个方法: (1) build(input_shape): 定义权重的地方, 如果不需要定义权重, 也要有self.built = True; (2) call(x): 编写功能逻辑的地方, 实现Layer的功能逻辑; (3) compute ...
分类:
其他好文 时间:
2020-01-31 18:59:18
阅读次数:
82
现在给坦克加入发射子弹功能 1.创建一个子弹类,子弹不使用图片,直接egret.Shape画出一个小圆形 子弹应该有移动功能,很简单,按照原有方向移动 1 class Bullet extends egret.DisplayObjectContainer { 2 3 dir: string; 4 t ...
分类:
其他好文 时间:
2020-01-30 09:43:31
阅读次数:
96
知识点: 人脸跟踪 人脸特征 要识别的人脸特征距离 看效果图,鼻子部分已经被标识出来了: 主要用到了dlib import dlib predictor_path = 'models\\shape_predictor_68_face_landmarks.dat' face_rec_model_pat ...
分类:
其他好文 时间:
2020-01-30 09:24:20
阅读次数:
358
幂迭代法求第k大的特征值和特征向量 数学表述 设矩阵A $$ A = \left[ \begin{matrix} X_{11}&\ldots&X_{1n} \newline X_{21} & \ldots& X_{2n} \newline &\vdots& \newline X_{n1}&\ldot ...
分类:
其他好文 时间:
2020-01-29 14:18:12
阅读次数:
274
提取ROI区域,处理然后放回去: 泛洪填充 测试代码:显示一张图像,鼠标点击之后,会从该点开始进行填充,显示填充后的结果图像 注:二值图像的填充需要使用选项: 选项说明: :改变图像,泛洪填充 :不改变图像,只填充遮罩层本身,忽略新的颜色值参数 ...
分类:
编程语言 时间:
2020-01-27 23:42:55
阅读次数:
89
先来看一下有哪些接口用来进行张量的合并与分割: tf.concat用来进行张量的拼接,tf.stack用来进行张量的堆叠,tf.split用来进行张量的分割,tf.unstack是tf.split的一种,也用来进行张量分割 1.tf.concat 参数axis代表将要合并的维度 # 假设a代表四个班 ...
分类:
其他好文 时间:
2020-01-22 22:14:08
阅读次数:
88
继承机制经常用于创建和现有类功能类似的新类,又或是新类只需要在现有类基础上添加一些成员(属性和方法),但又不想将现有类代码复制给新类。也就是说,通过继承这种机制,可以实现类的重复使用。 关于python的多继承 使用多继承经常需要面临的问题是,多个父类中包含同名的类方法。对于这种情况,python的 ...
分类:
编程语言 时间:
2020-01-22 19:55:03
阅读次数:
100
Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l r ...
分类:
其他好文 时间:
2020-01-22 14:29:27
阅读次数:
98
| 函数 | 描述 | | | | | numpy.matlib.empty(shape, dtype, order) | 函数返回一个新的矩阵,参数解释:shape: 定义新矩阵形状的整数或整数元组 Dtype: 可选,数据类型 order: C(行序优先) 或者 F(列序优先) | | nump ...
分类:
其他好文 时间:
2020-01-21 13:19:57
阅读次数:
82