自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(65)
  • 资源 (6)
  • 收藏
  • 关注

原创 解决启动jupyter lab/notebook时,报错“ValueError: signal only works in main thread”问题

问题描述:在启动jupyter lab(jupyter notebook同)后,无法在cell中执行代码,显示in[*]。通过控制台,可看到如下报错:RuntimeError: This event loop is already running...ValueError: signal only works in main threadERROR:tornado.general:Uncaught exception in zmqstream callback...问题原因:

2021-11-05 16:26:39 1626

原创 Ubuntu环境下完美解决‘ pip is being invoked by an old script wrapper. ...‘问题

当我们使用pip需要更新时,会提示如下警告:You are using pip version 9.0.1, however version 19.2.3 is available.You should consider upgrading via the 'python -m pip install --upgrade pip' command.然而,使用提示的命令更新pip之后,每次安装模块时,会提示:WARNING: pip is being invoked by a...

2021-10-29 16:59:20 5264

原创 使用SecureCRT在客户端与服务端之间传输大文件

一、问题使用SecureCRT时,可以通过sz命令与rz命令进行文件的上传与下载,但当文件的大小超过4G时,则会报错,如下图。为了解决此问题,可以通过SecureCRT自带的SFTP解决。二、解决方案SFTP,即SSH File Transfer Protocol,或者也被称为Secure File Transfer Protocol,是经过SSH封装过的FTP协议。在SecureCRT已成功建立的session中,使用快捷键Alt+P,可以打开SFTP会话。SFTP的用法...

2021-07-16 15:08:12 1127

原创 docker学习笔记

目录一、环境搭建1. Vmware搭建ubuntu环境。(1)Vmware下载地址:非商用版本(2) 遇见的问题汇总一、环境搭建1. Vmware搭建ubuntu环境(1)Vmware下载下载地址:非商用版本(2) 遇见的问题汇总问题1:如何将英文系统修改成中文系统? 参考链接:ubuntu设置系统语言为中文问题2:如何将中文默认文件名重新修改为英文? 若在修改中文系统时将默认文件名改为中文吗,则在终...

2021-07-14 16:54:03 133

原创 Bert总结

RNNattentionself-attentionself-attention1scaled由维度增加导致的距离增大Additive Attention 和 Dot-product AttentionTransformermulti-headquery,用来和其他每个key vector进行交互,得到当前vector和其他vector的关联性,或者我们说的weights,用于计算自己的output key,用来和其他query vector进行交互, 帮助其他vector..

2020-11-05 19:28:47 697

原创 Keras实现CRF中一些难点理解

苏建林大神的文章对keras实现CRF有了详细的介绍,可以自行了解,详细地址。本文只是记录自己在了解算法细节时遇到的难点。计算路径的未规范化条件概率(相对概率)。相对概率包含两部分,状态特征得分(概率图点得分)和转移特征得分(概率图边得分),具体可以看大神文章的定义。状态特征得分:CRF相当于带有可训练参数(转移矩阵)的Loss层,使用网络的各神经元的输出作为结点的得分。转移特征得分:相邻两个时刻的转移得分即对应的真实标签在转移矩阵中的值。图中代码为bert4keras中...

2020-11-01 16:53:25 871 1

原创 Keras中Mask的传递过程

keras mask流程,base_layer.py看Layer的实现__call__函数:上一层的mask传递到下一层的过程1.support_masking=True当前层的support_masking=True,则说明当前层支持mask。1)调用_collect_previous_mask(inputs)查看输入的mask(即上一层的mask)2)mask作为参数传入call函数3)计算输入的mask,mask为previou_mask注:Dense支持mask,但只传递,并不利用ma

2020-10-05 19:13:33 1365 1

原创 信息熵与损失函数

https://mp.weixin.qq.com/s?__biz=MzU4NTY1NDM3MA==&mid=2247483805&idx=1&sn=2e5f19e084fa71e7f32ae9c1717f948d&chksm=fd860890caf18186adc55c64f3df93f1276f878c3c158c0fdddf219ff73ef662a4cc39d...

2019-11-28 18:08:36 867 1

原创 python中的引用

引用:https://blog.csdn.net/doris2016/article/details/82462841进程见参数共享

2019-11-14 10:22:27 105

原创 使用grakel模块中的最短路径核的报错问题

问题    在使用python的grakel模块的最短路径核进行图核相似度时遇到一下报错: File "/usr/local/lib/python3.6/dist-packages/grakel/graph.py", line 655, in build_shortest_path_matrix dict_fd, _ = dijkstra(se...

2019-11-02 15:56:58 580

原创 线性模型--线性回归、岭(脊)回归、lasso回归

1、线性回归    给定数据集 D={(x1,y1),(x2,y2),...,(xm,ym)}D=\{(x_{1}, y_{1}),(x_{2}, y_{2}),...,(x_{m}, y_{m})\}D={(x1​,y1​),(x2​,y2​),...,(xm​,ym​)},其中xi=(xi1;xi2;...;xid),yi∈Rx_{i}=(x_{i1}...

2019-10-31 19:18:09 739

原创 python:随机生成区分度较高的颜色

1. 生成RPG颜色参考链接import colorsysimport random def get_n_hls_colors(num): hls_colors = [] i = 0 step = 360.0 / num while i < 360: h = i s = 90 + random.random() * 1...

2019-10-12 18:24:14 7245 2

原创 python:多进程池嵌套以及内存管理

前言在使用进程嵌套进行并行调参的过程中,使用了close关闭进程池,使得创建的进程池中的进程变为stopped状态,造成了内存泄漏,最后导致了内存溢出,最后发现了问题整理了这篇文章。1.进程池当创建的子进程数量不多时,可以使用multiprocessing.Process动态创建。但是,当创建的子进程数量很多时,因为创建子进程也需要开销,如果按照上述方面创建,代价较高,因此使用进程池进行创建...

2019-10-10 20:26:11 5761 3

原创 python:GIL介绍

1.python执行py文件的步骤:1)从硬盘加载Python解释器到内存2) 从硬盘加载py文件到内存3) 解释器解析py文件内容,交给CPU执行每当执行一个py文件,就会立即启动一个python解释器2.GIL介绍:什么是GIL?GIL 的全称为 Global Interpreter Lock ,即全局解释器锁,它是一把加到python解释器上的锁。py文件中的内容本质是字符...

2019-10-10 16:33:48 393

原创 在Linux的开始菜单中添加图标(应用的快捷方式)

打开目录 /usr/share/applications 创建appname.desktop文件(需要管理员权限,名称任意,不影响在开始菜单中的名称) 添加下面代码 [Desktop Entry]Type=ApplicationName=name # 应用名称,即开始菜单中的名称Exec=appPath #应用执行文件位置Icon=default48.png # ...

2019-07-05 14:24:29 2036

原创 Jupyter Notebook 添加目录插件

参考:https://www.jianshu.com/p/7687c6bec65e https://ask.hellobi.com/blog/zhangjunhong0428/12063Jupyter Notebook安装不细说,可以安装anaconda,里面自带Jupyter,也可以 pip安装,但是还需要安装自动补全的插件第一步:安装nbextensions...

2019-05-09 16:29:02 765

原创 LeetCode(Python版)——121. Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),...

2018-08-10 10:08:43 700

原创 LeetCode(Python版)——119. Pascal's Triangle II

Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle.Note that the row index starts from 0.In Pascal's triangle, each number is the sum of the two numbers ...

2018-08-03 10:20:25 288

原创 LeetCode(Python版)——118. Pascal's Triangle

Given a non-negative integer numRows, generate the first numRows of Pascal's triangle.In Pascal's triangle, each number is the sum of the two numbers directly above it.Example: Input: 5 ...

2018-08-03 09:23:02 424

原创 LeetCode(Python版)——88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectively. You may assume tha...

2018-08-03 09:04:14 274

原创 LeetCode(Python版)——66. Plus One

Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list, and each element...

2018-08-01 20:14:45 176

原创 LeetCode(Python版)——53. Maximum Subarray

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example: Input: [-2,1,-3,4,-1,2,1,-5,4], Output: 6 ...

2018-08-01 19:47:03 796

原创 LeetCode(Python版)——27. Remove Element

Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input arra...

2018-07-31 09:31:55 190

原创 LeetCode(Python版)——26. Remove Duplicates from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifyi...

2018-07-31 09:16:52 391

原创 LeetCode(Python版)——1. Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same ...

2018-07-28 09:23:38 124

原创 推荐系统(Remmender System)学习笔记(二)--基于深度学习的推荐系统

关于session-based recommender system相关算法以及论文笔记:1.the item-to-item recommendation approach《Item-based collaborative filtering recommendation algorithms》《Amazon. com recommendations: Item-to-item coll...

2018-07-27 16:16:39 1114 2

原创 Linux常用命令学习笔记

文本匹配grep命令grep -c/n/v key filename-c:统计匹配行数    -n:显示行号    -v:相当于not字符串分隔cut -d_ -f1,2,3 filename-d分隔的符号“_”    -f1,2,3 输出第1,2,3域按行打印sed命令sed -n 1p filename    打印第1行sed -n 1,5p filename    打印第1到第5行...

2018-07-11 10:13:53 126

原创 推荐系统(Remmender System)学习笔记(一)--协同过滤

作为学习记录,完成后总结论文:A Survey of Collaborative Filtering Techniques 一.CF面临的问题Data Sparsity        相对于庞大的数据集,用户的行为操作数据相对较少,因此,user-item矩阵就是一个稀疏矩阵,导致当有新用户或项目访问系统时,出现冷启动问题(cold start),由于缺乏必要的行为数据,使得系统给出好的推荐的表现...

2018-07-04 17:19:55 561

原创 Python在编辑器VS Code中的设置

在用户设置中修改以下参数,就可以编写Python程序{ "python.linting.pylintEnabled": false, "python.linting.flake8Enabled": true, "python.formatting.provider": "yapf", "files.insertFinalNewline": true, "fi.

2018-06-07 20:43:23 824

转载 机器学习——霍夫丁不等式【转】

机器学习数学原理——霍夫丁不等式【转】转载自:https://blog.csdn.net/z_x_1996/article/details/73564926霍夫丁不等式霍夫丁不等式(Hoeffding’s inequality),在概率论中,该不等式给出了随机变量的和与其期望值偏差的概率上限。霍夫丁不等式被Wassily Hoeffding于1963年提出并证明。霍夫丁不等式是一个Azuma-Ho...

2018-05-10 20:28:07 1816

原创 LeetCode题库 第6题 Z字形变换

字符串:PAYPALISHIRING,4行展示的"Z"字形图案为输出为:PINALSIGYAHRPIchar* convert(char* s, int numRows) { if (numRows == 1) return s; int i = 0, j = 0, span, span1 = 0, span2 = 0, k = 0, sPos = 0, flag = 1; int ...

2018-04-14 15:51:08 253

原创 杭电OJ 1003 最大子序列(分治法)Max Sum

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1003需要注意的问题:1、需要设置最小值,题目中说序列中的值在-1000到1000之间,因此在设置初始值时不能使用02、为了获取第一个最大自序列,解的优先级左侧>过中点>右侧#include#define MAX_SIZE 100000#define MIN - 10000in

2016-07-15 14:39:11 697

原创 2016-1-13 Struts2页面赋值遇到的问题 JQuery validate取消校验问题

问题一:Struts2页面赋值Action跳转前台时,通过name值向页面标签中赋值,遇到无法赋值成功的问题,经过查阅各种资料,总结赋值时有两种方式:     1、使用s标签,例如,在session或request总有key值为username的参数时会直接为标签赋值,这种方式比较简单,但是s标签不支持中间有表达式形式,因此遇到对象时不能够动态赋值,而且如果在s标签外部有条件判断标签时

2016-01-13 17:54:22 942

原创 joj 2526: medic

<br />http://acm.jlu.edu.cn/joj/showproblem.php?pid=2526<br />最基本的0-1背包问题 <br /><br />动态规划 2维解法 (因为数组开错 导致wa 所以贴出来警示自己)<br /> <br />#include<stdio.h>#include<iostream>using namespace std;#define T 1005#define M 105int f[M][T];int max(int a,int

2011-03-01 13:54:00 381

原创 poj 3984 迷宫问题

此题用BFS输出最短路径,此题的测试数据为一组http://poj.org/problem?id=3984#include#includeusing namespace std;int a[5][5];int b[5][5];queuex;queuey;void bfs(int i,int j){ int s,t,ii; int dx[4]={1,-1,0,0}; int dy[4]={0,0,1,-1}; while(!x.empty()) x.pop();

2011-01-18 15:21:00 820

原创 中国剩余定理

<br />中国剩余定理定义 根据定义可以写出代码<br /><br /><br />设m1,m2,...mn是两两互素的正整数,<br />则x≡bi mod mi(i=1,2,...n)在模m1m2m3...mn下有唯一解。<br />这M=m1m2....mn,Mj=M/mj,且Mjyj≡1 mod mj(j=1,2,...n),<br />则x=b1M1y1+b2M2y2+...+bnMnyn mod m1m2m3...mn即是符合条件的解。<br /><br /><br />注:ch_mod为根据

2010-10-31 20:48:00 332

原创 joj 1595 Combinations

<br />http://acm.jlu.edu.cn/joj/showproblem.php?pid=1595<br /> <br />此题是求组合数问题,即求C(n,m)问题,根据组合公式C(n,m)=C(n-1,m)+C(n-1,m-1)可以将此题转化成大数加法<br />#include<stdio.h>#include<string.h>void add(char a[],char b[],char c[]){ int dig=0,temp,i; for(i=0;a[i]!='/0

2010-10-27 19:15:00 300

原创 joj 2652 数组操作

<br />http://acm.jlu.edu.cn/joj/showproblem.php?pid=2652<br /> <br />如果用数组模拟指针会更省时<br /> <br />#include<stdio.h>#include<memory.h>#define N 1000030int a[N];int main(){ int i,j,t,n,m,flag; char ch; while(scanf("%d%d",&n,&m)!=EOF,n){ memset(

2010-09-17 19:02:00 374

原创 poj 1002 487-3279

<br />http://acm.pku.edu.cn/JudgeOnline/problem?id=1002<br /> <br />自己琢磨出用qsort排字符串数组,虽然时间很多860ms 但是很有成就感<br /> <br />#include<stdio.h>#include<string.h>#include<stdlib.h>int cmp(const void*a,const void*b){ return strcmp((char*)a,(char *)b);}in

2010-09-14 21:32:00 225

原创 joj 2619 Magic Train Station

<br />http://acm.jlu.edu.cn/joj/showproblem.php?pid=2619<br /><br />注意:Hint: The name can be as long as 1000 character & may contains space.<br /><br />没看好名字有一千位 所有wa了好多次<br /> <br />#include<stdio.h>int main(){ int n,t1[1001],t2[1001],i,j,flag,r; ch

2010-09-14 20:02:00 308

同济线性代数教材(第五版)高清带书签带习题答案.pdf

同济线性代数教材(第五版),高清带书签,带课后习题答案

2018-05-10

概率论与数理统计(陈希孺高清版带书签带习题答案).pdf

概率论与数理统计,陈希孺高清版,带书签,带习题答案

2018-05-10

概率论与数理统计(茆诗松高清版带书签).pdf

概率论与数理统计基础学习教材,茆诗松高清版,带书签

2018-05-10

统计学习方法(李航高清版)带书签

李航著《统计学习方法》,机器学习入门书籍,高清扫描版带书签目录

2018-04-04

计算机网络知识汇总(超全).doc

很详细的计算机网络知识点汇总,很详细的计算机网络知识点汇总

2018-04-02

广西大学口语复试问题总结 命中率80%

总结广西大学计算机与电子信息学院英语口语复试问到的问题,命中率80%

2018-04-02

空空如也

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

TA关注的人

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