import numpy as np import scipy.sparse as sp m = sp.lil_matrix((7329,7329)) np.save(path,m) #用numpy的load方法存储矩阵,path为存储的路径 mat = np.load(path)[()] #读取存储的矩阵,注意[()]这个符号可以抽取对象 mat = mat.toarray() #将稀疏矩阵转为稠密矩阵
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- im
注:本文是人工智能研究网的学习笔记 规范化(Normalization) Normalization: scaling individual to have unit norm 规范化是指,将单个的样本特征向量变换成具有单位长度(unit norm)的特征向量的过程.当你要使用二次形式(quadratic from)如点积或核变换运算来度量任意一堆样本的相似性的时候,数据的规范化会非常的有用 假定是基于向量空间模型,经常被用于文本分类和内容的聚类. 函数normalize提供了快速简单的方法使用