- 博客(12)
- 收藏
- 关注
原创 tensorflow中reduce_sum()在维度上的解释
今天在查tf.reduce_sum()的用法的时候,看到的一个解释。具体的可以看这个问题底下杨镒铭的回答:https://www.zhihu.com/question/51325408?from=profile_question_card tf.reduce_sum(tensor,dimension),其中第二个参数是维度。这个函数表面上看是进行加和操作,实际上在做的事情是在降维。比如这个例子:&...
2018-03-09 15:24:59 992 1
原创 [DP]91. Decode Ways
问题描述:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded message containing digits, determine the to...
2018-02-11 10:41:04 133
原创 [DP]64. Minimum Path Sum
题目描述: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or
2018-02-02 17:27:05 116
原创 [DP]1.two sum
题目描述: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use th
2018-01-29 10:55:11 112
原创 [DP]63. Unique Paths I
题目描述: 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 respectivel
2018-01-29 10:07:48 86
原创 [DP]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
2018-01-27 15:51:09 127
原创 [DP]303. Range Sum Query - Immutable
题目描述 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5)
2018-01-27 10:52:50 130
原创 [DP]198.House Robber
题目描述: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adj
2018-01-26 21:10:28 115
原创 [DP]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 dupli
2018-01-25 00:06:33 116
原创 [DP]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
2018-01-24 23:31:27 99
原创 [DP] 121.Best Time to Buy an 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 t
2018-01-24 16:22:26 119
原创 K-means小记
K-means算法是聚类算法。即给定一个数据集,利用K-means算法可将其分为K类。 算法思想: 随机从数据集中选取k个数据点作为k个分类的质心遍历其余所有数据点,对每个数据点作这样的操作:计算数据点到每个质心的欧式距离,选取距离最小值的质心与其归为一类。这一步完成之后,得到的结果就是初始分类。重新计算每个分类的质心。一般是按维度来计算均值。 对于重新得到的质心,运行第二步
2018-01-23 23:57:40 168
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人