01 2019 档案

摘要:摘要: tf.name_scope()和tf.variable_scope()是两个作用域,一般与两个创建/调用变量的函数tf.variable() 和tf.get_variable()搭配使用。它们搭配在一起的两个常见用途:1)变量共享,2)tensorboard画流程图时为了可视化封装变量,这两 阅读全文
posted @ 2019-01-18 10:28 bernieloveslife 阅读(466) 评论(0) 推荐(0)
摘要:(a) 求解预测词向量 Vc的所对应的梯度。 Answer: 在Q2的(b)中,我们已经得到了softmax关于输入向量的梯度=y_hat y 所以本题的结果为 其中U=[μ1,μ2,…,μW]是全体输出向量形成的矩阵 即 (b) 求解输出词向量μw的梯度(包括μo在内) Answer: 类似于上题 阅读全文
posted @ 2019-01-16 21:52 bernieloveslife 阅读(554) 评论(0) 推荐(0)
摘要:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2019-01-14 16:00 bernieloveslife 阅读(122) 评论(0) 推荐(0)
摘要:You are standing at position 0 on an infinite number line. There is a goal at position target. On each move, you can either go left or right. During t 阅读全文
posted @ 2019-01-13 16:55 bernieloveslife 阅读(151) 评论(0) 推荐(0)
摘要:Write a SQL query to get the second highest salary from the Employee table. For example, given the above Employee table, the query should return 200 a 阅读全文
posted @ 2019-01-13 16:34 bernieloveslife 阅读(107) 评论(0) 推荐(0)
摘要:Table: Person Table: Address Write a SQL query for a report that provides the following information for each person in the Person table, regardless if 阅读全文
posted @ 2019-01-13 16:33 bernieloveslife 阅读(101) 评论(0) 推荐(0)
摘要:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. For example, aft 阅读全文
posted @ 2019-01-13 16:30 bernieloveslife 阅读(126) 评论(0) 推荐(0)
摘要:Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers. You may 阅读全文
posted @ 2019-01-13 16:25 bernieloveslife 阅读(127) 评论(0) 推荐(0)
摘要:Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return 1. For 阅读全文
posted @ 2019-01-09 17:34 bernieloveslife 阅读(103) 评论(0) 推荐(0)
摘要:Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4 2 1 3 Output: 1 2 3 4 Example 2: Input: 1 5 3 4 0 Output: 1 阅读全文
posted @ 2019-01-09 17:12 bernieloveslife 阅读(103) 评论(0) 推荐(0)
摘要:Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially contains only the first elem 阅读全文
posted @ 2019-01-09 16:57 bernieloveslife 阅读(107) 评论(0) 推荐(0)
摘要:Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses. Now, you are given p 阅读全文
posted @ 2019-01-09 16:14 bernieloveslife 阅读(175) 评论(0) 推荐(0)
摘要:(a) 推导sigmoid的导数公式 y = 1/(1+exp( x)) Answer: y' = y (1 y) sigmoid的导数形式是十分简洁的,这也是sigmoid函数使用广泛的一个原因。 (b) 当使用交叉熵作为loss function时,推导其梯度公式,输入的y是一个one hot向 阅读全文
posted @ 2019-01-08 18:39 bernieloveslife 阅读(309) 评论(0) 推荐(0)
摘要:(a) theory 证明对于任意输入向量x和常数c,softmax的输出不会随着c的改变而改变,即softmax(x) = softmax(x+c) note:在实际使用中,经常利用这个性质,将每个元素x减去最大的那个元素,即最大值为0. 证明:利用softmax的公式分别将两边展开计算即可。 ( 阅读全文
posted @ 2019-01-08 18:36 bernieloveslife 阅读(183) 评论(0) 推荐(0)
摘要:Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in A so that the result equals B. Example 1: Exampl 阅读全文
posted @ 2019-01-08 18:11 bernieloveslife 阅读(137) 评论(0) 推荐(0)
摘要:A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as follows: graph[a] is a list of all n 阅读全文
posted @ 2019-01-08 14:47 bernieloveslife 阅读(260) 评论(0) 推荐(0)
摘要:Given an array of characters, compress it in place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2019-01-07 21:42 bernieloveslife 阅读(103) 评论(0) 推荐(0)
摘要:Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Sil 阅读全文
posted @ 2019-01-07 21:21 bernieloveslife 阅读(92) 评论(0) 推荐(0)
摘要:Some people will make friend requests. The list of their ages is given and ages[i] is the age of the ith person. Person A will NOT friend request pers 阅读全文
posted @ 2019-01-07 21:05 bernieloveslife 阅读(169) 评论(0) 推荐(0)
摘要:Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals 阅读全文
posted @ 2019-01-07 19:43 bernieloveslife 阅读(109) 评论(0) 推荐(0)
摘要:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Example 2: 很蠢得用了模拟法。。 阅读全文
posted @ 2019-01-07 18:13 bernieloveslife 阅读(110) 评论(0) 推荐(0)
摘要:Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t 阅读全文
posted @ 2019-01-07 17:05 bernieloveslife 阅读(154) 评论(0) 推荐(0)
摘要:Find the sum of all left leaves in a given binary tree. 阅读全文
posted @ 2019-01-07 16:58 bernieloveslife 阅读(120) 评论(0) 推荐(0)
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2019-01-07 16:28 bernieloveslife 阅读(127) 评论(0) 推荐(0)
摘要:LeakyReLU Random Noise Discriminator Architecture: Fully connected layer with input size 784 and output size 256 LeakyReLU with alpha 0.01 Fully conne 阅读全文
posted @ 2019-01-05 15:25 bernieloveslife 阅读(1429) 评论(0) 推荐(0)
摘要:""Image Style Transfer Using Convolutional Neural Networks" (Gatys et al., CVPR 2015)" . 复现这一篇论文中的代码 loss由三部分组成,内容loss,风格loss,正则化loss,其中风格loss使用gram矩阵 阅读全文
posted @ 2019-01-05 14:05 bernieloveslife 阅读(1108) 评论(0) 推荐(0)
摘要:Saliency Maps 一张saliency map告诉了我们在图片中的每个像素点对于这张图片最后的预测得分的影响程度。为了计算它,我们要计算正确的那个类的未归一化的打分对于图片中每个像素点的梯度。如果图片的尺寸是(H,W,3),那么梯度的尺寸也应该是(H,W,3);对于图片中的每个像素点,梯度 阅读全文
posted @ 2019-01-05 12:45 bernieloveslife 阅读(2334) 评论(0) 推荐(0)
摘要:跟作业1很类似,区别只是在于每个单元的公式不一样 前向过程 next_h error: 5.7054131967097955e 09 next_c error: 5.8143123088804145e 09 后向过程 dx error: 6.335163002532046e 10 dh error: 阅读全文
posted @ 2019-01-04 21:25 bernieloveslife 阅读(803) 评论(0) 推荐(0)
摘要:来到最后一个作业,前两个作业仍然是使用numpy来实现一个rnn/lstm网络,后边三个作业则用到了tensorflow/pytorch,目前只用了tensorflow来完成,以后或许会把pytorch的也完成了。 前言 第一个任务是使用rnn来完成图像标注的任务。image caption是rnn 阅读全文
posted @ 2019-01-04 17:22 bernieloveslife 阅读(1188) 评论(0) 推荐(0)
摘要:已知x1,x2,x3,y 根据y = a a x1 + b b x2 + a b x3 预测参数a和b Output: 0 [0.16722116] [0.4231345] 0.287351 20 [0.46662363] [0.81065917] 0.00041220474 40 [0.51124 阅读全文
posted @ 2019-01-03 18:40 bernieloveslife 阅读(1011) 评论(0) 推荐(0)