自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

TH_NUM的博客

有问题知乎私信我哈~~

  • 博客(21)
  • 资源 (10)
  • 收藏
  • 关注

原创 pytorch 函数clamp

clamp表示夹紧,夹住的意思,torch.clamp(input,min,max,out=None)-> Tensor将input中的元素限制在[min,max]范围内并返回一个Tensor用法:

2018-06-29 18:19:55 21478

原创 pytorch 常用函数 max ,eq

max找出tensor 的行或者列最大的值:找出每行的最大值:import torchoutputs=torch.FloatTensor([[1],[2],[3]])print(torch.max(outputs.data,1))输出: (tensor([ 1., 2., 3.]), tensor([ 0, 0, 0]))找出每列的最大值:import ...

2018-06-23 13:56:53 25478 1

转载 0.4.0pytorch运行过程中对0-dim和volatile提示UserWarning的解决方法

将pytorch更新到0.4.0最新版后对0.3.1版本代码会有如下警告,它在提醒用户下个版本这将成为一个错误UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python...

2018-06-23 13:25:25 2594 1

原创 argparse用法

从下面的代码中main.py说明:import argparseparser = argparse.ArgumentParser(description='PyTorch CIFAR10 Training')parser.add_argument('--lr', default=0.1, type=float, help='learning rate')parser.add_argum...

2018-06-23 13:05:28 1186

原创 numpy load、save、savez 将数组或者pickled结构保存在文件中

numpy.load(file, mmap_mode=None, allow_pickle=True, fix_imports=True, encoding=’ASCII’) 示例:将数组保存在文件中,并读取import numpy as npa=np.array([[1, 2, 3], [4, 5, 6],[7,8,9]])b=np.array([1, 2])# np.savez...

2018-06-20 20:10:52 2159

原创 LaTeX:加背景色

设置环境、段落的背景色1.导言区部分,文件头\usepackage{color} %\definecolor{shadecolor}{named}{Gray} \definecolor{shadecolor}{rgb}{0.92,0.92,0.92} \usepackage{framed} 2.文档内容部分begin{shaded} $$ \int_...

2018-06-16 14:07:51 9095

原创 Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not in range(128)

在 linux服务器上运行代码报错: Python3中遇到UnicodeEncodeError: ‘ascii’ codec can’t encode characters in ordinal not in range(128) 但是在windows上面运行代码正常。 原因是因为:linux系统语言导致的。 查看了一下系统环境编码>>> import sys&...

2018-06-13 21:22:22 36998 9

转载 python numpy logic_and

>>> import numpy as np>>> np.logical_and(True, False)False>>> np.logical_and([True,False], [False,False])array([False, False], dtype=bool)>>> np.logical_and...

2018-06-10 00:12:07 1070

原创 numpy 对矩阵中Nan的处理:采用平均值

尽管我们可以将所有的NaN替换成0,但是由于并不知道这些值的意 义,所以这样做是个下策。如果它们是开氏温度,那么将它们置成0这种处理策略就太差劲了。 下面我们用平均值来代替缺失值,平均值根据那些非NaN得到。from numpy import *datMat = mat([[1,2,3],[4,Nan,6]])numFeat = shape(datMat)[1]for i in ...

2018-06-09 17:22:46 5686

原创 python PCA主成分分析进行降维度

#PCA对数据进行降维from numpy import *def confloat(x): r=[float(i) for i in x] return rdef loadDataSet(fileName, delim='\t'): fr = open(fileName) stringArr = [line.strip().split(delim) f...

2018-06-09 17:08:18 1829

原创 numpy中矩阵名.A的含义

python中一个matrix矩阵名.A代表将 矩阵转化为array数组类型.from numpy import *a=mat([[1,2,3],[4,5,6]])b=a.Aprint(type(a))print(type(b))结果:<class 'numpy.matrixlib.defmatrix.matrix'><class 'numpy.nda...

2018-06-09 13:44:26 3194

原创 Python数据可视化利器Matplotlib,如何绘制横向柱形图

Python绘图库Matplotlib中,横向柱形图主要通过barh函数绘制得到,该函数的使用方法与常见的纵向的柱形图绘制函数bar的用法相似。Axes.barh(y, width, height, left, align=’center’, **kwargs)或matplotlib.pyplot.barh(y, width, height, left, align=’center’,...

2018-06-06 22:03:36 27956 1

原创 numpy 根据一维矩阵array内容 ,创建矩阵

import numpya=numpy.array([1,2,3,4])b=a[numpy.mat([[1,1]])]print(b)输出: [[2 2]]

2018-06-06 16:53:27 956

原创 python 实现MFCC

语音数据:http://www.voiptroubleshooter.com/open_speech/american.html For this post, I used a 16-bit PCM wav file from [here]import numpyimport scipy.io.wavfilefrom matplotlib import pyplot as pltf...

2018-06-06 16:52:18 23524 29

原创 numpy.transpose()

numpy.transpose()是对矩阵按照所需的要求的转置,比较难理解,现以例子来说明import numpy as np a = np.array(range(30)).reshape(2, 3, 5) print ("a = ") print (a) print "\n=====================\n" print ("a.transpos...

2018-06-05 22:49:07 539

转载 np.linalg.norm(求范数)

linalg=linear(线性)+algebra(代数),norm则表示范数。函数参数x_norm=np.linalg.norm(x, ord=None, axis=None, keepdims=False) ①x: 表示矩阵(也可以是一维)②ord:范数类型向量的范数: 矩阵的范数:ord=1:列和的最大值ord=2:|λE-ATA|=0,求...

2018-06-05 22:41:38 725

转载 基于kaldi、thchs30 的离线中文识别

具体操作细节可查看一下网址:链接 第一步就是要跑通thchs30的例子,这是清华的中文语音识别例子第二部做本地识别可查看上面网址,不过有两处不对1、如下图所示地方要改成final.mat,上面网址的是12.mat 2、如下图所示地方也要改ac_model=${data_file}/models/$ac_model_type trans_matrix="" aud...

2018-06-04 14:43:30 2008

转载 kaldi在线语音识别bug解决

【问题描述】使用kaldi工具包进行在线语音识别,识别麦克风输入,输出识别结果。使用egs/voxforge/online_demo文件夹时,./run.sh –test-mode live输出portaudio failed to open the defalut stream【解决办法】分三步进行解决。1.首先检查linux系统录音功能是否可用:arecord命令,如are...

2018-06-04 14:29:42 1225

原创 Anaconda 管理python环境

1.升级conda 环境conda update conda2 . 安装conda 参考https://blog.csdn.net/th_num/article/details/800777623 .列出conda下面的环境conda info --envs其中前面带* 号,表示正在使用的环境4 .复制一个环境conda create --name pyth...

2018-06-04 14:16:43 289

原创 kalid 运行thchs30 报错 Caution: the last few frames of the wav file may not be decoded properly.

报出调试信息:Reads in wav file(s) and simulates online decoding.Writes integerized-text and .ali files for WER computation. Utterance segmentation is done on-the-fly.Feature splicing/LDA transform is ...

2018-06-04 13:09:55 387

原创 pyTelegramBotAPI Read timed out. (read timeout=30) Error

telegram 机器人 出现错误: File “/usr/local/lib/python3.4/dist-packages/telebot/apihelper.py”, line 54, in _make_request timeout=(connect_timeout, read_timeout), proxies=proxy) File “/usr/local/lib/python3...

2018-06-01 00:00:57 2417

wu-video-js-5.20.1 2.zip

video-js js RTMP video-js js RTMP video-js js RTMP

2019-11-22

ViewWizard

获取窗口的类名和Title.可以使用ViewWizard获取窗口的类名和Title.

2018-10-22

jperf 流量带宽监测

java 实现的perf 流量带宽监测,有图形界面,方便操作。

2017-12-04

PIL win64 for python2.7

python的图形库PIL的windows 64 版本的库,本应该是免费的,但是好像没有免费的选项上传。

2017-12-01

PILwin32 For python 2.7

PILwin32 For python 2.7这是PIl 的32位版本下载。同样的还有64位版本的下载,清参考博客的另一个资源。

2017-12-01

McGrawHill_-_Machine_Learning_-Tom_Mitchell课后答案

McGrawHill Machine Learning Tom_Mitchell 课后完整版答案

2016-04-25

最快搜索kd树

一种最快的搜索kds树的实现,时间搜索的效率更高

2014-12-25

线段树的一种实现

一种简单的线段树的实现 ,基础功能比较完善

2014-12-25

全面的kd搜索树

一种功能实现全面的kd搜索树,简单灵活,容易使用

2014-12-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除