- 博客(288)
- 资源 (1)
- 问答 (3)
- 收藏
- 关注

原创 远程链接Ipython Notebook配置
工具帖(昨天为了测试spark性能,打算跑一些数据分析,远程安装ipython的时候不小心在home下rm -rf *,真的是… due前五个小时… 更糟糕的是我们正好这一次忘记把代码push到github上.一边流泪一边补作业.)最近经常跑数据分析,因为习惯本地跑ipython notebook分析,但数据都在server上,每次scp很麻烦,找了一下远程连接到服务器上的ipython
2016-11-09 01:57:38
8591
原创 PyTorch —— LeNet实现中的bug以及由此的小想法
经典的LeNet,在PyTorch/examples/mnist 实现中有个小问题,在这里和大家分享一下。是一个计算generalization error的问题。计算generalization error时,原代码有一行我一直不理解,test_loss /= len(test_loader) # loss function already averages over batch size。试了一
2017-07-09 11:03:39
1505
原创 分布式TensorFlow 踩坑记
单机版的TF没毛病,但是当大家在Tensorflow Github里面找到可用的模型,想分布式跑到时候,就会跑出来各种奇怪的问题。我尝试了几种不同构造TF的方式,算是成功渡过了踩坑期,特别记录一下。如果能帮助到各位TF boy最好。方法一:自己手动写分布式协议比如logistic regression在master上运行的伪代码如下with tf.Session('grpc://vm1:2222')
2017-04-28 12:54:05
4314
1
原创 优化问题—基础1
几种combinationlinear combination x=∑jλjxjx = \sum_j \lambda_j x_j 其中xj∈Rn,λ∈Rx_j \in \mathbb{R}^n, \lambda \in \mathbb{R}affine combination x=∑jλjxj,∑jλj=1x = \sum_j \lambda_j x_j, \sum_j \lambd
2017-03-08 13:10:47
900
原创 LDA Gibbs Sampling公式推导
前言这一章节内容也是参考了另外两篇不错的博客,然后对里面的公式进行更细致的推导博客1博客2Gibbs SamplingBackground所有的推导可以说都是根据这张图片:α∈RM×K\alpha \in \mathbb{R}^{M \times K}θm∈RK\theta_m \in \mathbb{R}^Kβ∈RK×V\beta \in \mathbb{R}^{K \times V}ϕk∈RV\
2017-03-05 05:48:43
1614
原创 机器学习统计篇——指数族exponential family 和 似然likelihood
这一篇估计会是非常长时间积累的博客。前阶段被统计虐的不行,整理一下。Random Sample iid概念:如果X1,...XnX_1,...X_n彼此之间相互独立的变量,并且每一个变量XiX_i的边缘概率pdf或pmd都是一样的函数f(x)f(x),那么我们就把变量X1,...XnX_1,...X_n称作是f(x)f(x)的随机取样。也可以说,X1,...XnX_1,...X_n是indepe
2017-02-22 03:33:25
4859
原创 实验吧—我喜欢培根
前半段用摩斯码解出,发现要用培根码。 后半段用培根码杰出手shiyanba/is/cool。提交答案的时候会比较tricky,CTF{SHIYANBA IS COOL}。这个…嗯…不要浪费太多时间
2017-02-21 01:45:25
1762
原创 实验吧—古典密码
这道题目真的是…需要很多古典密码的方法。首先根据第一个提示,解密方法在谜面中,看数字很像ASCII,于是根据对应能求出一长串字符串。提交没过。第二个提示一直没有用。key值得固定结构…竟然就是”CTF{}”…这个真的是太含蓄了…所以也就是第一步得到的字符串要转换成CTF{…}这个形式,所以再根据古典密码列置换的思路,35个字符串,5*7或者7*5,发现只有5行7列能够进行转换。转换之后就是正确结果。
2017-02-20 06:17:47
2236
原创 实验吧—考考你的程序功底
如果只是看写代码的部分,不难,除了提议表达有些模糊。(要考虑所有小正方形的对角线,而不是只考虑两条主对角线)代码附在这里其实如何通过OCR获取整个矩形才是把这道题目变成hard的原因。
2017-02-20 05:33:22
795
原创 实验吧—奇怪的短信
无聊玩了一下,链接在这里。模拟以前发短信的方式,可以想象小灵通,不知道有没有用过的。(暴露年龄啊)比如手机上按下21就是A,22就是B。以此类推。注意最后的答案是小写。
2017-02-20 03:42:22
1915
原创 关于P、NP问题和算法的一点联系
这篇博客主要是解释一下我们平时在算法上用到的复杂度和NP还有P的联系,以及为什么第一反应是P的限制整数分解问题竟然“神奇的”是NP问题,以及由此展开的对其它问题的一些分析。基本概念知乎上对P和NP有非常详尽的解释,从图灵机展开的很多概念,我就不在此复制粘帖了。只需要有一个大的概念:问题主要分为NP和NP-hard;对于NP问题,有一部分问题是P的,有一部分是不确定P还是NP-Complete,最后一
2017-02-10 03:10:10
1159
原创 介绍几个图处理和流处理大数据平台
最近正好把几片big data application方面的文章读完,做了点笔记,还是放在GitBook中。Storm twitter的流处理https://lschacker.gitbooks.io/bigdata-intro/content/storm.htmlStreamScope / rStream 微软的流处理https://lschacker.git
2016-12-16 02:04:53
1565
原创 Distributed Machine Learning —— Parameter Server
Parameter Server for Distributed Machine Learning,NIPS 2013 worksshop知乎上看到最多的一篇。中间关于convergence的推导我还没完成,但是大致思路差不多。GitBookCommunication Efficient Distributed Machine Learning with the Par
2016-10-14 00:09:29
956
原创 LeetCode Russian Doll Envelopes
Description:You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelop
2016-09-06 21:25:01
410
原创 LeetCode Intersection of Two Arrays II
Description:Given two arrays, write a function to compute their intersection.Solution:和上一个题目不同,这里需要输出所有交集的valimport java.util.*;public class Solution { public int[] intersect(int[]
2016-09-05 12:06:07
273
原创 LeetCode Intersection of Two Arrays
Description:Given two arrays, write a function to compute their intersection.Solution:用HashSetimport java.util.*;public class Solution { public int[] intersection(int[] nums1, int[] n
2016-09-05 10:27:12
247
原创 LeetCode Top K Frequent Elements
Description:Given a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].Solution:感觉主要就是用HashMap和PriorityQueue。
2016-09-05 09:57:26
246
原创 LeetCode Reverse String
Description:Write a function that takes a string as input and returns the string reversed.Solution:学一下用法~~~public class Solution { public String reverseString(String s) { return new S
2016-09-05 09:27:03
238
原创 LeetCode Power of Four
Description:Given an integer (signed 32 bits), write a function to check whether it is a power of 4.Example:Given num = 16, return true. Given num = 5, return false.Follow up: Could yo
2016-09-05 06:05:11
244
原创 LeetCode Counting Bits
Description: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.Sol
2016-09-05 00:09:09
212
原创 LeetCode House Robber III
Description:The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent h
2016-09-04 23:25:51
230
原创 LeetCode Self Crossing
Description:You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres to the south, x[3] metres
2016-09-04 13:38:31
244
原创 LeetCode Verify Preorder Serialization of a Binary Tree
Description:One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel valu
2016-09-04 05:58:22
257
原创 LeetCode Increasing Triplet Subsequence
Description:Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should:Return true if there exists i, j, k s
2016-09-04 00:32:28
256
原创 LeetCode Odd Even Linked List
Description:Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You shou
2016-09-03 23:06:28
253
原创 LeetCode Patching Array
暑假实习太累了,没时间刷刷题。return offer到手,但是离开学还有一段时间,接着来刷!Description:Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n]incl
2016-08-23 11:17:45
260
原创 LeetCode Longest Increasing Path in a Matrix
太久没有回来写了。寒假的时候把题目都刷完,这次暑假刚刚开始就正好可以刷一刷。这道题目是经典dp题目,记得poj上面就有。Description:Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four
2016-05-22 12:54:44
283
原创 使用Expedia API获取航班信息
因为做project需要,得获取航班信息。(有一个小点想提一下的是,在Expedia的API主页上,给的请求网址是http://terminal2.expedia.com/x/mflights/search?但实际操作的时候要换成这个请求网址:http://terminal2.expedia.com:80/x/mflights/search?import jav
2016-04-21 22:23:06
1685
原创 Applied Natural Language Processing —— 读书笔记 第二章
前一章描述了自然语言理解中关于人如何理解的部分,这个过程包含了内部和外部的信息。外部信息是通过视觉或者听觉传递的语言内容,内部信息是个人关于这个时间和语言的知识。这些过程的结果就是使得人们能够理解语言输入。解决自然语言理解包含三个问题,第一个是模拟思考问题的过程,第二个是模拟思考的结果,第三个是模拟理解这个输入语言内容所需要的世界知识world knowledge。后两个都涉及到了如何表示的问
2016-01-19 01:36:46
554
原创 Applied Natural Language Processing —— 读书笔记 第一章
第一章 人们理解的NLP语言理解作为一种认知的过程,需要world knowledge。光这一点我就非常赞同,像我现在在美国留学半年,对于计算机相关的对话很明显能听懂的部分更多,参与的部分也更多,但是对于日常生活方面的就要差很多。world knowledge对于语言理解的影响可以分作三个部分:参考性inference,期望性expectation和模糊性ambiguity。参考性可以
2016-01-17 14:50:46
799
原创 LeetCode Count of Range Sum
Description:Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the elements in nums between indice
2016-01-14 23:51:06
2556
原创 LeetCode Create Maximum Number
Description:Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k from digits of the two. The relative order of the digits from
2016-01-14 03:12:26
463
原创 LeetCode Maximum Product of Word Lengths
Description:Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain
2016-01-13 09:40:02
320
原创 LeetCode Count of Smaller Numbers After Self
Description:You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of
2016-01-13 01:53:19
606
原创 LeetCode Super Ugly Number
Description:Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1,
2016-01-13 01:38:34
354
原创 LeetCode Range Sum Query - Mutable
Description:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element at index
2016-01-12 13:08:38
621
原创 LeetCode Additive Number
Description:Additive number is a string whose digits can form additive sequence.A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subseq
2016-01-12 07:57:22
328
原创 LeetCode Remove Invalid Parentheses
Description:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may contain letters other than the pa
2016-01-12 07:51:56
375
java中的sql语句为何会报错,而到了workbench就可以执行
2015-03-17
Python获得网卡IP的几个参数问题
2015-01-12
Python中注释前面加上引号是什么意思?
2014-12-30
TA创建的收藏夹 TA关注的收藏夹
TA关注的人