- 博客(6)
- 收藏
- 关注
原创 Linux Vim 随用随学随记录
一般模式:复制: yy光标向上: k,10k(向上10行)光标向下: j,10j (向下10行)光标向左: h,5h (向前5行)光标向右: l, 5l (向后5行)向下翻半页: ctrl + d (ctrl + down)向上翻半页: ctrl + u (ctrl + up)整页上翻: ctrl + d (ctrl + down)向上翻半页: ctrl ...
2019-06-20 21:02:39
119
转载 机器学习 - SVM 和 softmax损失函数求导
SVM:https://www.jianshu.com/p/6340c6f090e9def svm_loss_vectorized(W, X, Y, reg): """ :param X: 200 X 3073 :param Y: 200 :param W: 3073 X 10 :return: reg: 正则化损失系数(无法通过拍脑袋设定,需要多试几个...
2019-05-07 16:47:30
493
原创 Lintcode 127. Topological Sorting (Medium) Python
题目:https://www.lintcode.com/problem/topological-sorting/description思路:拓扑排序1.统计所有点的入度2.将入度为0的加入队列3.bfs"""Definition for a Directed graph nodeclass DirectedGraphNode: def __init__(self, x): ...
2019-04-23 21:45:33
299
原创 Lintcode 615. Course Schedule (Medium) Python
题目:https://www.lintcode.com/problem/course-schedule/description思路:indgree = [[0,[]] for i in range(numCourses)]建立一个indegree数组,记录**[需要修的优先课程数,[是哪些科目的条件]]**class Solution: """ @param: numCours...
2019-04-23 16:06:27
152
原创 Lintcode 573. Build Post Office II (Hard) Python
题目:https://www.lintcode.com/problem/build-post-office-ii/description思路:1.使用bfs从每个house1遍历到所有的empty0。2.使用self.status记录grid的每个empty位置的两个状态:1)其他所有house1到此位置的距离和;2)可以达到此位置的house数量;3.nums记录数组中house的个...
2019-04-22 22:50:37
181
原创 Lintcode 433. Number of Islands(Easy) Python
思想:使用 bfs 搜索整个二维数组grid ,建立一个二维状态数组self.result记录此位置是否已经访问。尽可能多定义函数实现略复杂的功能 ,以保证主函数的逻辑清晰。(仅通过94%cases)class Solution: """ @param grid: a boolean 2D matrix @return: an integer """ de...
2019-04-22 20:11:05
144
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人