自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(53)
  • 资源 (1)
  • 收藏
  • 关注

转载 HMM(隐马尔科夫模型)学习二

三、隐藏模式在某些情况下,我们只能单纯的通过经验获取状态转移矩阵,但是却无法获取到初始概率向量。比如一个隐居在山洞里面从不外出的人,他是没法准确的获取到每一天确定天气的。但是在山洞中有很多水藻(水藻的状态可以一定概率上关联到天气),因此他可以利用前一天的水藻状态,通过水藻和天气的关系以及天气之间的转移矩阵来获取今天的天气。我的理解可以如下图:

2017-05-06 11:09:29 372

转载 HMM(隐马尔科夫模型)学习一

由于需要,最近需要学习下中文自然语言处理,先从最基本的隐马尔可夫模型学习。一.介绍在海边,通常我们可以通过观察海藻的状态(湿润/干燥)来预测第二天的天气,但是,这种预测并不是肯定的,比如湿润并不代表一定有雨,干燥也并不代表一定天晴,这些都是由一定概率的。同时,我们得出的天气结论是通过海藻这个条件间接得到的。这种推断是基于概率、间接得出结论的。二.生成模型(1)确定性模式在介绍中

2017-05-05 21:23:19 870

原创 python爬虫1

学习使用requests模块进行爬虫最简单的一句import requestshtml = requests.get(url)print html.text就可以得到源代码有时候为了模仿浏览器行为进行对反扒进行反制,需要伪装头:import requestshtml = requests.get(url,headers = headers)pri

2017-04-26 21:38:37 251

原创 python正则表达式

最近学爬虫,需要先学习正则表达式.号,匹配任意字符,换行符\n除外*号,匹配前一个字符0次至无限次?号,匹配前一个字符0次或者1次.*号,贪心算法,匹配尽可能多(长)的,得到满足条件最长的.*?号,飞贪心算法,匹配尽可能少,得到满足条件最短的()号,内部作为返回数据\d, 匹配纯数字重要,常用,一定要记住:(.*?)注意,一个字符串的正则输出结果

2017-04-26 19:46:35 229

原创 我所理解的caffe源码-------数据节点(blob)

我所理解的caffe源码-------数据节点个人认为要阅读caffe源码,必须要知道caffe的数据保存方式,我也不知道官方名称叫什么,这里姑且叫数据节点。Caffe的数据均以blob保存,因此我先阅读了blob.hpp。首先可以看到blob的几个成员变量:protected: shared_ptr data_; shared_ptr diff_; shared_

2017-02-07 19:34:46 2414

原创 我所认识的CAFFE

快要毕业了,学习了一段时间的caffe,总想着写点什么,免得以后不用了,就忘了,辜负了自己这段时间的经历。caffe是贾扬清及一干大神们开发的一款基于C++的深度学习框架,这个框架多用于计算机视觉相关的深度学习(目前除了jeffdonahue似乎还没有其他的RNN相关网络被收录)

2017-02-06 13:47:58 329

原创 python学习2

基本数据类型:数字和字符串列表:1.有序 2.可修改元组:1.有序 2.不可修改集合: 可以求交集、并集、差集、去重字典:关键是key键这些以前都有基础,就不详细做笔记了

2016-10-25 10:57:53 243

原创 python学习笔记1

1.在2.X版本上,字符串的链接有以下几种:(1)string + string(2)string + str(data)(3)string.format   例如:“我的名字是{0}, 我家在{1}”.format("aa", "bb"), 其中,{0}表示当前位置是首个,{1}表示第二个2.类的自有变量命名,一般会在前面加下划线,比如 self._name = name3.

2016-10-24 10:19:31 221

转载 Static 静态属性

static作用(修饰函数、局部变量、全局变量)在C语言中,static的字面意思很容易把我们导入歧途,其实它的作用有三条。(1)先来介绍它的第一条也是最重要的一条:隐藏。当我们同时编译多个文件时,所有未加static前缀的全局变量和函数都具有全局可见性。为理解这句话,我举例来说明。我们要同时编译两个源文件,一个是a.c,另一个是main.c。下面是a.c的内容char a

2016-04-20 15:11:14 454

原创 腾讯实习生一面

面试官很NICE.路上堵车,还有一公里的时候下车自己跑过去的,所以全程状态一直不好(当然,自己基础也不好)。(1)讲一讲对测试开发的理解。(2)讲一讲白盒和黑盒。(3)讲一讲QQ登陆需要测试什么(4)讲了下自己做的项目,面试官貌似对于机器学习和深度学习挺感兴趣。(5)深度学习的优势(6)讲一讲对于移动互联网的认识(7)一天之内,时针和分针重合多少次。

2016-04-19 13:27:25 512

原创 LEETCODE 338

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Example:For num = 5

2016-03-26 23:12:48 409

原创 LEETCODE 290

Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.

2016-03-26 22:53:45 356

原创 LEETCODE 278

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the

2016-03-25 20:03:21 258

原创 LEEDCODE 234

Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?Subscribe to see which companies asked this question刚开始没住时间复杂度和空间复杂度:

2016-03-24 23:03:42 323

原创 LEETCODE 226

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1观察到规律为:任意一个节点的左右子节点交换即可。/** * Definition for a binary tree node.

2016-03-24 22:41:39 261

原创 LEETCODE 219

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and jis at most k.S

2016-03-24 22:33:40 249

原创 LEETCODE 217

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element

2016-03-24 22:22:59 280

原创 LEETCODE 206

Reverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?Subscribe to see which companie

2016-03-23 22:15:53 298

原创 LEETCODE 203

Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5Credits:Special thanks

2016-03-23 21:50:50 331

原创 LEETCODE 205

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with anot

2016-03-23 21:49:09 260

原创 LEETCODE 202

Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares

2016-03-23 21:26:27 261

原创 字符串是否互为旋转

如果对于一个字符串A,将A的前面任意一部分挪到后边去形成的字符串称为A的旋转词。比如A="12345",A的旋转词有"12345","23451","34512","45123"和"51234"。对于两个字符串A和B,请判断A和B是否互为旋转词。思路:(1)如果两个字符串长度不等,则肯定不是互为旋转词(2)令C = A+A,那么如果B是A的旋转词,在A中肯定能找

2016-03-14 15:17:25 380

原创 LEETCODE 191

Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 000000

2016-03-14 14:28:49 217

原创 LEETCODE 326

Given an integer, write a function to determine if it is a power of three.class Solution {public: bool isPowerOfThree(int n) { if(n == 0) return false; if (1 == n)

2016-03-11 19:57:43 330

原创 LEETCODE 190

Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as0011100101

2016-03-11 19:36:13 491

原创 LEETCODE 189

Rotate 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

2016-03-11 17:13:44 409

原创 LEETCODE 172

Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.本题的意思是计算N的阶乘最后一共有多少个零。首先要分析零是怎么来的?每出现一个零,那么必然会有10这个因素,10 = 2

2016-03-11 15:56:20 408

原创 LEETCODE 171

Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ...

2016-03-11 15:28:43 238

原创 LEETCODE 169

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element

2016-03-10 22:36:07 292

原创 LEETCODE 168

Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB 思路,相当于1

2016-03-10 21:35:13 413

原创 LETCODE 165

Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.You may assume that the version strings are non-empty and co

2016-03-10 20:54:22 234

原创 LEETCODE 160

Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘

2016-03-10 18:24:28 610

原创 LEETCODE 155

Design 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() -- Get

2016-03-10 17:08:02 693

原创 LEETCODE 125

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is no

2016-03-09 17:16:20 841

原创 LEETCODE 119

Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].思路:首先计算每一行的值,最后返回要求的行。特别注意:给出的例子是第三行,返回【1,3,3,1】。则意味着行数应从第0行开始。这一点最开始没注意,花了很多时间。

2016-03-09 16:45:02 307

原创 LEETCODE 118

Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]第一种思路,注意到第一行第二行和其

2016-03-09 16:26:53 271

原创 LEETCODE 101

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f

2016-03-09 15:35:29 249

原创 LEETCODE 100

Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.类似于遍

2016-03-09 14:51:44 371

原创 LEETCODE 88

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold add

2016-03-08 16:49:19 222

原创 LEETCODE 83

Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.这个问题很适合用双指针来解决。一个

2016-03-08 15:59:23 229

JavaScript_window.setTimeout()_的详细用法

JavaScript_window.setTimeout()_的详细用法

2012-11-15

空空如也

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

TA关注的人

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