- 博客(8)
- 资源 (1)
- 问答 (1)
- 收藏
- 关注
转载 node.js ws模块 方法属性(websocket)
WebSocket compressionws supports the permessage-deflate extension which enables the client and server to negotiate a compression algorithm and its parameters, and then selectively apply it to the da...
2018-07-29 14:49:29 8471
原创 微信小游戏——绘制圆形微信头像
直接上代码:ctx.save() //保存上下文ctx.beginPath()//开始绘制ctx.arc(screenWidth / 10, screenHeight / 7, 24, 0, 2 * Math.PI, false)//画一个圆ctx.clip()//裁剪这个圆ctx.drawImage(image, screenWidth / 10 - 25, screenHeigh...
2018-07-26 11:02:25 3255
原创 Python——反向传播算法
# 传递神经元的激活值import timeimport numpy as npimport xlrdimport xlwtdef transfer(activation): return 1.0 / (1.0 + np.exp(-activation))# 计算神经元输出值的导数def transfer_derivative(output): return ou...
2018-07-16 14:53:21 4603
原创 Python——受限玻尔兹曼机
from __future__ import print_functionimport randomimport numpy as npimport xlrdimport xlwtclass RBM: def __init__(self, num_visible, num_hidden):#初始化 可见单元和隐藏单元个数 self.num_hidden = ...
2018-07-16 14:47:50 6300 23
原创 SKlearn SVM二分类主要代码及参数解释
from sklearn.svm import SVCclf = SVC(kernel='rbf')#调参clf.fit(X, y)#训练print(clf.fit(X, y))#输出参数设置p = 1#正确分类的个数for i in range(len(test_dataset)):#循环检测测试数据分类成功的个数 if clf.predict(np.array([test_...
2018-07-16 14:33:47 13823
原创 Python——生成矩阵
def makeMatrix(row_num, column_num, start=0.1, step=0): matrix = [] row = [] for i in range(row_num): for j in range(column_num): row.append(start) start +=...
2018-07-16 13:50:31 8245
原创 Python——保存矩阵为Excel
def save(data, path): f = xlwt.Workbook() # 创建工作簿 sheet1 = f.add_sheet(u'sheet1', cell_overwrite_ok=True) # 创建sheet [h, l] = data.shape # h为行数,l为列数 for i in range(h): for j ...
2018-07-16 13:46:59 21905 6
原创 Python——Excel数据转化为矩阵
def excel2m(path): data = xlrd.open_workbook(path) table = data.sheets()[0] nrows = table.nrows # 行数 ncols = table.ncols # 列数 c1 = np.arange(0, nrows, 1) datamatrix = np.zer...
2018-07-16 13:44:38 28847 13
cocos creator碰撞检测 当两个物体碰撞后 图片产生重叠 该怎么办?
2018-06-30
TA创建的收藏夹 TA关注的收藏夹
TA关注的人