自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(206)
  • 收藏
  • 关注

原创 量化训练

tensorflow量化训练:post-training quantization: 剪枝,稀疏编码,对模型存储体积进行压缩quatization-aware training: forward F32==>int8 映射,backward F32梯度更新,保存模型int8,quantize/dequantize还有一种训练和推理都用int8在训练过程中引入精度带来的误差,然后整个...

2019-07-19 13:05:03 2380

原创 开发环境

必备软件:VNote(主用+git管理)+cherrytree(备用)+leanote(发博客)pycharm(IDE)+kite(代码自动补全)+virtualenvwrapper(python虚拟环境管理)wiznote(微信文章收藏)gradio(模型网页接口)gitkraken(git管理软件)auto-keras(神经架构搜索)+NNI(超参数搜索)tfslim(teno...

2019-07-19 13:01:29 248

原创 命令使用手册

Linux command:nautilus /path/to/that/folder 从终端打开文件夹sudo nvidia-docker run -it --name tf -p 8888:8888 -p 6006:6006 -v /home/mao/data:/home/mao/data 413b9533f92anohup jupyter lab --ip 0.0.0.0 --no-...

2019-07-19 12:59:19 246

原创 使用pandas读写JSON

利用JSON字符串创建一个pandas Series。pandas提供的read_json()函数,可以用来创建pandas Series或者pandas DataFrame数据结构In [1]: import pandas as pdIn [2]: json_str = '{"country":"Netherlands"}'In [3]: data = pd.read_json(json_

2017-01-16 23:09:18 25540

原创 使用pandas读写Excel文件

使用pandas读写Excel文件: 模块安装: pip install openpyxl 模块openpyxl源于PHPExcel,它提供了针对.xlsx文件的读写功能 pip install xlsxwriter 模块也需要读取.xlsx文件 pip install xlrd 模块xlrd能用来析取.xls和.xlsx文件中的数据。下面,我们先来生成用于填充pandas

2017-01-16 18:39:00 51435

原创 NumPy.npy与pandas DataFrame

用CSV格式来保存文件是个不错的主意,因为大部分程序设计语言和应用程序都能处理这种格式,所以交流起来非常方便。然而这种格式的存储效率不是很高,原因是CSV及其他纯文本格式中含有大量空白符;而后来发明的一些文件格式,如zip、bzip和gzip等,压缩率则有了显著提升首先导入模块:In [1]: import numpy as npIn [2]: import pandas as pd

2017-01-16 14:39:08 6776

原创 利用NumPy和pandas对CSV文件进行写操作

数组存储成CSV之类的区隔型文件:下面代码给随机数生成器指定种子,并生成一个3*4的NumPy数组将一个数组元素的值设为NaN: In [26]: import numpy as np In [27]: np.random.seed(42) In [28]: a = np.random.randn(3,4) In [29]: a[2][2] = np.nan In [30]: pri

2017-01-16 00:12:10 15012

原创 numpy 学习5

The flat property gives back a numpy.flatiter object.This is the only means to get a flatiter object;we do not have access to a flatiter constructor.The flat iterator enables us to loop through an arr

2017-01-06 18:23:56 466

原创 numpy 学习4

Splitting Numpy arrays:Horizontal splitting:The following code splits a 3*3 array on its horizontal axis into three parts of the same size and shape: In [26]: np.hsplit(a,3) Out[26]: [array([[0

2017-01-06 17:08:26 292

原创 virtualenv 配置scrapy

For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:1.第一步先做这个,这个是在全局环境中执行的,是为了安装好cryptography的相关依赖$ sudo apt-get install build-essential libssl-d

2017-01-06 16:37:54 1327

原创 numpy 学习3

Arrays can be stacked horizontally,depth wise,or vertically.We can use,for this goal,the vstack(),dstack(),hstack(),colum_stack(),row_stack(),and concatenate() functions.To start with,let's set up som

2017-01-06 16:29:55 352

原创 numpy 学习2

In [1]: import numpy as npIn [2]: a = np.arange(9)In [3]: a[3:7]Out[3]: array([3, 4, 5, 6])In [4]: a[:7:2]Out[4]: array([0, 2, 4, 6])In [5]: a[::-1]Out[5]: array([8, 7, 6, 5, 4, 3, 2, 1, 0]

2017-01-06 12:05:58 321

原创 numPy 学习1

not allowed to change a complex number into a integernot allowed to change a complex number into a floating-point numberyou can convert a floating-point number to a complex number, for example, com

2017-01-05 21:11:05 326

原创 python virtualenv使用

virtualenv目前对我来说最有用的是可以创建虚拟环境,解决python版本或者包版本的冲突,而且学习成本不大安装virtualenv: pip3 install virtualenv (如果还未安装pip3,可以运行sudo apt-get install python3-pip) (sudo apt-get install python-pip使用来安装python2.7版

2017-01-04 11:17:11 444

原创 git 起步

图形或网页设计师版本控制系统(VCS):如果你是位图形或网页设计师,可能会需要保存某一幅图片或页面布局文件的所有修订版本(这或许是你非常渴望拥有的功能),采用版本控制系统(VCS)是个明智的选择。 有了它你就可以将某个文件回溯到之前的状态,甚至将整个项目都回退到过去某个时间点的状态,你可以比较文件的变化细节,查出最后是谁修改了哪个地方,从而找出导致怪异问题出现的原因,又是谁在何时报告了某个功能

2017-01-03 19:39:48 373

原创 python函数random研读

摘自python数据收集一书的一段文字:大多数随机数算法都努力创造一种呈均匀分布且难以预测的数据序列,但是在算法初始化阶段都需要提供随机数"种子"(random seed)。而完全相同的种子每次会产生同样的"随机"数序列,因此我用系统时间作为随机数序列生成的起点。random.seed(a=None, version=2) Initialize the random number ge

2017-01-03 16:44:17 369

原创 scrapy定时任务

1. sudo crontab -e2. 我选择的是vim3. 在末尾插入一行 */1 * * * * sh /home/maoxianxin/scrape/scrapeIP/cron.sh4. 在/home/maoxianxin/scrape/scrapeIP/下新建cron.sh文件 代码如下: #! /bin/sh export PATH=$PATH:/u

2017-01-02 18:26:36 2190 1

原创 抓取西刺代理IP+验证是否可用+存储mongodb

spider文件的代码:import scrapyimport requests #用于测试抓取过来的IP是否可用class XiciSpider(scrapy.Spider): name = "xici" allowed_domains = ["xicidaili.com",] def start_requests(self): urls = ["http://www.xic

2017-01-02 18:06:01 2078

原创 downloader middleware 研读(1)

对requests和response会产生影响,像代理IP什么的就跟这个有关了 The downloader middleware is a framework of hooks into Scrapy’s request/response processing. It’s a light, low-level system for globally altering Scrapy’s requ

2017-01-02 16:48:26 825

原创 installation guide 研读

scrapy支持python2.7和python3.3以上版本,在windows下不支持python3版本(目前不支持)官方建议安装scrapy在虚拟环境中(virtualenv)Scrapy is written in pure Python and depends on a few key Python packages (among others): lxml, an eff

2016-12-31 20:09:55 408

原创 scrapy at a glance 研读

scrapy 是一个application framework (框架)获取数据方式: web scraping APIs代码解析:import scrapyclass QuoteSpider(scrapy.Spider):#爬虫的名字必须唯一 在根目录下运行scrapy crawl quote或者在spiders目录下运行scrapy runspider 爬虫python

2016-12-31 18:05:46 489

原创 腾讯云主机ubuntu16.04.1LTS配置scrapy

配置条件:                   刚刚购买的云主机1.   sudo    apt-get    update        更新软件来源2.   sudo    apt-get    python-dev  python-pip  libxml2-dev  libxslt1-dev  zlib1g-dev  libffi-dev  libssl-dev

2016-12-30 15:06:20 1057

原创 爬取智联招聘信息

还未完善,继续测试中,只是写个总结

2016-12-29 19:05:21 1500

转载 poj 2549 Sumsets (枚举+二分)

SumsetsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10026 Accepted: 2743DescriptionGiven S, a set of integers, find the largest d such that a + b + c

2016-03-31 21:06:44 423

转载 codeforces 630I Parking Lot

#include#include#include#include#include/*正如题目:对排列组合应用,有n个相同的车停在一起时,此时又2*n-2个停车位! 左 中 右时 4*3*4 3*4*3 4*3*4

2016-03-23 18:23:36 448

原创 hdu 5636 Shortest Path

#include#include#include#include#include/* Shortest PathTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submissio

2016-03-22 20:31:33 302

原创 BZOJ 2456 mode (求众数)

2456: modeTime Limit: 1 Sec  Memory Limit: 1 MBSubmit: 2754  Solved: 1165[Submit][Status][Discuss]Description给你一个n个数的数列,其中某个数出现了超过n div 2次即众数,请你找出那个数。Input第1行一个正整数n。第2行n个正整数用空格隔开

2016-03-17 20:23:20 914

原创 hdu 5615 Jam's math problem

Jam's math problemTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 881    Accepted Submission(s): 423Problem DescriptionJam has a

2016-03-16 19:50:19 337

原创 BZOJ 2190 仪仗队

2190: [SDOI2008]仪仗队Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 2225  Solved: 1403[Submit][Status][Discuss]Description  作为体育委员,C君负责这次运动会仪仗队的训练。仪仗队是由学生组成的N * N的方阵,为了保证队伍在行进中整齐划一,C君会跟在仪仗队

2016-03-15 21:43:56 409

原创 codeforces 630F Selection of Personnel

F. Selection of Personneltime limit per test0.5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputOne company of IT City decided t

2016-03-11 20:26:29 467

原创 codeforces 630G Challenge Pennants

G. Challenge Pennantstime limit per test0.5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputBecause of budget cuts one IT compan

2016-03-11 20:19:07 537

原创 codeforces 630K Indivisibility

K. Indivisibilitytime limit per test0.5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputIT City company developing computer game

2016-03-11 15:26:57 329

原创 codeforces 630E A rectangle

E. A rectangletime limit per test0.5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputDeveloping tools for creation of locations

2016-03-10 19:04:43 346

原创 位操作的快速幂

#include#include#include#include// 计算x^22 22 = 10110 = 16+4+2// 十进制 二进制 十进制 // 按照原本的思路是a=a*a,之后是b=b/2; 也就是(16+4+2)/2// 结果是(8+2+1)相当于把10110向右移1为,变成1011 ,

2016-03-08 20:30:04 259

原创 codeforces 598D - Igor In the Museum

D. Igor In the Museumtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIgor is in the museum and he wants to

2016-03-08 13:58:29 477

原创 NBUT 1665 木块拼接

[1655] 木块拼接时间限制: 1000 ms 内存限制: 65535 K问题描述好奇的skyv95想要做一个正方形的木块,现在有三种颜色的矩形木块,颜色分别为"A","B","C"。他现在很想把三个木块拼接成一个大正方形,现在求助于你们,问分别给你们三种颜色矩形的两个边长,判断是否能组成一个正方形。输入依次输入颜色为A的矩形的两边长度,颜色为B的矩形的两边长

2016-03-07 16:50:38 423

原创 hdu 5630 Rikka with Chess

Rikka with ChessTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 511    Accepted Submission(s): 426Problem DescriptionYuta gives

2016-03-07 12:19:17 272

转载 hdu 5233 Gunner II (容器)

Gunner IITime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1739    Accepted Submission(s): 635Problem DescriptionLong long ago, th

2016-03-05 22:15:23 341

原创 poj 1930 Dead Fraction 混循环小数化分数 数论

Dead FractionTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 2417 Accepted: 782DescriptionMike is frantically scrambling to finish his thesis at the las

2016-03-04 19:39:57 463

原创 hdu 2035 人见人爱A^B

#include#include#includeusing namespace std;//题目的重点是%1000 //还有个思路是进行周期判断 int main(){ int a,b; int r; while( scanf("%d%d",&a,&b)!=EOF ) { if(a==0&&b==0) break;

2016-03-01 16:26:25 208

空空如也

空空如也

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

TA关注的人

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