自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

yuweiming70的博客

清华材料大三 cs入门者

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

原创 [深度学习]更好地理解正则化:可视化模型权重分布

在机器学习中,经常需要对模型进行正则化,以降低模型对数据的过拟合程度,那么究竟如何理解正则化的影响?本文尝试从可视化的角度来解释其影响。首先,正则化通常分为三种,都是在loss函数的基础上外加一项:L0:  ,即不等于0的元素个数L1:  ,即所有元素的绝对值之和L2:  ,即所有元素的绝对值平方和训练模型的时候,模型将在保证loss主体损失下降的情况下,尽量保证权重往这些方向...

2018-08-08 19:01:56 3665 4

原创 Leetcoe 868 二进制间距

题目描述:给定一个正整数 N,找到并返回 N 的二进制表示中两个连续的 1 之间的最长距离。 如果没有两个连续的 1,返回 0 。 示例 1:输入:22输出:2解释:22 的二进制是 0b10110 。在 22 的二进制表示中,有三个 1,组成两对连续的 1 。第一对连续的 1 中,两个 1 之间的距离为 2 。第二对连续的 1 中,两个 1 之间的距离为 1 。答案取两个距离之中最...

2018-07-15 20:25:47 404

原创 Leetcode 869 重新排序得到 2 的幂

题目描述:从正整数 N 开始,我们按任何顺序(包括原始顺序)将数字重新排序,注意其前导数字不能为零。如果我们可以通过上述方式得到 2 的幂,返回 true;否则,返回 false。 示例 1:输入:1输出:true示例 2:输入:10输出:false示例 3:输入:16输出:true示例 4:输入:24输出:false示例 5:输入:46输出:true 提示:1 <= N...

2018-07-15 20:24:56 673

原创 将VGG提取的featrue map直接用作回归目标检测有多差?

网上总是说将VGG输出的featrue map作为回归检测,预测目标的xy坐标非常难,也非常差,那有多差呢?在PET数据集上测试,结果如图,平均IOU=46.0%from keras.layers import Dense, Activation, Flatten, Convolution2D, Dropout, MaxPooling2Dfrom keras.optimizers import ...

2018-07-03 17:11:02 1496 3

原创 PET数据集的下载以及预处理

Pet数据集是Oxford提供的宠物数据集,内含约7000张猫狗图片,并且其中一部分图片标出了猫狗脸的位置,下载地址:http://www.robots.ox.ac.uk/~vgg/data/pets/数据集分为两部分Dataset,图片Groundtruth data,标示数据数据处理,将所有有标示脸位置的图片保存到一个数组x(3686, 224, 224, 3) ,所有的猫狗分类标签,位置数据...

2018-07-03 17:05:18 5058 2

原创 在lintcode刷AI题:垃圾短信分类

lintcode上面有十几道类似于Kaggle的小项目,用于深度学习的入手练习再好不过了,现在就让我们上手这道猫狗分类器的问题吧!(全程用Keras框架,简单上手!)本题网址:https://www.lintcode.com/ai/spam-message-classification题目描述:本题提供一个数据集, 它包括了5574条英文短信,每条短信内容由几个长短不一的句子组成。每条短信都标注好...

2018-07-01 23:09:03 1696 2

原创 [数据集发布]风景数据集

作者最近抓取了一大堆风景照片,现在发布,包括7268张320x180大小的风景照片,有需要的自取。地址:github

2018-07-01 11:51:57 4193 2

原创 Leetcode 860 柠檬水找零

题目描述:在柠檬水摊上,每一杯柠檬水的售价为 5 美元。顾客排队购买你的产品,(按账单 bills 支付的顺序)一次购买一杯。每位顾客只买一杯柠檬水,然后向你付 5 美元、10 美元或 20 美元。你必须给每个顾客正确找零,也就是说净交易是每位顾客向你支付 5 美元。注意,一开始你手头没有任何零钱。如果你能给每位顾客正确找零,返回 true ,否则返回 false 。示例 1:输入:[5,5,5,...

2018-07-01 11:14:19 1717

原创 在lintcode刷AI题:猫狗分类器

lintcode上面有十几道类似于Kaggle的小项目,用于深度学习的入手练习再好不过了,现在就让我们上手这道猫狗分类器的问题吧!(全程用Keras框架,简单上手!)本题网址:LintCode题目描述:给出一张猫或狗的图片,识别出这是猫还是狗。这种识别具有很重要的意义,比如:Web服务为了进行保护,会防止一些计算机进行恶意访问或信息爬取,进而设立一些验证问题,这些验证问题对于人来说很容易做,但是对...

2018-06-29 14:14:15 2138 3

原创 在lintcode刷AI题:Otto Group 商品识别

lintcode上面有十几道类似于Kaggle的小项目,用于深度学习的入手练习再好不过了,现在就让我们上手这道猫狗分类器的问题吧!(全程用Keras框架,简单上手!)本题网址:LintCode题目描述:Otto Group是世界上最大的电子商务公司之一,在全世界范围内,它每天会卖出数百万件商品。每件商品所属的类别分别是Class_1~ Class_9。对于这家公司的来说,货物供给和需求分析是非常重...

2018-06-29 14:13:20 1199 4

原创 Leetcode 849 到最近的人的最大距离

问题描述:在一排座位( seats)中,1 代表有人坐在座位上,0 代表座位上是空的。至少有一个空座位,且至少有一人坐在座位上。亚历克斯希望坐在一个能够使他与离他最近的人之间的距离达到最大化的座位上。返回他到离他最近的人的最大距离。示例 1:输入:[1,0,0,0,1,0,1]输出:2解释:如果亚历克斯坐在第二个空位(seats[2])上,他到离他最近的人的距离为 2 。如果亚历克斯坐在其...

2018-06-10 11:09:28 1037

原创 Leetcode 848 字母移位

题目描述:有一个由小写字母组成的字符串 S,和一个整数数组 shifts。我们将字母表中的下一个字母称为原字母的 移位(由于字母表是环绕的, 'z' 将会变成 'a')。例如·,shift('a') = 'b', shift('t') = 'u',, 以及 shift('z') = 'a'。对于每个 shifts[i] = x , 我们会将 S 中的前 i+1 个字母移位 x 次。返回将所有这些移...

2018-06-10 11:02:53 418

原创 Leetcode 850 矩形面积 II

题目描述:我们给出了一个(轴对齐的)矩形列表 rectangles 。 对于 rectangle[i] = [x1, y1, x2, y2],其中(x1,y1)是矩形 i 左下角的坐标,(x2,y2)是该矩形右上角的坐标。找出平面中所有矩形叠加覆盖后的总面积。 由于答案可能太大,请返回它对 10 ^ 9 + 7 取模的结果。示例 1:输入:[[0,0,2,2],[1,0,2,3],[1,0,3,1...

2018-06-10 11:02:43 2892

原创 用风格迁移搞事情!超越艺术字:卷积神经网络打造最美汉字

曾几何时,小学的我们上机课时最喜欢摆弄的就是word 的艺术字,丑陋的效果并不能阻挡我们在每个角落塞进七彩的字体.......“七彩”的艺术字但是时代不同了,我们现在已经有了各种先进的PS软件,我们已经可以作出这样的艺术字:各种PS艺术字但是,我们还能更进一步吗?将设计师从繁复的PS工作中解放出来,用深度学习的方法设计艺术字,自动生成更加有意思的艺术字吗?答案当然是可以!我们实际上已经有了CNN(...

2018-06-06 09:27:32 2515 3

原创 [纪念浪费的时间] 安装tensorflow-gpu + cuda + cudnn 之那些踩过的坑

首先一定要确认下载到的tensorflow cuda 和cudnn的版本是正确的1.首先卸载tensorflow(cpu)版本,(如果有的话),没有就不用了2.使用anaconda,安装tensorflow-gpu ,输入pip install tensorflow-gpu即可(注意,这里要架梯子才快,此外要以管理员权限打开anaconda prompt)3.下载cuda,我在北邮人上下载的cud...

2018-05-17 10:58:00 416

原创 Leetcode 806 Number of Lines To Write String 字符串的行数

题目描述:We are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 unit...

2018-03-25 11:05:11 1125

原创 Leetcode 807 Max Increase to Keep City Skyline 不变天际线

题目描述:In a 2 dimensional array grid, each value grid[i][j] represents the height of a building located there. We are allowed to increase the height of any number of buildings, by any amount (the amount...

2018-03-25 11:05:09 1186 1

原创 Leetcode 804 Unique Morse Code Words 莫尔斯电码重复问题

题目描述:International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so o

2018-03-25 11:05:07 2156

原创 Leetcode 108 Convert Sorted Array to Binary Search Tree 将一个有序数组变成BST

题目描述:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of ...

2018-03-24 20:40:14 180

原创 Leetcode 107 Binary Tree Level Order Traversal II 二叉树层次遍历与倒转

题目描述:Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,15...

2018-03-24 20:32:25 228

原创 Leetcode 104 Maximum Depth of Binary Tree 二叉树的最大深度

题目描述:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.For example:Given binary tree [3,9,20...

2018-03-24 20:25:23 126

原创 Leetcode 101 Symmetric Tree 判断一棵树是否对称

题目描述:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3Bu...

2018-03-24 20:20:40 188

原创 Leetcode 100 Same Tree 判断两棵树相同

题目描述:Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.给出两个二叉树...

2018-03-24 20:13:50 173

原创 利用sklearn进行豆瓣电影评论的文本分类

    在之前,我已经在豆瓣电影top250中爬取了约6w条好评和差评,在此我们来利用这些数据,进行入门级别的文本分类。一 数据清洗    数据在豆瓣电影top250提供下载,下载后能看到6W条好评和差评,由于爬取时未能完全清除符号,导致一部分毫无意义的颜文字评论混入其中,为了清除这些数据,我在(仅当数据量较小的情况下)excel中替换掉了肉眼可见的一些符号,然后转换成xlsx格式(csv中出现中...

2018-03-24 19:59:04 3938

翻译 Python Numpy 快速入门指导 (四) 进阶操作

    本文乃Numpy Quickstart tutorial的翻译版本(并非完全翻译,翻译君为本人),英语能力足够的童鞋请阅读原文~,如果您觉得本文对您有帮助的话不要忘记点个赞哦!一 神奇的广播操作    numpy的一些universal操作要求被操作的两个数组需要拥有相同的形状,如果两者的形状不相同的时候,则会调用广播功能,规则如下:    1.当输入数组的维数不同时,不断地给数组的较小维...

2018-03-24 10:04:22 430

翻译 Python Numpy 快速入门指导 (三) 理清numpy什么时候会复制出一个新的数组?

    本文乃Numpy Quickstart tutorial的翻译版本(并非完全翻译,翻译君为本人),英语能力足够的童鞋请阅读原文~,如果您觉得本文对您有帮助的话不要忘记点个赞哦!    numpy在进行一些操作时,有时数组会被复制到新的数组,但是有的时候并不会这样做,对于初学者来说,这可能很混乱。现在我们就来辨别一下这些情况吧!一 不会复制到新的数组的情况    简单的赋值操作不会复制到新的...

2018-03-24 09:06:25 294

翻译 Python Numpy 快速入门指导 (二) 形状操作

    本文乃Numpy Quickstart tutorial的翻译版本(并非完全翻译,翻译君为本人),英语能力足够的童鞋请阅读原文~,如果您觉得本文对您有帮助的话不要忘记点个赞哦!一 改变多维数组的形状    首先创建一个你所想要大小的多维数组>>> a = np.floor(10*np.random.random((3,4)))>>> aarray([...

2018-03-23 19:07:48 370

原创 Leetcode 35 Search Insert Position 二分查找插入数字位置

题目描述:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array...

2018-03-23 12:42:08 213

原创 Leetcode 28 Implement strStr() 字符串匹配

题目描述:Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2Example 2:In...

2018-03-23 12:32:18 136

原创 Leetcode 27 Remove Element

题目描述:Given an array and a value, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input array in-p...

2018-03-23 09:24:41 106 1

原创 Leetcode 88 Merge Sorted Array 合并两个有序数组

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

2018-03-23 09:17:56 169

翻译 Python Numpy 快速入门指导 (一) 基础

    本文乃Numpy Quickstart tutorial的翻译版本(并非完全翻译,翻译君为本人),英语能力足够的童鞋请阅读原文~,如果您觉得本文对您有帮助的话不要忘记点个赞哦!一 预先准备      在阅读本文之前,请先确保您已经有了一些python基础,如果没有的话,请看Python Tutorial,安装在此跳过。二 基础    numpy的操作对象通常是齐次的多维数组,数组的每一个元...

2018-03-23 00:03:01 267

原创 yande.re 爬虫 自动爬取网站上的图片

    最近想要自动下载一些東方project同人图,看了看几家同人图网站,最后想先拿yande.re试手,不用登陆,页面上也没有乱七八糟的广告混淆视听,而且图片普遍质量很高,以下是代码:    如果有想用的,直接修改tag,文件保存路径,页数就可以直接用了import urllibimport urllib.requestimport reimport timeimport osdef...

2018-03-23 00:02:44 23293 2

原创 Leetcode 83 Remove Duplicates from Sorted List 有序链表去重

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

2018-03-22 10:00:41 150

原创 Leetcode 70 Climbing Stairs 爬楼梯的方法(动态规划)

题目描述:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positiv...

2018-03-22 09:58:20 317

原创 Leetcode 69 Sqrt(x) 求x开根号的整数部分

题目描述:Implement int sqrt(int x).Compute and return the square root of x.x is guaranteed to be a non-negative integer.Example 1:Input: 4Output: 2Example 2:Input: 8Output: 2Explanation: The square roo...

2018-03-22 09:54:16 640

原创 Leetcode 67 Add Binary 二进制加

题目描述:Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".用两个string表示大数,返回他们的和(也用string)思路:    1.不用想,这道题用string肯定是有坑的,很有可能输入的string很长,远远超过了long lon...

2018-03-22 09:47:39 109

原创 Leetcode 66 Plus One

题目描述:Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digits ...

2018-03-22 09:40:12 94

原创 Leetcode 58 Length of Last Word 句子中最后一个词的长度

题目描述:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defi...

2018-03-22 09:34:06 145

原创 Leetcode 53 Maximum Subarray 最大子串和

题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] has...

2018-03-22 09:30:08 161

空空如也

空空如也

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

TA关注的人

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