![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法基础
yuncy_lucky
这个作者很懒,什么都没留下…
展开
-
什么是element-wise
element-wise原创 2023-02-21 16:30:29 · 3308 阅读 · 0 评论 -
pip install 太慢
解决办法:在前面添加国内镜像下载使用豆瓣镜像sudo pip install -i https://pypi.douban.com/simple tensorflow附国内镜像:清华:https://pypi.tuna.tsinghua.edu.cn/simple/阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学:http://pypi.原创 2021-03-10 15:22:50 · 105 阅读 · 0 评论 -
git clone 速度过慢
本文属于转载原作者:老菜逼原链接:https://www.jianshu.com/p/fb9848d5418c方法非常简单,什么都不用设置,只需要在链接的 github.com 后插入'.cnpmjs.org',其它不变。 用以下clone的链接做示例:git clone https://github.com/Microsoft/LightGBM# 改为git clone https://github.com.cnpmjs.org/Microsoft/LightGBM有链.转载 2020-12-09 15:19:18 · 228 阅读 · 2 评论 -
优化函数SGD/AdaGrad/AdaDelta/Adam/Nadam
一、准备知识指数加权平均指数加权平均值又称指数加权移动平均值,局部平均值,移动平均值。加权平均这个概念都很熟悉,即根据各个元素所占权重计算平均值。指数加权平均中的指数表示各个元素所占权重呈指数分布。mini-batch梯度下降法在实际应用中,由于样本数量庞大,训练数据上百万是很常见的事。如果每执行一次梯度下降就遍历整个训练样本将会耗费大量的计算机资源。在所有样本中随机抽取一部分(mini-batch)样本,抽取的样本的分布规律与原样本基本相同,事实发现,实际训练中使用mini-bat原创 2020-05-21 19:46:57 · 1607 阅读 · 0 评论 -
bach、bachsize、epoch、iteration傻傻分不清楚
一、简单总结:总样本数 = bach_numbers * bach_sizeiteration_numbers =bach_numbers1个epoch =完成所有的iteration_numbers/bach_numbers二、详细说明:(1)batch_size:每个bach的大小。在深度学习中,一般采用SGD训练,即每次训练在训练集中取batchsize个样本训练;(2)iteration:1个iteration等于使用batch_size个样本训练一次,即使用一个bach的..原创 2020-05-13 15:28:54 · 1130 阅读 · 0 评论 -
xgb调参--简洁版
一、常调参数1、max_depth[默认6]树分裂最大深度,常用3~10之间树越深越容易过拟合(越深模型会学到越具体越局部的样本)树越深也会消耗更多内存且会使得训练时间变长(由于xgb会一直分裂到max_depth指定的值,再回过头来剪枝)2、eta[默认0.3]学习率,常用0.01~0.5之间太大准确率不高、难以收敛(梯度值可能在最优解附近晃荡,不收敛)太小运行速...原创 2020-04-28 21:50:36 · 9063 阅读 · 2 评论 -
两道面试题(括号匹配和数字交换) -- Python
一、括号匹配问题输入包含中括号,圆括号和大括号,判断,括号是否合理输入:s1 = "{[()]}({[]})"s2 = "{{{[[((])))]]]}}}"s3 = ")()({}"输出:YesNoNo思路:采用栈的逻辑,遇到左括号入栈,遇到右括号则判断是否能够匹配的哦对应的额左括号,如果匹配上了,就将匹配的括号出栈,否则输出No,如果全部匹配完成,...原创 2019-11-28 19:24:23 · 264 阅读 · 0 评论 -
nlp资料整理
1. tf-idfhttps://blog.csdn.net/asialee_bird/article/details/814867002. textrankhttps://blog.csdn.net/qq_41664845/article/details/82869596https://blog.csdn.net/laobai1015/article/details/77...原创 2019-11-18 21:42:07 · 194 阅读 · 0 评论 -
什么是NLP
自然语言处理 - 知乎 https://www.zhihu.com/topic/19560026/intro原创 2019-07-05 15:18:40 · 9271 阅读 · 1 评论 -
quick sort (python)
原理:1. 选取第一个元素作为key.设定两个指针,low 和 high.2. low指向第一个元素,high指向最后一个元素.3. low第一个指向的作为key,high判别指向元素是否大于key,若小于,指向元素的值赋给low,low指针再向右移动,同理.最后直到重叠,将key值赋予此位置.4. 经过3,key的左右两边会分成大于key和小于key两部分,再对两部分作同样的操作.直...原创 2019-06-23 23:40:22 · 282 阅读 · 0 评论 -
LeetCode 337. House Robber III
337.House Robber IIIThe thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one par...原创 2019-05-31 11:14:45 · 70 阅读 · 0 评论 -
LeetCode 1025. Divisor Game
1025.Divisor GameAlice and Bob take turns playing a game, with Alice starting first.Initially, there is a numberNon the chalkboard. On each player's turn, that player makes amoveconsisting o...原创 2019-05-30 21:19:46 · 121 阅读 · 0 评论 -
LeetCode Combination Sum
题目https://leetcode.com/problems/combination-sum/Given asetof candidate numbers (candidates)(without duplicates)and a target number (target), find all unique combinations incandidateswhere th...原创 2019-05-07 10:37:18 · 129 阅读 · 0 评论 -
LeetCode 3Sum
题目https://leetcode.com/problems/3sum/15.3SumMedium3647399FavoriteShareGiven an arraynumsofnintegers, are there elementsa,b,cinnumssuch thata+b+c= 0? Find all unique triplets...原创 2019-05-07 10:47:06 · 134 阅读 · 0 评论 -
LeetCode Rotate Array
大佬大发慈悲,出了一个超级简单的题目:Rotate ArrayGiven an array, rotate the array to the right byksteps, wherekis non-negative.Example 1:Input:[1,2,3,4,5,6,7] and k = 3Explanation:rotate 1 steps to the ...原创 2019-05-10 10:50:26 · 102 阅读 · 0 评论 -
LeetCode House Robber II
题目 :213.House Robber IIYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place arearranged in a circle.Th...原创 2019-05-20 11:58:27 · 57 阅读 · 0 评论 -
LeetCode Hamming Distance
题目:Hamming DistanceTheHamming distancebetween two integers is the number of positions at which the corresponding bits are different.Given two integersxandy, calculate the Hamming distance....原创 2019-05-15 14:59:30 · 146 阅读 · 0 评论 -
LeetCode Counting Bits
题目Counting BitsGiven a non negative integer numbernum. For every numbersiin the range0 ≤ i ≤ numcalculate the number of 1's in their binary representation and return them as an array.Exampl...原创 2019-05-16 18:10:34 · 95 阅读 · 0 评论 -
LeetCode Median of Two Sorted Arrays
题目:Median of Two Sorted ArraysThere are two sorted arraysnums1andnums2of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (...原创 2019-05-18 11:20:04 · 79 阅读 · 0 评论 -
LeetCode 递归:Maximum Depth of Binary Tree/Merge Two Binary Trees
题目:Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Not...原创 2019-05-18 11:22:25 · 61 阅读 · 0 评论 -
LeetCode Find First and Last Position of Element in Sorted Array
题目:34.Find First and Last Position of Element in Sorted ArrayGiven an array of integersnumssorted in ascending order, find the starting and ending position of a giventargetvalue.Your algori...原创 2019-05-18 11:27:23 · 71 阅读 · 0 评论 -
LeetCode 动态规划Climbing Stairs/House Robber/Decode Ways
题目1:Climbing StairsYou are climbing a stair case. It takesnsteps 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:Giv...原创 2019-05-14 10:09:17 · 148 阅读 · 0 评论