自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

方品

更多博客 https://fangpin.github.io

  • 博客(99)
  • 收藏
  • 关注

原创 ubuntu交换caps和ctrl的方法

ubuntu交换caps和ctrl的方法对于一些用户(如Emacs党)来说,Ctrl键是一个经常需要使用的键,但是由于其位于键盘的两个角落,使用起来不是十分顺手。大小写锁定键Caps Lock在实际使用中并不是十分常用,大小写切换的功能可以通过配合Shift键完成,下面给出将Caps Lock键替换为Ctrl键的方法。方法在/etc/default/keyboard文件中添加XKBOPTIONS="

2017-03-23 20:32:38 3368

原创 ubuntu install google-pinyin

ubuntu google-pinsudo apt-get install fcitx-googlepinyinim-configClick through and select fcitx. Click through.Restart your computer. Click the keyboard in the top right corner. Press Configure Curren

2017-03-05 10:32:34 2598

转载 spacemacs latex

In theprevious post, I introduced several useful tips for editing LaTeX file using Vim. In a nutshell, there are shortcuts ( = and gq family), commands and plugins. In addition, I also introduced latex

2017-02-23 16:01:51 2421

原创 docker初探

本文以搭建 caffe,tensorflow,opencv,ubuntu-14.04-core docker镜像的过程,简要说明docker工作流和一些入门级知识.安装dockerlinux各发行版详细安装教程 https://docs.docker.com/engine/installation/linux/ubuntulinux/ ubuntu要求64位,内核版本高于3.10查看内核版本号un

2017-01-09 21:05:09 1204

原创 k近邻

K近邻是一种惰性分类算法,它不具有显示的学习过程,实际是使用数据集对空间进行划分来进行分类。算法有三要素:距离度量,k的选择,分类决策规则距离度量距离反应实例间的相似度。可以使用余弦距离或者 Minkowski 距离。cos distance实例 (x^1) 和 (x^2) 的 cos distance (L(x^1,x^2)=\frac{x^1*x^2}{|x^1||x^2|})Minko

2017-01-09 21:03:34 724

原创 朴素贝叶斯

朴素贝叶斯是基于贝叶斯定理和假设特征条件独立的分类方法。贝叶斯定理 (p(y|x)=\frac{p(x,y)}{p(x)}=\frac{p(y)*p(x|y)}{\sum_{y}{}p(y)*p(x|y)})条件独立 (p(X=x|Y=c_k)=\prod_{j=1}^{n}p(X^j=x^j|Y=c_k))朴素贝叶斯 (y=\arg \max_{c_k} \frac{p(Y=c_

2017-01-09 20:59:17 700

原创 感知机

感知机的学习目标在于求出分离数据的线性超平面,它是一个线性分类器,是神经网络和SVM的基础。感知机的定义感知机是一个二分类模型,假设对于输入向量X,输出Y满足 (Y\in { 1,-1 }).则对输入作如下预测 y=f(x)=sign(w*x+b)其中 (sign(x)) 为符号函数,(x \geq 0) 时返回1,否则返回-1. w叫权值向量,b为偏置。几何含义使用线性超平面w\*x+b

2017-01-09 20:55:12 422

原创 tensorflow examples

mnist之于机器学习,便如同hello world之于程序语言。code本文主要是代码汇总,不涉及具体理论。主要内容如下:1)线性回归2)logistic回归3)人工神经网络4)cnn5)双端lstm6)模型的保存和加载7)其他word2vechttps://github.com/fangpin/daily_programs/blob/master/python/tensorflow/wor

2017-01-09 20:51:56 2730

原创 word2vec原理及实现

word2vec,字词的向量空间模型依靠将语意相近的词语聚在一起来提高自然语言处理的表现。

2016-08-13 18:24:04 25205 4

转载 Mac系统10.11及以上升级numpy、scipy等python包报错解决方案

发现一个问题。Mac系统自带的python无法更新第三方包numpy包,错误如下:Collecting numpyUsing cached numpy-1.10.2-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whlInstalling

2016-07-09 17:30:53 2221

原创 tensorflow MNIST机器学习入门

tensorflow MNIST机器学习入门MNIST数据集MNIST数据集的官网是Yann LeCun’s website。在这里,我们提供了一份python源代码用于自动下载和安装这个数据集。你可以下载这份代码,然后用下面的代码导入到你的项目里面,也可以直接复制粘贴到你的代码文件里面。import input_datamnist = input_data.read_data_sets("MNI

2016-06-30 14:48:46 9810 4

原创 mac 安装tensorflow

mac 安装tensorflow安装pip$ sudo easy_install pip # 如果还没有安装 pip安装virtualenv 创建一个隔离的容器sudo pip install --upgrade virtualenv接下来, 建立一个全新的 virtualenv 环境. 为了将环境建在 ~/tensorflow 目录下, 执行:$ virtualenv --system-si

2016-06-27 19:58:22 1851

转载 让 Terminal/vim 使用 Solarized 配色

让 Terminal/vim 使用 Solarized 配色2014年10月08日 ⁄ 综合 ⁄ 共 3820字 ⁄ 字号 小 中 大 ⁄ 评论关闭在终端里边启动vim,终端的配色会影响vim的配色;vim的配色是叠加到终端的颜色上的,所以很多时候对vim的配色都和设想的不一样。在线配色网址:   http://bytefluent.com/devify/

2016-04-04 17:16:38 1210

转载 ubuntu14 配置java开发环境

怎样在Ubuntu 14.04中安装Java[日期:2014-09-11]来源:Linux中国  作者:Linux[字体:大 中 小]想知道如何在Ubuntu 14.04中安装Java?安装Java肯定是安装Ubuntu 14.04后首先要做的几件事情之一(见http://www.linuxidc.com/Linux/2014

2016-04-04 17:00:21 1099

原创 A implementation of a simple unix-like shell with pure c

A implementation of a simple unix-like shell with pure c#include #include #include #include #include #include #define MAXN 1000char* homePath,curPath[MAXN];char *newline="\n";char error_mes

2016-04-01 16:49:58 698

转载 lldb 和 gdb调试命令汇总

转自:http://lldb.llvm.org/lldb-gdb.htmlLLDB TO GDB COMMAND MAPBelow is a table of LLDB commands with the GDB counterparts. The built in GDB compatability aliases in GDB are also listed.

2016-03-28 23:07:56 1356

转载 ubuntu修改root密码

使用ubuntu的时候忘记了root密码该如何重置       先说进入grub的方法,ubuntu最近的版本默认进入grub的方法是刚开机的时候按住shift键。       我之前使用的版本ubuntu11.10修改root重置root密码的方法:      #1、开机进入grub时(开机按住esc进入grub),用上下键移到第二行的恢复模式,按e(注意不是回车) 

2016-03-28 18:06:11 423

原创 线段树代码整理

·      单点更新:最最基础的线段树,只更新叶子节点,然后把信息用PushUP(int r)这个函数更新上来o   hdu1166敌兵布阵题意:O(-1)思路:O(-1)线段树功能:update:单点增减 query:区间求和/************************************************************************

2016-03-05 22:54:46 682

原创 tsp旅行商问题和高级搜索方法

一、    问题介绍中国邮递员问题tsp输入:中国144个城市数据输出:最短路径序列及路径长度1.       采用局部搜索算法实现2.       采用模拟退化算法实现二、    程序设计与算法分析1.     待解决的问题实际上是优化与组合优化问题。很多问题属于优化问题,或者可以转化为优化问题,如TSP问题,皇后问题等。2.     用一个城市的序列表示一个可能

2015-12-23 16:02:33 4192

原创 博弈算法实现简单五子棋

博弈算法实现的简单五子棋,使用极大极小搜索,alpha-beta剪枝,java图形界面。

2015-12-21 16:46:24 9036 2

原创 从皇后问题到图搜索

1. 采用递归策略实现N皇后问题,测试能够在短时间内找到解的最大N;2. 采用宽度优先算法实现N皇后问题,测试能够在短时间内找到解的最大N;3. 采用深度优先算法实现N皇后问题,测试能够在短时间内找到解的最大N。4. 利用位运算算法实现N皇后问题,测试能够在短时间内找到解的最大N。5. 采用爬山法实现N皇后问题,测试能够在短时间内找到解的最大N。

2015-12-08 18:45:49 1066

原创 BestCoder Round #63

bestcoder 63#

2015-11-21 21:58:49 652

原创 [人工智能实践]爬山法,分支界限法求解皇后问题

皇后问题通常方法是回溯,但效率较低。另外一种方法是使用随机算法,利用分支界限法的思想作为启发函数。10000以内规模的问题效率不错。具体方法如下:用一维数组存储每一行所放皇后所在的列数,要保证所有皇后所在列均不同,只需要保证数组中无相同的值即可,也就是数组的值为一个n的全排列。因为随着n规模的增大,计算量增大的同时解的数目也增多,所以本算法采用随机生成的全排列来进行尝试。ru和rd

2015-09-30 14:27:35 1588

原创 poj 1077 八数码

用a*算法没有想到怎么优化每个节点状态需要复制上次状态的代价,导致tle。使用ida*  ,但是bound上界是靠直观感觉,并没有想到合适的估算方法ida*// poj 1077 八数码 IDA*#include #include #include #include #include #include #include #include #include #inc

2015-09-24 12:15:22 596

原创 hdu 5430

hdu 5430    http://acm.hdu.edu.cn/showproblem.php?pid=5430#include #include #include #include #include #include #include #include #include #include #include using namespace std;int gcd(

2015-09-06 19:51:12 474

原创 hdu5428

Problem DescriptionThere is a sequence of n positive integers. Fancycoder is addicted to learn their product, but this product may be extremely huge! However, it is lucky that FancyCoder only ne

2015-09-05 23:31:26 705

原创 加密技术在信息安全领域的重要作用

方品101215401172015年6月24日加密技术在信息安全领域的重要作用随着信息科学技术的发展和近年来人们的安全意识和隐私意识逐步提高,大家也越来越关注网络中的信息安全问题。这其中密码编码学是对付各种安全威胁最强有力的工具,它能有效的保证数据的隐私性和和安全性,在近年来在信息安全领域被广泛使用。密码编码学要求很高的数学基础:群和域理论,计算复杂性和实时分析

2015-06-24 13:39:16 6743

原创 hdu5269 数据结构Trie

Memphis loves xor very musch.Now he gets an array A.The length of A is n.Now he wants to know the sum of all (lowbit(Ai xor Aj)) (i,j∈[1,n])We define that lowbit(x)=2k,k is the smallest integer sa

2015-06-13 22:30:42 702

原创 poj 1062 最短路

//// main.cpp// poj1062//// Created by Fangpin on 15/6/10.// Copyright (c) 2015年 FangPin. All rights reserved.//#include #include #include #include const int inf=0x6f6f6f6f;using name

2015-06-10 20:32:03 531

原创 hdu 5265

求找数组中两个不同元素使的两个元素和%p尽量大。分析:读入数据并%p后,将[0,p/2]内的数放入向量a中,将(p/2,p)内的数放在向量b中。排序a,b。则所求值的产生分三种情况。1.全部来自a中,为a中最大两个数的和,但应注意两数和为p的情况。2.全部来自b中,为b中最大两数和-p。3.一个数来自a,一个数来自b。因为a,b中数和的范围是(p/2,p*3/2),因此最大值为小于

2015-06-08 19:31:40 722

原创 hdu 3829 二分图最大独立集

将孩子看做点,两个孩子间存在矛盾关系则连一条边,最后求二分图最大独立集即可//// main.cpp// hdu3829//// Created by Fangpin on 15/5/29.// Copyright (c) 2015年 FangPin. All rights reserved.//#include #include #include #include

2015-05-29 19:20:47 669

原创 POJ 3692 最大团

最大团=补图最大独立集when 补图是二分图时, 最大团=补图顶点数-最大匹配//// main.cpp// poj3692//// Created by Fangpin on 15/5/29.// Copyright (c) 2015年 FangPin. All rights reserved.//#include #include #include usi

2015-05-29 17:18:39 706

原创 poj 3020 二分图最小路径覆盖

二分图最小路径覆盖=|v|-最大匹配。此题为有向图,切所有边正反向存了两遍,所以结果匹配数要除以2//// main.cpp// poj3020//// Created by Fangpin on 15/5/29.// Copyright (c) 2015年 FangPin. All rights reserved.//#include #include #incl

2015-05-29 16:30:39 641

原创 poj 3259 bellman-ford判断是否存在负权回路

//// main.cpp// poj3259//// Created by Fangpin on 15/5/28.// Copyright (c) 2015年 FangPin. All rights reserved.//#include #include #include #include #include using namespace std;int g

2015-05-28 21:42:45 957

原创 poj1328 贪心

大意是x轴上方有n个目标点,坐标全为整数,为了扫描到他们,在x轴上安放雷达,每一个雷达扫描半径为d,问至少安放多少雷达。 首先想到的是化归。找出每一点在x轴上的扫描边界,即在这个范围内必须有雷达才能扫描到。这样便将问题化归为:给n个闭区间,找出最少的点,保证每个区间至少有一个点。贪心算法:我们先将问题的区间集合按右端点排序,从最左边的区间开始,如果该区间内雷达为空为空,

2015-05-21 20:47:32 815

原创 hdu1520 树形dp

每个节点有权值,子节点和父节点不能同时选,问最后能选的最大价值是多少?#include#include#include#include#include#includeusing namespace std;typedef long long int64;const int INF = 0x3f3f3f3f;const double PI = acos(-1.0);

2015-05-01 13:35:17 680

原创 hiho 1044

//// main.cpp// hiho1044//// Created by Fangpin on 15/4/28.// Copyright (c) 2015年 FangPin. All rights reserved.//#include #include #include using namespace std;int n,m,q;int dp[1005][

2015-04-29 14:03:28 1065

原创 大整数分治乘法

#include #include #include #include using namespace std;//500 wei cheng fastruct Num{ int num[1000],len; Num(){ memset(num,0,sizeof(num)); len=1; } Num(const str

2015-04-13 19:03:41 809

原创 二叉查找树相关

//// main.cpp// 二叉查找树//// Created by Fangpin on 15/3/30.// Copyright (c) 2015年 FangPin. All rights reserved.//#include struct Tree{//树结构 int key; Tree *left,*right,*p;};// 返回指向树

2015-03-30 11:05:22 666

原创 uva271

In the land of Hedonia the official language is Hedonian. A Hedonian professor had noticed that many of her students still did not master the syntax of Hedonian well. Tired of correcting the many synt

2015-03-24 18:46:34 670

空空如也

空空如也

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

TA关注的人

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