自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

一直在路上

早早起来真的可以做许多事,比如,再睡一觉……

  • 博客(65)
  • 资源 (17)
  • 收藏
  • 关注

原创 python实现模糊匹配

题目:模糊匹配, ‘?’代表一个字符, *代表任意多个字符。给一段明确字符比如avdjnd 以及模糊字符比如*dj?dji?ejj,判断二者是否匹配。若能匹配输出”Yes”, 否则输出“No”(为了方便阅读,代码里面输出Ture or False)解题的思路:通过明确终止条件通过递归的方式求解终止的条件:(1) Str为空 以及 pattern为空或者pattern元素只有[*], 输出T...

2018-10-17 22:39:30 41141 4

原创 【Python代码】给定正整数,在+-*/的情况下,算法实现24点游戏,计算所有的可能

下面回顾一下前两天面试过程中,做的一到笔试题:题目:计算24 点,输入4 个整数,如何计算得到24,输出所有可能的计算方式; 若不能计算得到则输出None。解题思路:由于不考虑顺序, 括号的位置可以认为有两种[(a, b, c)d ] [(a,b),(c,d)],然后递归地遍历所有的情况。里面有两个小点:(1) a+b和b+a的情况一样,可以去掉一部分的计算(2) 主函数中考虑到浮点计算,...

2018-10-17 22:25:12 1422

原创 对图片进行批处理剪切成需要的大小

“`python import argparse import os from PIL import Imagedef resize_image(image, size): “”“Resize an image to the given size.”“” return image.resize(size, Image.ANTIALIAS)def resize_images(

2017-11-16 21:40:02 1467 1

原创 GAN与NLP的结合相关资料汇总与总结

1.记录一次与大神们的关于GAN应用于NLP的讨论(简书)http://www.jianshu.com/p/32e164883eab 总结 - 目前尝试的内容:纯文本生成,诗歌生成,唐诗生成,机器翻译,IR,中文分词,文本分类 - 主要思路:考虑使用D进行真假判别,然后用RL的policy gradient的方式来打分和更新 - 使用word2vec之类的连续向量,微调之后不能

2017-11-16 17:20:28 1398

原创 激活函数-ReLU

1.介绍ReLU(Recitified Linear Unit,ReLU),称为线性整流函数2.常用的线性整流函数斜坡函数 f(x)=max(0,x)f(x)=max(0,x)Leaky ReLU f(x)={xλxififx>0x<=0f(x)=\begin{cases}x &&&if &x>0\\\lambda x &&&if &x<=0\end{cases} 其中λ\lambda是一个

2017-11-16 10:59:44 7146

原创 synergy软件win10和ubuntu16.04局域网下使用一套键盘鼠标系统

1.下载软件下载地址2.安装2.1 Ubuntu下安装解压对应的文件, 在ubuntu下安装.deb文件,打开命令行,输入下面的命令 sudo dpkg -i synergy-master-stable-ec56ac4-Linux-x86_64.deb安装成功之后按一下win键,搜索可以synergy可以找到,进行相关的配置2.2 Win10下安装运行.msi文件即可3.配置3.1 ubun

2017-11-15 15:48:20 3966

原创 机器翻译论文

(2014)Sequence to sequence learning with neural networks(2014)Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation(2015)NEURAL MACHINE TRANSLATION BY JOINTLY

2017-10-25 23:01:45 2450 1

原创 神经机器翻译中的Attention机制

传统的机器翻译系统通常依赖于基于文本统计特性的复杂特征工程,需要投入大量工程大见他们。 神经机器翻译系统NMT,把一句话的意思映射到一个固定长度的特征向量,然后基于此进行翻译。由于NMT不再依赖于n-gram计数,而是捕捉文本更高层的含义。基于encoder-decoder的模型 NMT系统使用RNN将源语句(比如,一句德语)编码为一个向量,然后同样用RNN将其解码为英语。 如上图中,“Echt

2017-10-17 16:41:20 4502

原创 机器翻译的评价标准BLEU(Evaluation criteria for machine translation)

1.概念BLEU(bilingual evaluation understudy)在这篇论文中被提出BLEU: a Method for Automatic Evaluation of Machine Translation BLEU是一种衡量机器翻译质量的评价标准。一种对精确度修改的算法,先看一下下面的句子:2.1例子:n-gram在机器翻译译文和标准答案中出现次数不一致机器翻译的句子:The

2017-09-29 22:19:49 4951

原创 Python 中glob模块使用笔记

1.介绍glob模块用来查找文件目录和文件,常见的两个方法有glob.glob()和glob.iglob(),可以和常用的find功能进行类比,glob支持*?[]这三种通配符2.三种通配符*代表0个或多个字符?代表一个字符[]匹配指定范围内的字符,如[0-9]匹配数字3.例子import globfilelist=glob.glob(r'./*.py')#返回的数据类型是list,#

2017-08-08 14:51:29 14936

原创 Python 使用matplotlib使用并自定义colormap

0.前言添加colormap的对象是灰度图,可以变成热量图,从而更加明显的发现一些规律,适用于一些雷达图像等from PIL import Image# 将彩色图片转换成黑白图片im=Image.open("./pic.jpg").convert('L')# 保存图片im.save("image.jpg")1.从灰色图片中读取数据,转换成colormap图import matplotlib.

2017-08-07 19:55:18 39088 1

原创 Numpy、matplotlib实现二维数据到图像的转换,添加colormap,无边距显示

1.首先需要得到原始图像的大小 从向量shape到矩阵:import numpy as npdata = np.reshape(vector,(101,101))#101*101是要转换成的图片的大小2.转换from PIL import Imagenew_im = Image.fromarray(data.astype(np.uint8))

2017-08-04 21:27:07 3667

原创 Tensorflow学习笔记(5)-网络结构的构建

# -*- coding: utf-8 -*-# @Time : 17-8-4 上午10:57# @Author : 未来战士biubiu!!# @FileName: 5-buildstructure.py# @Software: PyCharm Community Edition# @Blog :http://blog.csdn.net/u010105243/article

2017-08-04 14:31:23 439

原创 Ubuntu16.04使用笔记

1.命令行运行sudo apt install dconf-editor然后运行下面的命令dconf-editor此时会弹出来一个框 2.依次打开 org→\tognome→\togedit→\toperferences→\toencodings 此时右侧修改candidate-encodings的value: ['GB18030', 'UTF-8', 'ISO-8859-15', 'UTF

2017-08-02 16:10:51 2550

原创 Tensorflow学习笔记(4)-mnist(MultilayerConvolutionalNetwork)

# -*- coding: utf-8 -*-# @Time : 17-8-1 下午9:40# @Author : 未来战士biubiu!!# @FileName: 4-mnist(MultilayerConvolutionalNetwork).py# @Software: PyCharm Community Edition# @Blog :http://blog.csdn.

2017-08-01 23:04:15 578

原创 Tensorflow学习笔记(3)-mnist(softmax regression)

# -*- coding: utf-8 -*-# @Time : 17-8-1 下午8:22# @Author : 未来战士biubiu!!# @FileName: 3-nearest neighbor.py# @Software: PyCharm Community Edition# @Blog :http://blog.csdn.net/u010105243/articl

2017-08-01 21:32:13 292

原创 Tensorflow学习笔记(2)-基本运算

# -*- coding: utf-8 -*-# @Time : 17-8-1 下午8:02# @Author : 未来战士biubiu!!# @FileName: 2-basic operation.py# @Software: PyCharm Community Edition# @Blog :http://blog.csdn.net/u010105243/article

2017-08-01 20:20:16 461

原创 Tensorflow学习笔记(1)-Helloworld

# -*- coding: utf-8 -*-# @Time : 17-8-1 下午7:58# @Author : 未来战士biubiu!!# @FileName: 1-tensorflow.py# @Software: PyCharm Community Edition# @Blog :http://blog.csdn.net/u010105243/article/impo

2017-08-01 19:59:25 377

原创 在Pycharm中自动添加时间日期作者等信息

1.按照下面路径以此打开File→\toSettings→\toEditor→\toFile and code Templates 右侧找到Python Script,如下图 2.设置相关代码如下##!/usr/bin/python3# -*- coding: utf-8 -*-# @Time : ${DATE} ${TIME}# @Author : 未来战士biubiu!!#

2017-07-26 17:26:38 20411 4

原创 20170708-leetcode-258-Add Digits

1.DescriptionGiven a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only

2017-07-08 21:45:52 253

原创 20170615-leetcode-409. Longest Palindrome

1.DescriptionGiven a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa" is

2017-06-15 23:34:04 199

原创 20170613-leetcode-535-Encode and Decode TinyURL

1.Description Note: This is a companion problem to the System Design problem: Design TinyURL.TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-ti

2017-06-13 10:36:33 904

原创 20170611-leetcode-041-First Missing Positive

1.DescriptionGiven an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses co

2017-06-12 11:25:03 284

原创 20170612-leetcode-575-Distribute Candies

Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute these

2017-06-12 10:32:53 727

原创 20170607-leetcode-189-Rotate Array

1.DescriptionRotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note: Try to come up as many solutions as

2017-06-07 15:41:22 272

原创 20170606-leetcode-581-Shortest Unsorted Continuous Subarray

1.DescriptionGiven an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.You nee

2017-06-06 11:24:09 546

原创 20170605-leetcode-532-K-diff Pairs in an Array

1.DescriptionGiven an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are bot

2017-06-05 23:17:30 465

原创 20170604-leetcode-460-LFU Cache

1.DescriptionDesign and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) of t

2017-06-04 23:34:14 454

原创 20170603-leetcode-560-Subarray Sum Equals K

1.DescriptionGiven an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k.Example 1:Input:nums = [1,1,1], k = 2 Output: 2Note:The length

2017-06-03 16:16:06 322

原创 20170602-leetcode-211-Add and Search Word - Data structure design

1.DescriptionDesign a data structure that supports the following two operations:void addWord(word) bool search(word)search(word) can search a literal word or a regular expression string containing onl

2017-06-02 22:32:30 353

原创 201705031-leetcode-155-Min Stack

1.DescriptionDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top

2017-05-31 15:30:57 262

原创 Python 正则表达

1.match和search的区别def re_method():# search vs. Matchs = 'abcd'print(re.search(r'c', s))print(re.match(r'c', s))if __name__ == '__main__':re_method()返回值为 <_sre.SRE_Match object; span=(2, 3), match

2017-05-30 20:36:31 544

原创 20170630-leetcode-225 Implement Stack using Queues

1.DescriptionImplement the following operations of a stack using queues. - push(x) – Push element x onto stack. - pop() – Removes the element on top of the stack. - top() – Get the top element. - e

2017-05-30 10:21:12 360

原创 20170529-leetcode-582-Kill process

1.DescriptionGiven n processes, each process has a unique PID (process id) and its PPID (parent process id). Each process only has one parent process, but may have one or more children processes. This

2017-05-29 21:31:45 1063

原创 Window10+Python3.5安装opencv

1.确定Python版本,电脑64位或者32位打开cmd(window键+R,输入cmd就出现),在命令行输入:打开cmd(window键+R,输入cmd就出现),在命令行输入:pythonPython 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win

2017-05-14 16:47:06 11153 3

原创 Java解析XML文件

1.读取文件<?xml version="1.0" encoding="UTF-8"?><books><book id="001"><title>Harry Potter</title><author>J K. Rowling</author><price>$50.2</price></book><book id="002"><title>Learning XML</title><

2017-04-22 11:11:48 400

原创 20170401-leetcode-435-Non-overlapping Intervals

1.DescriptionGiven a collection of intervals, merge all overlapping intervals.For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. Given a collection of intervals, merge all ov

2017-04-04 15:40:58 283

原创 Pyton爬虫实现豆瓣登陆

目标:实现豆瓣登陆;修改签名方法:使用requests.Session 来处理cookies问题:验证码输入关于headers 1.实现登陆# -*- coding: utf-8 -*-import requestsfrom HTMLParser import HTMLParserclass DoubanClient(object): def __init__(self):

2017-04-03 20:05:17 1064

原创 python爬虫获取豆瓣正在热播电影

python爬虫获取豆瓣正在热播电影热播地址:https://movie.douban.com/cinema/nowplaying/beijing/1、使用浏览器查看html文件找到热播电影的标签文件查看tag,可以看到最开始的tag为2、HTMLPaser主要用来解析HTTP数据,其中有几个接口feed: 向解析器喂数据,可以分段提供handler_starttag: 处理html的开始标签

2017-04-03 15:46:58 10037 1

原创 20170403-leetcode-349/50-Intersection of Two Arrays.py

两个同类型的题:349/350. 349:1、2;350:3,41.DescriptionGiven two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the

2017-04-03 10:44:44 716

Python实现模糊匹配

Python实现字符串的模糊匹配,‘?’代表一个字符, ‘*’代表任意多个字符。给一段明确字符比如avdjnd 以及模糊字符比如*dj?dji?ejj,判断二者是否匹配。若能匹配输出”Yes”, 否则输出“No”

2018-10-17

synergy Ubuntu16.04版和window10局域网下使用同一键盘鼠标

亲测可用, Synergy 是一款能够让使用者仅用一套键盘鼠标,就同时操控多部计算机的免费工具软件。使用者能够在包括 Windows 、 Linux 、 Mac OS 等不同的系统上安装它,并且在设定好主从关系后,就能够透过一组键盘鼠标来进行多部计算机的操控.

2017-11-15

香港城市大学语料库;微软亚洲研究院语料库;北京大学语料库;

香港城市大学语料库(1 772 202 字,训练集)、微软亚洲研究院语料库(1 089 050 字,训练集)、北京大学语料库(1 833 177 字,训练集)

2017-06-14

中文常见的停用词表 TXT文档

中文常见的停用词表 TXT文档

2016-11-27

NMF分解(网络数据挖掘)

NMF分解(网络数据挖掘)

2016-10-21

gensim0.13.1 64bit win10 py2.7

gensim0.13.1 64bit win10 py2.7

2016-08-01

冰点文库绿色版本无广告

冰点文库,良心作品,可以免积分下载百度文库,重要的是没有广告

2016-02-23

基于组态王的电梯设计

组态王 电梯,三层电梯,内容丰富,可下载来看

2015-08-06

STC单片机控制GSM模块开发总结.

STC单片机控制GSM模块开发总结 基于单片机的GSM短信系统 单片机控制GSM模块实现短信收发的软件设计

2015-08-04

电梯调度算法24篇相关论文

强化学习,群控,智能控制,调度模拟,C++实现,滚动优化,模糊控制,预约等内容丰富

2015-08-03

离散余弦变换源码

离散余弦变换源码,内容丰富,cpp文件,可以下载一看

2015-08-03

Android应用源码基于WIFI项目._局域网聊天

wifi局域网聊天,可以实现手机搜索热点和创建热点,内容丰富

2015-08-03

Visio科学图形包

Visio科学图形包,里面是一个软件,点击安装就行

2015-08-03

matlab智能算法经典案例

30个matlab经典智能算法案例分析,包括遗传算法、粒子群算法、神经网络相关案例

2015-08-03

Android-USB-Serial-Monitor-Lite

Android设备监测USB端口 跟下位机通信

2015-05-16

空空如也

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

TA关注的人

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