- 博客(38)
- 资源 (4)
- 收藏
- 关注
原创 数据并行(DP)、张量模型并行(TP)、流水线并行(PP)
数据集分为n块,每块随机分配到m个设备(worker)中,相当于m个batch并行训练n/m轮,模型也被复制为n块,每块模型均在每块数据上进行训练,各自完成前向和后向的计算得到梯度,更新后,再传回各个worker。以确保每个worker具有相同的模型参数。下图1:每个设备分1份数据下图2:每个设备分4份数据数据不切分的话,就是总共N-1次传输中每次传输数据大小为O(O是模型参数量),数据流转完整一圈仍然需要(N-1)*O的时间,传统参数服务器的总时间没区别了。
2023-08-23 18:07:15
32747
5
原创 本地pdf paper用Chrome浏览器打开并翻译
3. 用chrome打开下载下来的html,双击或顶部“翻译成中文”, 就可以把网页翻译成中文。2. pdf转html:找一个 pdf to html的在线网站 , 比如。, 将pdf转为html,下载该html。1. 准备本地 pdf。
2023-05-31 19:33:36
944
原创 鹏程·盘古
鹏程·盘古模型基于 1.1 TB 高质量中文训练数据,采用全场景人工智能计算框架 MindSpore 自动并行技术实现了五维并行训练策略,从而可将训练任务高效扩展到 4 096 个处理器上。对比实验表明,在少样本或零样本情况下,鹏程·盘古模型在多个中文自然语言理解或生成任务上都具有较优的性能。
2023-04-26 18:18:10
864
2
原创 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
136
转载 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
278
2
原创 union 和 union all
1. 上结论union : 不仅会表间去重,还会表内去重union all :不去重2. 实验2.1 建表Create table adst.hyy_test1(name string ); Create table adst.hyy_test2 (name string) ;2.2 插入数据insert into adst.hyy_test1 values('hyy');insert into adst.hyy_test1 values('hyy');i
2020-07-14 17:07:39
162
原创 clickhouse基础
1、什么是clickhouse?https://clickhouse.tech/docs/zh/2、ClickHouse的特性https://clickhouse.tech/docs/zh/introduction/distinctive-features/3、教程https://clickhouse.tech/docs/zh/getting-started/tutorial/
2020-06-03 18:52:53
180
原创 clickhouse 踩坑指南
1. clickhouse修改字段类型当别人往表中插入数据,也就是对字段进行操作时,是不能修改字段类型的此时若要修改字段类型,需要先drop掉该字段,再进行add,如果单纯使用modify是不会修改成功的。????:原始 col1 类型是 string,此时若要修改为int32:alter tablebase.table ON CLUSTER *** modify column col1 Int32;but:如果此列一直在进行被修改,比如插入数据,则会报错:Exception
2020-06-03 18:34:28
3407
原创 优化函数SGD/AdaGrad/AdaDelta/Adam/Nadam
一、准备知识指数加权平均指数加权平均值又称指数加权移动平均值,局部平均值,移动平均值。加权平均这个概念都很熟悉,即根据各个元素所占权重计算平均值。指数加权平均中的指数表示各个元素所占权重呈指数分布。mini-batch梯度下降法在实际应用中,由于样本数量庞大,训练数据上百万是很常见的事。如果每执行一次梯度下降就遍历整个训练样本将会耗费大量的计算机资源。在所有样本中随机抽取一部分(mini-batch)样本,抽取的样本的分布规律与原样本基本相同,事实发现,实际训练中使用mini-bat
2020-05-21 19:46:57
1787
原创 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
1354
原创 hadoop fs -cp
hadoop fs -cp若目的目录存在,则追加cp的数据,若不存在,则创建目录并写入cp的数据如果要copy,建议:hadoop fs -rm -r ${dir_a} && hadoop fs -cp ${dir_b} ${dir_a}...
2020-05-06 16:34:14
5147
原创 xgb调参--简洁版
一、常调参数1、max_depth[默认6]树分裂最大深度,常用3~10之间树越深越容易过拟合(越深模型会学到越具体越局部的样本)树越深也会消耗更多内存且会使得训练时间变长(由于xgb会一直分裂到max_depth指定的值,再回过头来剪枝)2、eta[默认0.3]学习率,常用0.01~0.5之间太大准确率不高、难以收敛(梯度值可能在最优解附近晃荡,不收敛)太小运行速...
2020-04-28 21:50:36
9905
3
原创 两道面试题(括号匹配和数字交换) -- Python
一、括号匹配问题输入包含中括号,圆括号和大括号,判断,括号是否合理输入:s1 = "{[()]}({[]})"s2 = "{{{[[((])))]]]}}}"s3 = ")()({}"输出:YesNoNo思路:采用栈的逻辑,遇到左括号入栈,遇到右括号则判断是否能够匹配的哦对应的额左括号,如果匹配上了,就将匹配的括号出栈,否则输出No,如果全部匹配完成,...
2019-11-28 19:24:23
302
原创 nlp资料整理
1. tf-idfhttps://blog.youkuaiyun.com/asialee_bird/article/details/814867002. textrankhttps://blog.youkuaiyun.com/qq_41664845/article/details/82869596https://blog.youkuaiyun.com/laobai1015/article/details/77...
2019-11-18 21:42:07
236
原创 愿你
愿你善良 带着锋芒。愿你以梦为马不负韶华。愿你眉眼如初 ,岁月如故。愿你付出甘之如饴,愿你所得归于欢喜。愿你阳光下像个孩子,风雨里像个大人。愿你眼角带笑,月色不染眉梢,枕星河入梦愿你精致到老,眼里长着太阳,笑里全是坦荡。愿你所到之处,遍地阳光;愿你梦的远方,温暖为向。愿你如阳光,明媚不忧伤,愿你如月光,明亮不清冷。愿你所有的努力都不白费,所想的都能如愿,所做的...
2019-08-05 15:58:16
1077
原创 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
323
原创 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
98
原创 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
163
原创 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
82
原创 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
105
原创 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
113
原创 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
106
原创 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
124
翻译 梦
传说,水精灵爱上了太阳神阿波罗,就算明知道自己始终得不到太阳神的爱,却依然无法停止对他的思念。于是,水精灵甘愿化作向日葵,对着太阳的方向日日凝望。我抬头仰望你的天空雨后却没有彩虹空中弥漫的你的微笑依旧让我心动,好心动怎么当年懵懂不懂蜕变的痛万年的仰望已让我词穷眼神却遮不住言不由衷舞台的正中你耀眼的从容我却陷入思念的迷宫水精灵的窘化做向日葵依旧无奈的好痛困...
2019-05-15 18:02:40
147
原创 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
186
原创 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
183
原创 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
126
原创 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
165
原创 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
186
原创 各类机器学习算法原理及优缺点
一、逻辑回归1.1 原理将线性回归的结果通过sigmod函数映射到0到1之间,如果结果越接近0或者1,说明分类结果的可信度越高,对于线性不可分的数据,可以对非线性函数进行线性加权,得到一个不是超平面的分割面。在进行分类时,通过比较上面两式的大小来将输入实例分配到概率值大的那一类。本质上是线性函数1.2 目标函数: 交叉熵损失函数/负对数似然函数...
2019-04-23 21:41:22
2868
转载 scikit-learn交叉验证Cross Validation and Grid Search
引自:http://hisarack.logdown.com/posts/304896-scikit-learn%E5%AF%A6%E4%BD%9C-cross-validation-and-grid-search實際上在跑驗證時,我們會希望train資料集越大越好,讓model可以學習到更正 確的參數.但是train資料集越大同樣表示我們可以用來做驗證的資料(testing)越少.
2016-08-09 15:36:16
1515
原创 windows平台安装mysql-5.7.14-winx64
出自:详情请参考博文:http://blog.youkuaiyun.com/yhl_jxy/article/details/52101441特别提醒,如果出现D:\mysql\mysql-5.7.14-winx64\bin>mysqld installThe service already exists!The current server installed: D:\my
2016-08-08 15:54:20
587
原创 纠结的凸包算法程序
很典型的凸包问题。我一开始想繁了,因为我想如果是个凹多边形,可能最终的围墙也可能是凹的,后来想起题中的要求是最小的长度,而凹的围墙虽然离castle距离精确的等于r,可是长度并不是最小的,只有凸包的长度才是最小的。因此问题就简单很多,先求凸包,再求所有边的长度和,最后加上一个2*PI*r,这是所有凸包点处的弧的长度和。题目描述:有一个多边形,要在其外围包裹一个多边形,多边形的顶点距离外
2012-04-13 16:29:07
274
原创 凸包算法求凸包点
#include #include #include using namespace std ;struct Point{int x ;int y ;int flag ; //flag标记该点是否在P0与其他点连线的内部,flag=0表示在内部}list[500];int stack[500], top ;void swap(Point
2012-04-13 15:20:14
970
原创 实现两个大数相乘
#include #include #define MAX 201using namespace std;int result[MAX], result1[MAX] ;void Pow(int n, int *result1, int *r, int len1){int len2, i, j, k ;len2 = len1 ;for(k = 1; k
2012-04-13 15:11:18
259
tensorflow构建图像多标签分类器入门文件
2018-12-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人