wengweitao.com
往往台的博客
http://www.wengweitao.com/category/bian-cheng-yu-yan.html
Articles in the 编程语言 category. 四 30 四月 2015. Page 1 / 1. Proudly powered by Pelican. And Theme by Gum 2015 wwt.
wengweitao.com
生成学习算法与判别学习算法
http://www.wengweitao.com/sheng-cheng-xue-xi-suan-fa-yu-pan-bie-xue-xi-suan-fa.html
三 05 八月 2015. Generative learning algorithm 和 判别学习算法. Discriminative learning algorithm ,它们所学到的模型分别成为生成模型和判别模型。 举一个具体的例子,假设我们现在要对两种动物进行分类,给定一个动物要么是大象 y=1 ,要么是狗 y=0。 P(y x)= frac{P(x,y)}{P(x)}= frac{P(x y)P(y)}{P(x)}$. 其中 (P(x)=P(x y=0)P(y=0) P(x y=1)P(y=1) ). 当我们需要对新的输入进行分类的时候,只需要求 (argmax yP(y x) ). 或者条件概率分布 (P(y x) ). 例如,对于线性分类器,我们直接学习到一条直线作为决策边界 decision boundary ,这条直线将大象和狗分开,当有新的输入的时候,根据新的输入落在决策边界的哪一端进行分类。 判别学习算法直接学习 (P(y x) ). 而生成学习算法先学习 (P(x y) ). 然后利用贝叶斯公式,求出 (P(y x) ). Proudly powered by Pelican.
wengweitao.com
[leetcode] Majority Element II
http://www.wengweitao.com/leetcode-majority-element-ii.html
Leetcode] Majority Element II. 一 29 六月 2015. Given an integer array of size n, find all elements that appear more than n/3 times. The algorithm should run in linear time and in O(1) space. 本题是 求超过 n/2 个元素. 相当于每次都抵消3个数字(nums[i], num1, num2),而主元素大于n/3,所以若主元素存在则必定在最后剩下的num1和num2中。 Proudly powered by Pelican. And Theme by Gum 2015 wwt.
wengweitao.com
往往台的博客
http://www.wengweitao.com/category/python.html
Articles in the Python category. 一 07 三月 2016. 一 27 七月 2015. 方法创建一个新的socket,通常提供两个参数,第一个参数是address family, 第二个是socket type。 Create an INET, STREAMing socket. Bind the socket to all available interfaces on port 8888. CORS 跨域资源共享,Cross-Origin Resource Sharing. 日 24 五月 2015. Maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0. Http:/ libs.baidu.com/jquery/1.9.0/jquery.js . False is False is False 的结果是 True? 六 25 四月 2015. 三 08 四月 2015. Checks whether the words are anagrams.
wengweitao.com
往往台的博客
http://www.wengweitao.com/category/gong-ju.html
Articles in the 工具 category. 日 17 四月 2016. 六 16 四月 2016. 二 01 三月 2016. My project folder virtualenv ENV source. 会在当前目录创建名为ENV的虚拟环境,此时在当前目录会自动生成三个目录 bin, include和lib。 CentOS 升级 gcc 和 g 的方法. 二 12 五月 2015. CentOS 系统自带的 gcc 或者 g 的版本是 g (GCC) 4.4.6. GCC 版本太旧,导致了很多使用上的不便,如 无法使用g -std=c 11 命令来编译 C 11、无法使用Vim的很多插件 YouCompleteMe等。 1使用 redhat developer toolset 1.1 的repo,安装GCC. Etc/yum.repos.d wget http:/ people . 一 11 五月 2015. Tmux是一个终端的复用器 terminal multiplexer ,可以简单理解为一个终端的窗口管理程序。 Sudo yum install tmux. Page 1 / 2.
wengweitao.com
往往台的博客 - 面试题
http://www.wengweitao.com/tag/mian-shi-ti.html
Leetcode] Majority Element II. 一 29 六月 2015. Given an integer array of size n, find all elements that appear more than n/3 times. The algorithm should run in linear time and in O(1) space. 本题是 求超过 n/2 个元素. Leetcode] Basic Calculator II. 一 22 六月 2015. Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, , -, *, and / operators. The integer division should truncate toward zero. You may assume that the given expression is always valid.
wengweitao.com
[leetcode] Basic Calculator II
http://www.wengweitao.com/leetcode-basic-calculator-ii.html
Leetcode] Basic Calculator II. 一 22 六月 2015. Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, , -, *, and / operators. The integer division should truncate toward zero. You may assume that the given expression is always valid. 3 2*2" = 7 " 3/2 " = 1 " 3 5 / 2 " = 5. Proudly powered by Pelican. And Theme by Gum 2015 wwt.