- 博客(158)
- 收藏
- 关注
原创 深度学习基本知识
machinelearningmastery.com/grid-search-hyperparameters-deep-learning-models-python-keras/损失函数loss:目标函数,函数用于调整参数评价指标metric:评价指标方法,其结果不用雨训练模型优化函数optimizer:更新参数的方法随机梯度是默认的.adam,RMSprop也不错
2017-02-14 17:50:04 1013
原创 encoder-decoder
Encoder-decoder框架Encoder-decoder框架最抽象的一种表示:即由一个句子生成另一个句子的通过处理模型。对于句子对,目标是给定输入句子x,期待通过encoder-decoder框架生成目标句子y.X,y分别由各自的单词序列构成:x=,y=encoder就是对输入句
2017-02-14 17:48:39 3595
原创 tensoflow笔记
tensorflow的运行流程:构造模型和训练构造模型阶段:构建一个图表示模型(此过程的模型都是抽象的),即流程图,数据的输入->中间处理->输出的过程此过程不会发生实际运算。此阶段涉及到的概念Tensor,Variable,placeholder训练阶段:实际的数据输入,梯度计算等操作此阶段涉及到的概念Session基本概念1.Tensor就是张量,可
2017-02-14 17:39:51 809
原创 vim快捷键
ctrl+alt+t: 打开一个窗口ctrl+shift+t: 在已有窗口基础上再打开一个窗口已用vim打开一个文件后, 按esc后,按":",输入set mouse=a, 再回车enter,此时鼠标可以在多屏幕之间随意切换;已用vim打开一个文件后, 按esc后,按":",输入vsp filename,可以编辑filename.
2017-02-14 17:38:20 560
原创 420. Strong Password Checker
A password is considered strong if below conditions are all met:It has at least 6 characters and at most 20 characters. It must contain at least one lowercase letter, at least one uppercase letter
2016-12-20 19:17:38 1134
原创 440. K-th Smallest in Lexicographical Order
Given integers n and k, find the lexicographically k-th smallest integer in the range from1 to n.Note: 1 ≤ k ≤ n ≤ 109.Example:Input:n: 13 k: 2Output:10Explanation:The lexicographical
2016-12-19 13:24:40 1174
原创 126. Word Ladder II
Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) frombeginWord to endWord, such that:Only one letter can be changed at a timeEa
2016-12-19 11:27:36 212
原创 Find the Duplicate Number
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number,
2016-12-17 19:01:44 300
原创 464. Can I Win
In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach or exceed 100 wins.What if we change the game s
2016-12-17 10:16:37 1462
原创 467. Unique Substrings in Wraparound String
Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", sos will look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....".Now we have
2016-12-12 13:28:08 436
原创 222. Count Complete Tree Nodes
Given a complete binary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, except possibly the last, is completely filled
2016-12-12 12:55:58 187
原创 guess-number-higher-or-lower-ii
We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number I picked
2016-12-07 10:13:19 218
原创 395. Longest Substring with At Least K Repeating Characters
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character inT appears no less than k times.Example 1:Input:s = "aaabb", k = 3
2016-12-06 13:42:05 187
原创 300. Longest Increasing Subsequence
public class Solution { public int lengthOfLIS(int[] nums) { if(nums==null) return 0; int n=nums.length; int[] asc=new int[n]; int len=0; for(in
2016-12-04 21:13:11 188
原创 386. Lexicographical Numbers
Given an integer n, return 1 - n in lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimize your algorithm to use less time and space. The input size m
2016-12-04 19:41:34 210
原创 421. Maximum XOR of Two Numbers in an Array
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai 31.Find the maximum result of ai XOR aj, where 0 ≤i, j n.Could you do this in O(n) runtime?Example:Input: [3, 10, 5, 25
2016-12-04 16:25:23 342
原创 309. Best Time to Buy and Sell Stock with Cooldown
Say you have an array for which the ith element 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(ie, buy one
2016-12-04 15:11:52 250
原创 378. Kth Smallest Element in a Sorted Matrix
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted order, not t
2016-12-03 17:46:31 213
原创 Auto Saved. Type here...(Markdown is enabled) 382. Linked List Random Node
Given a singly linked list, return a random node's value from the linked list. Each node must have thesame probability of being chosen.Follow up:What if the linked list is extremely large and it
2016-12-03 15:40:19 399
原创 406. Queue Reconstruction by Height
Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers(h, k), where h is the height of the person and k is the number of people in front of this
2016-12-03 12:23:54 228
原创 463. Island Perimeter
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely
2016-12-01 10:10:09 366
原创 179. Largest Number
Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is9534330.Note: The result may be very
2016-11-30 14:27:39 172
原创 172. Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.统计每个数的质因子中为5的数字个数,由于5的指数会出现多个5,因此还需要考虑这些情况。只要出现5则一定会有相对应的2相乘之后为0.
2016-11-28 17:06:05 182
原创 168. Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB 注意:在考
2016-11-28 16:17:55 190
原创 167. Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two number
2016-11-28 15:45:07 240
原创 166. Fraction to Recurring Decimal
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating, enclose the repeating part in parentheses.For
2016-11-28 14:36:55 150
原创 165. Compare Version Numbers
Compare two version numbers version1 andversion2.If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.You may assume that the version strings are non-empty and con
2016-11-28 10:06:49 145
原创 160. Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists: A: a1 → a2 ↘
2016-11-24 17:01:29 214
原创 155. Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get
2016-11-24 16:11:31 156
原创 153.154. Find Minimum in Rotated Sorted Array
Suppose a sorted array 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 duplicate exists in the ar
2016-11-24 10:01:31 143
原创 152. Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the largest pr
2016-11-24 09:26:25 153
原创 139. Word Break
Given a string s and a dictionary of words dict, determine ifs can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet",
2016-11-06 09:43:20 158
原创 135. Candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on
2016-11-04 15:52:21 169
原创 132. Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs.For example, given s = "aab",Return 1
2016-11-02 17:13:01 209
原创 106. Construct Binary Tree from Inorder and Postorder Traversal
Given inorder and postorder traversal of a tree, construct the binary tree.分析: 中序是左中右,后序是左右中,构建一棵树最重要的是找到其根节点,即中,因此以后序的最后一项开始遍历,然后以根节点的值在中序序列中寻找,若找到记录其位置,其位置左边的是当前根节点的左子树,其右边的则是其右子树。依次遍历即可。
2016-10-22 20:41:55 230
原创 102. 107.Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20
2016-10-18 11:44:44 208
原创 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 3B
2016-10-18 11:32:34 140
原创 99. Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devise
2016-10-18 10:59:00 247
原创 97. Interleaving String
Given s1, s2, s3, find whethers3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", return
2016-10-17 15:20:58 164
原创 85. Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0
2016-10-17 11:07:22 175
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人