自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

千寻的博客

相互学习

  • 博客(159)
  • 收藏
  • 关注

原创 NLP数据增强;中文数据增强包;一键中文数据增强

NLP Chinese Data Augmentation 一键中文数据增强工具介绍一键中文数据增强工具,支持:随机实体替换近义词近义近音字替换随机字删除在不改变原文的情况下生成指定数量的训练语料文本Email:[email protected]随机【(等价)实体】替换from nlpcda.tools.randomword import Randomword...

2020-03-08 11:56:46 6822 19

原创 ML-集成学习:AdaBoost、Bagging、随机森林、Stacking(mlxtend)、GBDT、XGBoost、LightGBM、CatBoost原理推导及实现

目录1.名称简介2.设计集成原则3.集成学习算法分类4.Boosting4.1基本流程4.2Adaboost实现4.2.1.分类4.2.2.回归4.2.3Adaboost的正则化4.2.4Adaboost小结5.Bagging5.1基本流程6.随机深林Random Forest6.1基本流程7.Stacking8.GBDT8.1...

2019-02-26 17:17:22 6641 4

原创 scipy.optimize优化器的各种使用

目录0.scipy.optimize.minimize1.无约束最小化多元标量函数1.1Nelder-Mead(单纯形法) 1.2拟牛顿法:BFGS算法1.3牛顿 - 共轭梯度法:Newton-CG2 约束最小化多元标量函数2.1SLSQP(Sequential Least SQuares Programming optimization algorithm) 2....

2019-02-22 22:33:53 49609 7

原创 WoBERT Pytorch使用

pytorch实现的WoBERT+ 新闻多分类样例代码:https://github.com/425776024/WoBERT1.安装依赖pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt2.WoBERT模型下载方式1.从https://github.com/ZhuiyiTechnology/WoBERT下载keras模型,然后执行转换变成pytorch的模型...

2021-02-15 20:20:21 1518 5

原创 LOTClass中文使用

LOTClass 的中文实验、学习、应用。提供中文新闻多分类案例和数据原始论文完全不适合于中文,因为中文BERT目前大都是基于字的,因此不能直接换BERT来拿来主义的套用到中文BERT。 好在有追一科技提出了词汇级BERT,WoBERT,不过是keras的,不适合Pytorch,于是自己训练了一个:WoBERT。 最后稍微自定义了BERT中的分词器,实现了中文版的LOTClass:https://github.com/425776024/LOTClass...

2021-02-15 20:17:11 878

原创 python算法-2整形数组-1Leetcode 027 Remove

python算法-2整形数组-1Leetcode 027 Remove Element在线运行:https://pyleetcode.gitee.io/codes_html/Leetcode_027_Remove_Element.htmlclass Solution: def call(self, arr, elem): i = 0 j = 0 while i < len(arr): # 如果相当则..

2020-07-19 21:56:05 261

原创 python算法-1字符串-10数数Leetcode 038 Count and Say

python算法-1字符串-10数数Leetcode 038 Count and Say在线运行:https://pyleetcode.gitee.io/codes_html/Leetcode_038_Count_and_Say.htmldef countAndSay(n): if n == 0: return '' res = '3' while n != 0: n -= 1 i = 0 cou..

2020-07-19 21:55:04 217

原创 python算法-1字符串-9 Leetcode 044Wildcard_Matching

python算法-1字符串-9 Leetcode 044Wildcard在线运行:https://pyleetcode.gitee.io/codes_html/Leetcode_044_4Wildcard_Matching.htmldef isMatch2( s, p): s = '0' + s p = '0' + p # dp[i][j]表示:s的前i个字符与p的前j个字符是否匹配 dp = [[False for _ in range(len(p)..

2020-07-19 21:52:43 165

原创 python算法-1字符串-8空格替换

python算法-1字符串-8空格替换def replaceBlank(str, length): s = '' for i in range(length): if str[i] == ' ': str[i] = '%20' s += str[i] return sif __name__ == '__main__': str = "Mr John Smith" str = list(str).

2020-07-19 21:51:45 235

原创 python算法-1字符串-7最长回文子串Leetcode_005_Longest_Palindromic_Substring

python算法-1字符串-7最长回文子串Leetcode在线运行:https://pyleetcode.gitee.io/codes_html/Leetcode_005_Longest_Palindromic_Substring.html# 1穷举class Solution: def str(self, s): if not s: return '' n = len(s) logest, left,..

2020-07-19 21:50:41 171

原创 python算法-1字符串-6回文串判断Leetcode_125_Valid_Palindrom

python算法-1字符串-6回文串判断Leetcode在线运行:https://pyleetcode.gitee.io/codes_html/Leetcode_125_Valid_Palindrome.htmlclass Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ alnum_s = [t.

2020-07-19 21:49:14 166

原创 python算法-1字符串-5翻转单词

python算法-1字符串-5翻转单词在线运行:https://pyleetcode.gitee.io/codes_html/SYL_1%E5%AD%97%E7%AC%A6%E4%B8%B2_4%E7%BF%BB%E8%BD%AC%E5%8D%95%E8%AF%8D.htmlclass Solution: def str(self, s): if len(s) == 0: return '' temp = [] ..

2020-07-19 21:47:51 199

原创 python算法-1字符串-4 Leetcode 1143 Longest Common

python算法-1字符串-4 Leetcode 1143 Longest Common Subsequence最长公共子序列在线运行:https://pyleetcode.gitee.io/codes_html/Leetcode_1143_Longest_Common_Subsequence.htmldef printflsc(x, y): global flag, string1, string2, s # 回溯输出最长公共子序列 if x == 0 ..

2020-07-19 21:46:49 187

原创 python算法-1字符串-4Longest Common Substring最长公共子串

python算法-1字符串-4Longest Common Substring最长公共子串在线运行:https://pyleetcode.gitee.io/codes_html/SYL_1%E5%AD%97%E7%AC%A6%E4%B8%B2_10Longest%20Common%20Substring.htmldef LCstring(string1, string2): len1 = len(string1) len2 = len(string2) r..

2020-07-19 21:45:18 279

原创 python算法-1字符串-3字符串是否是子集

python算法-1字符串-3字符串是否是子集在线运行:https://pyleetcode.gitee.io/codes_html/SYL_1%E5%AD%97%E7%AC%A6%E4%B8%B2_3%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E6%98%AF%E5%AD%90%E9%9B%86.htmlimport collectionsclass Solution: def compare_strings(self,..

2020-07-19 21:43:02 247

原创 python算法-1字符串-2判断是否同一个字符串

python算法-1字符串-2判断是否同一个字符串python算法-1字符串-2判断是否同一个字符串在线运行:https://pyleetcode.gitee.io/codes_html/SYL_1%E5%AD%97%E7%AC%A6%E4%B8%B2_2%E6%98%AF%E5%90%A6%E5%90%8C%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2.htmlimport collectionsclass Solution: .

2020-07-09 09:20:18 724

原创 python算法-1字符串-1.查找(Leetcode 28 Implement strStr)

python算法-1字符串-1.查找(Leetcode 28 Implement strStr)python算法-1字符串-1.查找(Leetcode 28 Implement strStr)在线运行:https://pyleetcode.gitee.io/codes_html/Leetcode_028_Implement_strStr.htmlclass Solution: def strStr(self, source, target): if sou..

2020-07-09 09:18:08 142

原创 python算法-0排序-7堆排序

python算法-0排序-7堆排序python算法-0排序-7堆排序在线运行:https://pyleetcode.gitee.io/codes_html/SYL_0%E6%8E%92%E5%BA%8F_7%E5%A0%86%E6%8E%92%E5%BA%8F.htmldef sort(array): # 遍历非叶子节点,建立堆结构数组 for i in range(int(len(array) / 2) - 1, -1, -1): adjustHeap.

2020-07-09 09:15:47 205 1

原创 python算法-0排序-6归并排序

python算法-0排序-6归并排序python算法-0排序-6归并排序在线运行:https://pyleetcode.gitee.io/codes_html/SYL_0%E6%8E%92%E5%BA%8F_6%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F.htmldef merge(a, b): c = [] h = j = 0 while j < len(a) and h < len(b): # 谁小插入.

2020-07-09 09:14:45 189 1

原创 python算法-0排序-5.快速排序

python算法-0排序-5.快速排序python算法-0排序-5.快速排序在线运行:https://pyleetcode.gitee.io/codes_html/SYL_0%E6%8E%92%E5%BA%8F_5%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F.htmldef Partion(arr, left, right): # 一次对比操作,返回中间索引(索引前面比他小,后面比他大) tag = right # 作为判断点,一...

2020-07-09 09:13:21 172

原创 python算法-0排序-4.希尔排序

python算法-0排序-4.希尔排序python算法-0排序-4.希尔排序在线运行:https://pyleetcode.gitee.io/codes_html/SYL_0%E6%8E%92%E5%BA%8F_4%E5%B8%8C%E5%B0%94%E6%8E%92%E5%BA%8F.htmldef shell(data): size = len(data) # 最初,一半长度的跳跃对比 jmp = size // 2 while jmp != ..

2020-07-09 09:12:16 125

原创 python算法-0排序-3.插入排序

python算法-0排序-3.插入排序python算法-0排序-3.插入排序在线运行:https://pyleetcode.gitee.io/codes_html/SYL_0%E6%8E%92%E5%BA%8F_3%E6%8F%92%E5%85%A5%E6%8E%92%E5%BA%8F.html# 插入排序,o(n^2)def Sort(arr): n = len(arr) for i in range(1, n): # 第一个数直接进入数组 ..

2020-07-09 09:10:56 131

原创 python算法-0排序-2冒泡排序

python算法-0排序-2冒泡排序python算法-0排序-2冒泡排序https://www.bilibili.com/video/BV11v411B7Eyhttps://pyleetcode.gitee.io/codes_html/SYL_0%E6%8E%92%E5%BA%8F_2%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F.htmldef Sort(arr): for i in range(len(arr)): for..

2020-07-09 09:07:52 146

原创 python算法-0排序-1选择排序

<iframe src="//player.bilibili.com/player.html?aid=371135586&bvid=BV1wZ4y1p7Fe&cid=207954024&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

2020-07-09 09:03:55 182

原创 3.1paddlepaddle数字识别,多层感知机(MLP)、卷积神经网络(CNN)

识别黑白图片中的数字使用MNIST数据集X是输入:MNIST图片是28×28 的二维图像,为了进行计算,我们将其转化为784维向量,即X=(x0,x1,…,x783)X=\left ( x_0, x_1, \dots, x_{783} \right )X=(x0​,x1​,…,x783​)Y是输出:分类器的输出是10类数字(0-9),即Y=(y0,y1,…,y9)Y=(y_0,y_1...

2019-12-11 17:45:20 1333 1

原创 3.0BuildStrategy、CompiledProgram并行计算

BuildStrategyfluid.BuildStrategy:https://www.paddlepaddle.org.cn/documentation/docs/zh/api_cn/fluid_cn/BuildStrategy_cn.html计算图的建造方法import numpy as npimport paddle.fluid as fluidimport os# 设置使用...

2019-12-11 16:18:05 302

原创 2.9数据-paddlepaddle数据集wmt16

英德翻译数据https://www.paddlepaddle.org.cn/documentation/docs/zh/api_cn/data/dataset_cn/wmt14_cn.htmlpaddle.dataset.wmt16:https://www.paddlepaddle.org.cn/documentation/docs/zh/api_cn/data/dataset_cn/wmt...

2019-12-11 15:54:06 1174

原创 2.8数据-paddlepaddle数据集uci_housing

UCI Housing数据集该模块将从 https://archive.ics.uci.edu/ml/machine-learning-databases/housing/ 下载数据集,并将训练集和测试集解析为paddle reader creatorpaddle.dataset.uci_housing:https://www.paddlepaddle.org.cn/documentatio...

2019-12-11 15:38:22 1562

原创 2.7数据-paddlepaddle数据集sentiment

由NLTK提供的movie_reviews数据集可能会报错:Resource movie_reviews not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download('movie_reviews') Fo...

2019-12-11 15:19:29 609

原创 2.6数据-paddlepaddle数据集movielens

Movielens 1-M数据集Movielens 1-M数据集是由GroupLens Research采集的6000个用户对4000个电影的的100万个评级。 该模块将从 http://files.grouplens.org/datasets/movielens/ml-1m.zip 下载Movielens 1-M数据集,并将训练集和测试集解析为paddle reader creator。p...

2019-12-11 15:03:26 286

原创 2.5数据-paddlepaddle数据集imikolov

imikolov的简化版数据集此模块将从 http://www.fit.vutbr.cz/~imikolov/rnnlm/ 下载数据集,并将训练集和测试集解析为paddle reader creatorpaddle.dataset.imikolov:https://www.paddlepaddle.org.cn/documentation/docs/zh/api_cn/data/datase...

2019-12-11 14:56:59 406

原创 2.4数据-paddlepaddle数据集imdb

IMDB数据集此模块将从 http://ai.stanford.edu/%7Eamaas/data/sentiment/aclImdb_v1.tar.gz 下载数据集。这个数据集包含了25000条训练用电影评论数据,25000条测试用评论数据,且这些评论带有明显情感倾向负面评论的得分小于等于4,正面评论的得分大于等于7,满分10分label:0/1paddle.dataset.im...

2019-12-11 12:36:39 676

原创 2.3数据-paddlepaddle数据集Conll05

语义角色标注数据集Conll05语义角色标注数据集,因为Conll05数据集不是免费公开的,所以默认下载的url是Conll05的测试集(它是公开的)它返回一个reader creator,reader中的每个样本都有九个特征包括句子序列、谓词、谓词上下文、谓词上下文标记和标记序列https://www.paddlepaddle.org.cn/documentation/docs/zh...

2019-12-11 12:28:50 626

原创 2.2数据-paddlepaddle数据集cifar

图像分类数据集CIFAR此模块将从 https://www.cs.toronto.edu/~kriz/cifar.html 下载数据集,并将训练集和测试集解析为paddle reader creator。cifar-10数据集由10个类别的60000张32x32彩色图像组成,每个类别6000张图像。共有5万张训练图像,1万张测试图像cifar-100数据集与cifar-10类似,只是它有1...

2019-12-11 12:06:29 620

原创 2.1数据-paddlepaddle数据集mnist

会一步一步剖析这个怎么使用,抛砖引玉官网API:https://www.paddlepaddle.org.cn/documentation/docs/zh/api_cn/data/dataset_cn/mnist_cn.htmlMNIST数据集。(手写数字图像)会自动从 http://yann.lecun.com/exdb/mnist/ 下载数据集将训练集和测试集解析为paddle re...

2019-12-11 11:09:24 854

原创 1.2基础-paddlepaddle线性回归

一个简单的paddlepaddle线性回归预测、模型保存、模型加载及使用的过程.全连接神经网络,fluid.layers.fc:https://www.paddlepaddle.org.cn/documentation/docs/zh/api_cn/layers_cn/fc_cn.html#fc平方误差,fluid.layers.square_error_cost:https://www....

2019-12-10 21:56:42 277

原创 1.1基础-paddlepaddle变量

两个常量a,b,可以看作一个占位,最终需要喂给这个占位数据,要做的是定义这个占位的数据类型,名称通过创建最终numpy数据,设置feed={‘a’: a1, ‘b’: b1},把a1,b1喂给了a,b两个占位fetch_list=[a, b, y]则返回这三个操作的数据回来fluid.layers.create_tensor:https://www.paddlepaddle.org.c...

2019-12-10 21:07:28 650

原创 0.paddlepaddle安装

假设已经知道、安装了anaconda可以给conda配置一下国内的访问地址对于国内用户无法连接到Anaconda官方源的可以按照以下命令添加清华源进行安装。conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --add channels htt...

2019-12-10 20:51:57 387

原创 1.0基础-paddlepaddle常量

一个最基本的paddlepaddle程序执行过程,对两个常量进行加法算子操作:import paddle.fluid as fluid#定义2个常量x1 = fluid.layers.fill_constant(shape=[2, 2], value=3, dtype='int64')x2 = fluid.layers.fill_constant(shape=[2, 2], value=...

2019-12-10 20:32:08 363

转载 MySQL学习

1.数据类型1.1数值类型 大小 范围(有符号) 范围(无符号) 用途 TINYINT 1 字节 (-128,127) (0,255) 小整数值 SMALLINT 2 字节 (-32 768,32 767) (0,65 535) 大整数值 MEDIUMINT 3 字节 (-8 388 608,8...

2019-06-07 17:39:18 756

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除