自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(173)
  • 收藏
  • 关注

转载 Mac安装最新tensorflow遇到的坑,记录下方便后人

之前其他mac电脑安装tensorflow时候一切顺利,一行命令sudo pip install tensorflow就高搞定了,但是今天在新mac上安装tensorflow时候出现了一个bug,搞了半天终于搞完了。。。网上还没啥相关解决措施,蛋碎一地,也没有相关用户po这问题,应该是新的tensorflow对mac的支持问题,废话不多说:mac上pip安装tensorfl...

2018-03-03 01:30:00 523

转载 奇异值分解(SVD)详解

在网上看到有很多文章介绍SVD的,讲的也都不错,但是感觉还是有需要补充的,特别是关于矩阵和映射之间的对应关系。前段时间看了国外的一篇文章,叫A Singularly Valuable Decomposition The SVD of a Matrix,觉得分析的特别好,把矩阵和空间关系对应了起来。本文就参考了该文并结合矩阵的相关知识把SVD原理梳理一下。 SVD不仅是一个数学问题...

2018-01-18 20:49:00 252

转载 深度学习中常用的优化方法

一、basic algorithm1. SGD此处的SGD指mini-batch gradient descent,关于batch gradient descent, stochastic gradient descent, 以及 mini-batch gradient descent的具体区别就不细说了。现在的SGD一般都指mini-batch gradient descent...

2017-11-18 16:05:00 188

转载 一年了,走了一些弯路,是时候回归了,介绍下深度学习中常见的降低过拟合的方法...

1、regularization2、增加数据量,比方说做些变换、扰动、旋转等3、droupout4、early stopping转载于:https://www.cnblogs.com/zihaowang/p/7811883.html

2017-11-09 22:51:00 129

转载 softmax与logistic关系

Softmax回归模型,该模型是logistic回归模型在多分类问题上的推广,在多分类问题中,类标签可以取两个以上的值。 Softmax回归模型对于诸如MNIST手写数字分类等问题是很有用的,该问题的目的是辨识10个不同的单个数字。Softmax回归是有监督的,(译者注: MNIST 是一个手写数字识别库,由NYU 的Yann LeCun 等人维护。http://yann.lecun...

2017-04-27 23:28:00 510

转载 Java [Leetcode 387]First Unique Character in a String

题目描述:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2....

2016-08-24 00:42:00 99

转载 Java [Leetcode 384]Shuffle an Array

题目描述:Shuffle a set of numbers without duplicates.Example:// Init an array with set 1, 2, and 3.int[] nums = {1,2,3};Solution solution = new Solution(nums);// Shuffle the array [1,2,...

2016-08-24 00:01:00 108

转载 Java [Leetcode 167]Two Sum II - Input array is sorted

题目描述:Given an array of integers that is alreadysorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the ...

2016-08-19 00:37:00 139

转载 用stack实现min stack

遇到个好玩的问题,就是用一个stack实现min stack,什么意思呢,就是我实现stack,但是能以O(1)的时间复杂度和空间复杂度去找到我stack里面的最小值。常规的方法是:用一个变量存放当前最小值,但是会出现这种情况,就是当我的stack pop掉的值刚好是最小值时候,后面就没法知道当前的最小值了。怎么办呢?可以考虑在push阶段做个改变,就是在我每次往stack里面p...

2016-08-17 20:58:00 144

转载 bootstrap, boosting, bagging 几种方法的联系

Bootstraping:名字来自成语“pull up by your own bootstraps”,意思是依靠你自己的资源,称为自助法,它是一种有放回的抽样方法,它是非参数统计中一种重要的估计统计量方差进而进行区间估计的统计方法。其核心思想和基本步骤如下:  (1) 采用重抽样技术从原始样本中抽取一定数量(自己给定)的样本,此过程允许重复抽样。  (2) 根据抽出的样本计算给定的...

2016-08-17 17:32:00 98

转载 Java [Leetcode 383]Ransom Note

题目描述:Given
 an 
arbitrary
 ransom
 note
 string 
and 
another 
string 
containing 
letters from
 all 
the 
magazines,
 write 
a 
function 
that 
will 
return 
true 
if 
the 
ransom 
 note 
can ...

2016-08-17 00:19:00 148

转载 蓄水池抽样

问题:如何随机从n个对象中选择一个对象,这n个对象是按序排列的,但是在此之前你是不知道n的值的。思路:如果我们能够知道n的值,那么问题就简单了,只需要randInt(n)得到确切的位置,然后选择出该位置的值即可,实现概率为1/n的抽样。但现在我们并不知道n的值,这个问题便抽象为蓄水池抽样,即从一个包含n个对象的列表S中随机选取k个对象,n为一个非常大或者不知道的值。通常情况下,n...

2016-08-11 00:08:00 89

转载 Java [Leetcode 357]Count Numbers with Unique Digits

题目描述:Given anon-negativeinteger n, count all numbers with unique digits, x, where 0 ≤ x < 10n.Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ ...

2016-08-03 00:03:00 101

转载 Java [Leetcode 347]Top K Frequent Elements

题目描述:Given a non-empty array of integers, return thekmost frequent elements.For example,Given[1,1,1,2,2,3]and k = 2, return[1,2].Note:You may assumekis always valid, 1 ≤k≤ n...

2016-07-31 16:55:00 81

转载 Python [Leetcode 374]Guess Number Higher or Lower

题目描述:We are playing the Guess Game. The game is as follows:I pick a number from1ton. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the numb...

2016-07-30 22:33:00 183

转载 Python [Leetcode 342]Power of Four

题目描述: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.解题思路:位操作。首先判断是不是只有一位数字为1,其余...

2016-07-30 20:58:00 103

转载 Python [Leetcode 345]Reverse Vowels of a String

题目描述:Write a function that takes a string as input and reverse only the vowels of a string.Example 1:Given s = "hello", return "holle".Example 2:Given s = "leetcode", return "leotcede".No...

2016-07-28 23:35:00 353

转载 Python [Leetcode 141]Linked List Cycle

题目描述:Given a linked list, determine if it has a cycle in it.解题思路:快的指针和慢的指针代码如下:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# ...

2016-07-28 00:47:00 102

转载 Python [Leetcode 121]Best Time to Buy and Sell Stock

题目描述:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of t...

2016-07-27 22:57:00 90

转载 Python [Leetcode 350]Intersection of Two Arrays II

题目描述:Given two arrays, write a function to compute their intersection.Example:Givennums1=[1, 2, 2, 1],nums2=[2, 2], return[2, 2].Note:Each element in the result should appear a...

2016-07-27 00:32:00 106

转载 Python [Leetcode 344]Reverse String

题目描述:Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".解题思路:见代码。代码如下:class Solution(object): def reverseSt...

2016-07-14 00:14:00 137

转载 正则化,数据集扩增,Dropout

正则化方法:防止过拟合,提高泛化能力在训练数据不够多时,或者overtraining时,常常会导致overfitting(过拟合)。其直观的表现如下图所示,随着训练过程的进行,模型复杂度增加,在training data上的error渐渐减小,但是在验证集上的error却反而渐渐增大——因为训练出来的网络过拟合了训练集,对训练集外的数据却不work。为了防止overfitt...

2016-05-13 19:50:00 160

转载 bootstrap, boosting, bagging 几种方法的联系

Jackknife,Bootstraping, bagging, boosting, AdaBoosting, Rand forest 和 gradient boosting这些术语,我经常搞混淆,现在把它们放在一起,以示区别。(部分文字来自网络,由于是之前记的笔记,忘记来源了,特此向作者抱歉)Bootstraping:名字来自成语“pull up by your own bo...

2016-05-13 16:51:00 90

转载 深度学习与传统神经网络算法

传统的神经网络中采用的是BP算法,存在的主要问题:数据获取问题我们需要依赖于有标签的数据才能进行训练。然而有标签的数据通常是稀缺的,因此对于许多问题,我们很难获得足够多的样本来拟合一个复杂模型的参数。例如,考虑到深度网络具有强大的表达能力,在不充足的数据上进行训练将会导致过拟合。局部极值问题使用监督学习方法来对浅层网络(只有一个隐藏层)进行训练通常能够使参数收敛到合理的...

2016-04-08 12:14:00 868

转载 Java [Leetcode 96]Unique Binary Search Trees

题目描述:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1 3 3 2 ...

2016-04-03 19:18:00 75

转载 Java [Leetcode 137]Single Number II

题目描述:Given an array of integers, every element appearsthreetimes except for one. Find that single one.解题思路:具体参考Detailed explanation and generalization of the bitwise operation method for ...

2016-04-03 18:28:00 75

转载 深度优先搜索和广度优先搜索

深度优先遍历1.深度优先遍历的递归定义  假设给定图G的初态是所有顶点均未曾访问过。在G中任选一顶点v为初始出发点(源点),则深度优先遍历可定义如下:首先访问出发点v,并将其标记为已访问过;然后依次从v出发搜索v的每个邻接点w。若w未曾访问过,则以w为新的出发点继续进行深度优先遍历,直至图中所有和源点v有路径相通的顶点(亦称为从源点可达的顶点)均已被访问为止。若此时图...

2016-03-28 15:17:00 93

转载 Java [Leetcode 337]House Robber III

题目描述: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 house. ...

2016-03-24 23:11:00 115

转载 Java [Leetcode 318]Maximum Product of Word Lengths

题目描述:Given a string arraywords, find the maximum value oflength(word[i]) * length(word[j])where the two words do not share common letters. You may assume that each word will contain only low...

2016-03-24 15:47:00 130

转载 Java [Leetcode 94]Binary Tree Inorder Traversal

题目描述:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].解题思路:使用栈。从根节点开始...

2016-03-23 15:32:00 79

转载 Java [Leetcode 338]Counting Bits

题目描述:Given a non negative integer numbernum. For every numbersiin the range0 ≤ i ≤ numcalculate the number of 1's in their binary representation and return them as an array.Example:Forn...

2016-03-23 13:51:00 141

转载 关联规则挖掘

数据挖掘是指以某种方式分析数据源,从中发现一些潜在的有用的信息,所以数据挖掘又称作知识发现,而关联规则挖掘则是数据挖掘中的一个很重要的课题,顾名思义,它是从数据背后发现事物之间可能存在的关联或者联系。举个最简单的例子,比如通过调查商场里顾客买的东西发现,30%的顾客会同时购买床单和枕套,而购买床单的人中有80%购买了枕套,这里面就隐藏了一条关联:床单—>枕套,也就是说很大一部分顾客...

2016-03-21 14:29:00 135

转载 数据归一化的两种常用方法

数据标准化(归一化)处理是数据挖掘的一项基础工作,不同评价指标往往具有不同的量纲和量纲单位,这样的情况会影响到数据分析的结果,为了消除指标之间的量纲影响,需要进行数据标准化处理,以解决数据指标之间的可比性。原始数据经过数据标准化处理后,各指标处于同一数量级,适合进行综合对比评价。以下是两种常用的归一化方法:一、min-max标准化(Min-Max Normalization)也称...

2016-03-08 22:44:00 392

转载 Java [Leetcode 144]Binary Tree Preorder Traversal

题目描述:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].解题思路:这个问题最简单的方...

2016-03-07 23:31:00 82

转载 Java [Leetcode 268]Missing Number

题目描述:Given an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=[0, 1, 3]return2.Note:Your algorithm sho...

2016-03-06 20:35:00 82

转载 Java [Leetcode 319]Bulb Switcher

题目描述:There arenbulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or ...

2016-03-06 20:20:00 65

转载 Java [Leetcode 122]Best Time to Buy and Sell Stock II

题目描述:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (...

2016-03-06 16:23:00 66

转载 谱聚类算法

转载自:【聚类算法】谱聚类(Spectral Clustering)1、问题描述  谱聚类(Spectral Clustering, SC)是一种基于图论的聚类方法——将带权无向图划分为两个或两个以上的最优子图(sub-Graph),使子图内部尽量相似,而子图间距离尽量距离较远,以达到常见的聚类的目的。  对于图的相关定义如下:对于无向图G = (V,E),V表示...

2016-03-05 20:33:00 221

转载 Java [Leetcode 238]Product of Array Except Self

题目描述:Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].Solve itwithout division...

2016-03-04 14:36:00 123

转载 Java [Leetcode 260]Single Number III

题目描述:Given an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:...

2016-03-04 13:42:00 145

空空如也

空空如也

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

TA关注的人

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