上一页 1 2 3 4 5 6 ··· 26 下一页
摘要: 要实现的部分为:forward prop, softmax函数的cost function,每一层的gradient,以及penalty cost和gradient。forwad propforward prop是输入sample data,使sample data通过神经网络后得到神经网络输出的过... 阅读全文
posted @ 2015-05-25 20:39 SunshineAtNoon 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 卷积的实现:对于每幅图像,每个filter,首先从W中取出对应的filter:filter = squeeze(W(:,:,filterNum));接下来startercode里面将filter旋转90度并且取出image:% Flip the feature matrix because of t... 阅读全文
posted @ 2015-05-25 11:37 SunshineAtNoon 阅读(629) 评论(0) 推荐(0) 编辑
摘要: 今天太长姿势了,什么叫懂了也写不出代码说的不就是我吗,就那么几行代码居然叽叽歪歪写了一个小时。首先exercise要实现的是softmax的cost function和gradient,如下图:(1)(2)(3)下面就来仔细分析怎么不借助for循环高效的实现上面三个函数。首先P是一个关键,因为在J和... 阅读全文
posted @ 2015-05-23 15:32 SunshineAtNoon 阅读(941) 评论(0) 推荐(1) 编辑
摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?题解:如果要原地算法的话,就只能用交换... 阅读全文
posted @ 2015-04-03 16:37 SunshineAtNoon 阅读(291) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its index.... 阅读全文
posted @ 2015-04-02 16:24 SunshineAtNoon 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 描述且说上一周的故事里,小Hi和小Ho费劲心思终于拿到了茫茫多的奖券!而现在,终于到了小Ho领取奖励的时刻了!小Ho现在手上有M张奖券,而奖品区有N件奖品,分别标号为1到N,其中第i件奖品需要need(i)张奖券进行兑换,同时也只能兑换一次,为了使得辛苦得到的奖券不白白浪费,小Ho给每件奖品都评了分... 阅读全文
posted @ 2015-04-02 15:12 SunshineAtNoon 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 就是用归并排序求数组中得逆序对。假设数组为a:[2 4 5],和b:[1 3],那么在这一次归并的时候逆序对这样求,belement表示当前result数组中b数组对应的元素个数,total表示逆序对的个数:a:[2 4 5] b:[1 3] result{}a:[2 4 5] b[3] r... 阅读全文
posted @ 2015-04-02 10:01 SunshineAtNoon 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文
posted @ 2015-04-01 14:46 SunshineAtNoon 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:递归就可以了。Java代码如下: 1 /** 2 * Definition for binary ... 阅读全文
posted @ 2015-03-31 22:24 SunshineAtNoon 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-03-31 16:47 SunshineAtNoon 阅读(140) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 26 下一页