- 博客(43)
- 收藏
- 关注
转载 caffe_batchnormal
bn层和scale层要一起使用,原因:batchnormal做了两件事。1) 输入归一化 x_norm = (x-u)/std, 其中u和std是个累计计算的均值和方差。2)y=alpha×x_norm + beta,对归一化后的x进行比例缩放和位移。其中alpha和beta是通过迭代学习的。那么caffe中的bn层其实只做了第一件事。scale层做了第二件事。
2017-07-27 09:54:39
1037
转载 opencl_1
在使用OpenCL API之前,和绝大部份所有其它的API一样,都需要include相关的header档案。由于在MacOS X 10.6下OpenCL的header档案命名方式和在其它作业系统下不同,因此,通常要使用一个#ifdef来进行区分。如下所示:#ifdef __APPLE__#include #else#include #endif这样就
2017-07-14 10:45:19
737
原创 第八章课后题_2
8.10(a)、令G成一个环,其顶点的数目与H顶点数目相同。(b)、令g=|V| - 1(c)、令g=子句的总数(d)、令b=a(a+1)/2,a个顶点两两相连(e)、令b=0
2017-07-05 23:51:13
256
原创 第八章课后题_1
8.3STINGY SAT的解是属于NP的,是可以在多项式时间内验证的。此外,SAT问题将k设为所有变量的总个数就可以规约到STINGY SAT。所以STINGY SAT是NP完全问题。8.8首先EXACT 4SAT属于NP。其次,对于3SAT实例,如果其中的某个子句中多次包含了同一个文字,就可以缩减为1次。如果包含一个变量的否定或肯定,可以去掉这个变量。这样就能把3SAT实例
2017-07-05 21:31:20
362
原创 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,
2017-06-28 15:25:12
180
原创 leetcode_ Add to List 121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), d
2017-06-28 13:58:41
174
原创 leetcode_ Add to List 108. Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.将一个排好的数组转换成平衡二叉树,就是说,每次从中间分开,左边作为左子树,右边作为右子树。代码:/** * Definition for a binary tree node.
2017-06-28 12:01:58
199
原创 leetcode_110. Balanced Binary Tree
题目:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node ne
2017-06-28 11:41:21
147
原创 leetcode_112. Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum
2017-06-28 10:49:01
173
原创 leetcode_sicily
做了几道模拟题。第一道,递归。简单,不必多说。直接贴代码:int F(int k, int n) { int m = 0; if(k == 0){ return n; } else{ for(int i = 0; i <= n; ++i){ m+=F(k-1,i); } return m; }}
2017-06-18 16:18:16
209
原创 leetcode_153. Find Minimum in Rotated Sorted Array
题目:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may assume no d
2017-06-01 21:03:29
127
原创 leetcode_162. Find Peak Element
题目:A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks,
2017-06-01 20:50:39
150
原创 leetcode_96. Unique Binary Search Trees
题目:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1
2017-05-22 15:42:25
166
原创 leetcode_72. Edit Distance
题目:Given two words word1 and word2, find the minimum number of steps required to convertword1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a
2017-05-15 14:07:53
166
原创 leetcode_63. Unique Paths II
题目:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the
2017-05-10 17:51:59
226
原创 leetcode_64. Minimum Path Sum
题目:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right whichminimizes the sum of all numbers along its path.跟上次的题目很像,就是多了权值条件而已。那就每个位置等于上面或者左面加自己,上面或者左
2017-05-10 17:26:31
131
原创 leetcode_62. Unique Paths
题目:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to r
2017-05-07 13:35:18
162
转载 残差网络
http://www.cnblogs.com/Charles-Wan/p/6535395.htmlhttp://www.cnblogs.com/Charles-Wan/p/6660077.html
2017-05-05 10:45:56
336
原创 leetcode_120. Triangle
题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3
2017-04-30 11:27:20
205
原创 leetcode_304. Range Sum Query 2D - Immutable
题目:Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1,col1) and lower right corner (row2, col2).The above rectangle (with the
2017-04-23 11:26:12
208
原创 leetcode_303. Range Sum Query - Immutable
题目:Given an integer array nums, find the sum of the elements between indicesi and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -> -1
2017-04-23 10:58:12
179
原创 leetcod_516. Longest Palindromic Subsequence
题目:Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.Example 1:Input:"bbbab"Output:4One possible longe
2017-04-10 14:24:43
183
原创 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
2017-04-10 12:24:15
247
原创 leedcode_100. Same Tree
题目: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.
2017-04-10 10:29:28
139
原创 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 h
2017-03-30 22:01:08
113
原创 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.简单的指针操作。指针操作一直不太
2017-03-22 11:58:47
136
原创 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 posi
2017-03-22 11:29:09
189
原创 leetcode_67. Add Binary
题目: Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100". 用一想就能想到的想法,有点笨,但好想,贴代码:class Solution {public: string addBinary(string
2017-03-19 23:26:06
156
原创 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 d
2017-03-19 21:49:02
179
原创 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 d
2017-03-19 20:41:58
285
原创 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,-
2017-03-19 00:22:42
164
原创 leetcode_38. Count and Say
题目:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as
2017-03-13 17:08:58
177
原创 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 a
2017-03-13 16:08:37
163
原创 leetcode_26. Remove Duplicates from Sorted Array
题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another array, you must do this in plac
2017-03-13 15:15:34
214
原创 leetcode_14. Longest Common Prefix
题目:Write a function to find the longest common prefix string amongst an array of strings.挺简单的,就是找到共同的最长前缀。我这个方法肯定浪费空间了,但是第一个想法就这么想的那就这么做了。其实两个for循环中外面的循环可以直接拿第一个元素的size来循环的。每次取这个前缀的大小多一。如果不是所有都成功那前缀
2017-03-13 00:03:54
153
原创 leetcode_9. Palindrome Number
题目:Determine whether an integer is a palindrome. Do this without extra space.提示里说了要看负数是不是。原来负数都按不是。于是很简单,反过来然后看看和原来是不是相等就行了。直接贴代码吧class Solution {public: bool isPalindrome(int x) {
2017-03-12 22:56:24
170
原创 leetcode_257. Binary Tree Paths
题目:Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]
2017-03-09 22:40:32
151
原创 leetcode_169. Majority Element
题目:Given an array of size n, find the majority element. The majority element is the element that appearsmore than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority elem
2017-03-04 14:09:13
142
转载 GAN
http://www.cnblogs.com/wangxiaocvpr/p/6069026.htmlhttp://www.leiphone.com/news/201609/gfKRIyIJXFEpmhbS.html
2017-02-26 14:56:37
163
原创 leetcode_3Longest Substring Without Repeating Characters
题目:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the an
2017-02-26 00:30:58
141
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人