- 博客(41)
- 资源 (13)
- 问答 (2)
- 收藏
- 关注
原创 今日刷题有感
感觉算法这个东西,有很多路可以走,局限性不是很大,今天看到一道leetcode题(1146. Snapshot Array),有的人用的各种骚操作(unordered_map, map.lower_bound, auto啥的),也有人用各种常规操作(vector,iterator等等),但是算法本质思想是一样的。所以,我觉得骚操作是永远学不完的,与其记忆那些骚操作,不如想想怎么用自己会的基本操作...
2019-08-19 12:03:14 231
原创 四大专业课知识点整理总结
链接总结:https://blog.csdn.net/FanceFu/article/details/79357048https://www.cnblogs.com/xdyixia/p/9274909.htmlhttps://www.cnblogs.com/mukekeheart/p/5731833.html
2019-07-09 09:09:07 593
原创 孔老师《数据挖掘与大数据分析 》第三次课堂小测复习笔记
大家好,我是五一劳动节一股清流,大致整理了一下孔老师要考的关于统计学的一点内容,基本都是套公式计算,ANOVA后面的列联表分析部分我貌似没有印象讲过,应该不会考,待我能下载上课视频再确认一下。欢迎大家批评指正。附上高清pdf链接:https://pan.baidu.com/s/1LlKB1kskw9hgmqfsWzLrfA提取码:oucy...
2019-05-04 11:35:03 504
原创 分解质因数算法
题目:将一个正整数分解质因数。例如:输入90,打印出90=2 * 3 * 3 * 5。分析:从1到N先找出最小的质因数,如果等于本身,那么说明只有一个质因数,如果不是,那么将该质因数打印出来,并将N/该质因数作为新的N值进行运算。设计步骤:1、如果这个质数恰等于n,则说明分解质因数的过程已经结束,打印出即可。2、如果n!=k,但n能被k整除,则应打印出k的值,并用n除以k的商,作为新的正整...
2019-04-17 09:24:57 3112 1
原创 研读pytorch版本的BERT分类代码
1 首先加载了tokenizer就是有个vocab.txt文件,里面每行是个token,比如:abcbcd吴家行然后Tokenizer这个类中有几个属性:vocab是个字典,也就是将上面的vocab.txt文件变成如下的形式:{ "abc": 0, "bcd": 1, "吴家行": 2,}ids_to_tokens调换vocab中token...
2019-04-15 16:47:12 5457 4
原创 你爱西加加么?
你爱西加加么?cinint a;cin >> a;coutint a = 5;cout << a << endl; // endl : '\n'vectorvector<int> a;vector<int> b(5); //定义一维动态数组含有五个元素vector<vector<int> >...
2019-04-13 16:14:48 153
原创 关于c语言的scanf()和gets()输入字符串
scanf() 和 gets() 是有区别的:scanf() 读取字符串时以空格为分隔,遇到空格就认为当前字符串结束了,所以无法读取含有空格的字符串。gets() 认为空格也是字符串的一部分,只有遇到回车键时才认为字符串输入结束,所以,不管输入了多少个空格,只要不按下回车键,对 gets() 来说就是一个完整的字符串。换句话说,gets() 用来读取一整行字符串。...
2019-04-11 13:06:10 1893
原创 求x的y次方对z取模(x^y)mod z:蒙格马利快速幂模算法
long Montgomery(long a,long b,long m){ long r=1; a %=m; while(b>1) { if((b&1)!=0) r = (r*a)%m; a = (a*a)%m; b/=2; } return (r*a)...
2019-04-10 23:29:01 2327
原创 孔老师《数据挖掘与大数据分析 》第二次课堂小测复习笔记
马上迎来孔老师第二次课堂小测,闲着没事整理了一下要考的内容,本人大概是清明节的一股清流吧。。奉上手稿,以供参考~
2019-04-06 15:51:54 544
原创 LeetCode - 1017. Convert to Base -2
Given a number N, return a string consisting of "0"s and "1"s that represents its value in base -2 (negative two).The returned string must have no leading zeroes, unless the string is “0”.Example 1:...
2019-04-01 10:49:54 227
原创 tensorflow学习笔记(5) - 激励函数的使用
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltdef add_layer(inputs, in_size, out_size, activate_function=None): Weights = tf.Variable(tf.random_normal( [in_s...
2019-03-25 10:57:36 165
原创 tensorflow学习笔记(4) - Placeholder
import tensorflow as tfinput1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)'''注意:multiply 是元素相乘matmul 是矩阵相乘'''output = tf.multiply(input1, input2)with tf.Session() as ses...
2019-03-25 09:14:52 215
原创 tensorflow学习笔记(3) - Variable变量
import tensorflow as tfstate = tf.Variable(0, name='counter')# print(state.name)one = tf.constant(1)new_value = tf.add(state, one)update = tf.assign(state, new_value)init = tf.initialize_all_va...
2019-03-25 09:14:20 181
原创 tensorflow学习笔记(2) - Session会话
import tensorflow as tfmatrix1 = tf.constant([[3, 3]])matrix2 = tf.constant([[2], [2]])product = tf.matmul(matrix1, matrix2)# method 1sess = tf.Session()result = sess.r...
2019-03-25 09:13:33 219
原创 tensorflow学习笔记(1) - 第一个tensorflow程序
import numpy as npimport tensorflow as tf# creat datax_data = np.random.rand(100).astype(np.float32) # 随机生成100个数,每个数的类型是float32y_data = x_data*0.1+0.3### create tensorflow structure start ###...
2019-03-23 19:56:03 728
原创 LeetCode-561. Array Partition I(Quick Sort快速排序)
561. Array Partition I题目Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai, bi) for all i from...
2019-03-06 08:46:54 178
原创 LeetCode-746. Min Cost Climbing Stairs(DP)
746. Min Cost Climbing Stairs题目On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find m...
2019-03-04 15:12:29 116
原创 LeetCode-1004. Max Consecutive Ones III【Sliding Window】
1004. Max Consecutive Ones III题目Given an array A of 0s and 1s, we may change up to K values from 0 to 1.Return the length of the longest (contiguous) subarray that contains only 1s.Example 1:Inpu...
2019-03-04 12:38:12 133
原创 LeedCode-53. Maximum Subarray
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,...
2019-03-01 20:40:17 90
原创 LeetCode-14. Longest Common Prefix
14. Longest Common Prefix题目:Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”.Example 1:Input: [“flower...
2019-03-01 20:40:07 97
原创 ACM中快速将整形转化成字符串
//首先定义一个确定大小的字符数组char str[100];int num = 7;sprintf(str, &amp;amp;quot;%d&amp;amp;quot;, num);
2019-03-01 20:39:51 256
原创 LeetCode-108. Convert Sorted Array to Binary Search Tree
108. Convert Sorted Array to Binary Search Tree题目Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is ...
2019-03-01 20:39:40 79
原创 LeetCode-122. Best Time to Buy and Sell Stock II
122. Best Time to Buy and Sell Stock II题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as ...
2019-03-01 20:39:34 93
原创 LeetCode-168. Excel Sheet Column Title
168. Excel Sheet Column Title题目Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -&amp;amp;amp;gt; A2 -&amp;amp;amp;gt; B3 -&amp;amp;amp;gt; C...26 -&amp;amp;am
2019-03-01 20:39:28 96
原创 LeetCode-136. Single Number
136. Single Number题目Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you imp...
2019-03-01 20:39:10 102
原创 LeetCode-172. Factorial Trailing Zeroes
172. Factorial Trailing Zeroes题目Given an integer n, return the number of trailing zeroes in n!.Example 1:Input: 3Output: 0Explanation: 3! = 6, no trailing zero.Example 2:Input: 5Output: 1Exp...
2019-03-01 20:39:05 131
原创 LeetCode-169. Majority Element
169. Majority Element题目Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and t...
2019-03-01 20:38:59 128
原创 万能头文件(C++)
#include&amp;amp;lt;bits/stdc++.h&amp;amp;gt;using namespace std;
2019-03-01 20:38:44 12093
原创 LeetCode-205. Isomorphic Strings
205. Isomorphic Strings题目Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must ...
2019-03-01 20:38:34 137
原创 判断一个数字是否是2的幂次方
这段代码可以说是人生中比较自豪的一段代码了,直接想到了位运算,因为2的幂次方化为二进制一定只有一个1bool isPowerOfTwo(int n) { if(n==0)return false; int bits=0; int k =n; while(k!=0){ if(k&amp;amp;1==1)bits++; if(bits&amp;gt;...
2019-03-01 20:38:25 630
原创 LeetCode-141. Linked List Cycle
141. Linked List Cycle题目Given a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the ...
2019-03-01 20:38:13 85
原创 Python 读取 excel 文件导入 mysql 数据库
&quot;&quot;&quot;功能:将Excel数据导入到MySQL数据库&quot;&quot;&quot;import xlrdimport pymysql# Open the workbook and define the worksheetbook = xlrd.open_workbook(&quot;名单.xlsx&quot;) # excel文件名
2019-01-19 11:20:37 609 1
原创 Spark aggregateMessage() 实现 PageRank算法
Project 2Jiahang, 2018/12/14RequirementsUse aggregateMessage to implement PageRank, and use relation.txt to test this algorithm, develop the code and write the report.Basic content about Spark tau...
2018-12-29 10:24:56 706
原创 Matlab 2017a + VS2017 C++编译器
Matlab 2017a + VS2017 C++编译器安装完成Matlab 2017a和Visual Studio Professional 2017以后,在matlab命令行窗口输入mex -setup命令后,提示找不到编译器。在确认matlab和VS2017安装无误后:找到matlab 2017a的安装路径,如D:\ProgramFiles\MATLAB\R2016b下载http...
2018-12-23 08:38:48 4073 3
原创 Django运行(For Windows)
Django运行(For Windows)创建虚拟环境python -m venv venv激活虚拟环境venv/Scripts/activate退出虚拟环境venv/Scripts/deactivate依照requirements.txt安装需要的包pip install -r requirements.txt创建数据库python manage.py makemig...
2018-12-10 12:09:25 593
翻译 用于视觉跟踪的层次化卷积特性
用于视觉跟踪的层次化卷积特性摘要视觉目标跟踪是一项具有挑战性的工作,由于目标对象的变形、突然运动、背景杂波和遮挡等因素,使目标对象的外观发生明显变化。本文利用在对象识别数据集上训练的深度卷积神经网络提取的特征来提高跟踪准确性和鲁棒性,最后一个卷积层的输出对目标的语义信息 (为什么叫做语义信息?) 进行编码,这些表示对显著的外观变化具有鲁棒性,然而,它们的空间分辨率过于粗糙,无法精确定位...
2018-09-10 11:11:22 1578
原创 基于自适应弹性网络回归的目标跟踪(OBJECT TRACKING WITH ADAPTIVE ELASTIC NET REGRESSION)阅读笔记
基于自适应弹性网络回归的目标跟踪(OBJECT TRACKING WITH ADAPTIVE ELASTIC NET REGRESSION)阅读笔记摘要近年来,各种基于回归的跟踪方法取得了很大的成功,然而,在大多数方法中,提取的所有特征都是用来表示对象的,而不需要进行特征选择。 (这里的意思是提取的所有特征全都用上了,而不是选择着去用) 本文提出了一种 基于自适应权(adap...
2018-08-31 19:46:34 2610 1
翻译 DeepPavlov配置文件
配置文件chainer 配置{ "chainer": { "in": ["x"], "in_y": ["y"], "pipe": [ ... ], "out": ["y_predicted"] }}chainer 是 DeepPavlov 的核心概念,它从异构组件(基于
2018-08-25 17:57:58 1114
翻译 混合面向目标的机器人
import jsonimport copy# pretty printsfrom pprint import pprint# creating directory for json configsimport osif not os.path.isdir("gobot"): os.mkdir("gobot")import deeppavlov注意:“...
2018-08-23 08:45:59 434
转载 机器学习-监督学习&&无监督学习
监督学习(supervised learning)通过已有的训练样本(即已知数据以及其对应的输出)来训练,从而得到一个最优模型,再利用这个模型将所有新的数据样本映射为相应的输出结果,对输出结果进行简单的判断从而实现分类的目的,那么这个最优模型也就具有了对未知数据进行分类的能力。在社会中,我们在很小的时候就被大人教授这是鸟啊,那是猪啊,这个是西瓜、南瓜,这个可以吃、那个不能吃啊之类的,我们眼里见到的...
2018-06-27 09:37:51 219
如何查看flask生成的sqlite数据库?
2018-11-02
列存储的数据进行压缩和解压?
2018-10-30
TA创建的收藏夹 TA关注的收藏夹
TA关注的人