自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(45)
  • 资源 (3)
  • 收藏
  • 关注

原创 机器阅读理解那些事儿

今日,“机器之心”公众号刷爆了超强小姐姐陈丹琦的文章,笔者前两天也刚看了小姐姐的论文,当时无意中点开开源的github链接,发现小姐姐一路绿灯的github也是十分敬佩!再放一张小姐姐的主页图片,再次膜拜下~小姐姐做的方向是机器阅读理解和智能问答(QA),博主也看了一段时间的该方向论文,现在来聊一聊机器阅读理解中的世界~阅读理解,其实我们大家从小到大都在做,从语文阅读理解到英语阅读理解,...

2019-02-28 22:14:11 3149

原创 PyTorch可视化工具Visdom实战

Visdom是一个灵活的可视化工具,可以实时显示新创建的数据,支持Torch和Numpy,是深度学习框架PyTorch的可视化工具,做出的图像也较为美观,本文总结了Visdom的基础画图操作。安装方式在Python3环境下,使用pip直接安装Visdom模块。pip install visdom然后命令行启动服务器python -m visdom.server一旦启动了服务器后,就...

2019-02-24 16:35:22 2017

原创 BERT_中文情感分类操作及代码

本实验,是用BERT进行中文情感分类,记录了详细操作及完整程序,代码链接,喜欢的话给个star哟(凑不要脸~)本文参考奇点机智的文章,记录自己在运行BERT中的一些操作。BERT的代码同论文里描述的一致,主要分为两个部分。一个是训练语言模型(language model)的预训练(pretrain)部分。另一个是训练具体任务(task)的fine-tune部分。在开源的代码中,预训练的入口是...

2019-02-18 11:04:49 18491 47

原创 神经网络结构可视化(Keras版)

mark一下:from keras.utils.vis_utils import model_to_dotfrom IPython.display import SVG#model即为要可视化的网络模型SVG(model_to_dot(model).create(prog='dot', format='svg'))demo效果如下:...

2018-12-07 11:24:50 3926

原创 深度学习关键网络架构及其在Keras中的应用

最近撸完了《Python深度学习》,对深度学习又加深了认识,“深度学习真的是一门艺术”,以下是原书第9章的总结部分,很多heuristic知识都是前人总结下来的,个人觉得很有借鉴意义,因此mark下。首先,我们来快速看一下输入模式与适当的网络架构之间的对应关系。向量数据:密集连接网络( Dense 层)。图像数据:二维卷积神经网络。声音数据(比如波形):一维卷积神经网络(首选)或循环神经...

2018-11-19 19:20:01 407

原创 LeetCode-771-Jewels and Stones(宝石和石头)

Q:You're given strings J representing the types of stones that are jewels, and S representing the stones you have.  Each character in S is a type of stone you have.  You want to know how many of the...

2018-08-11 22:05:00 185

原创 TensorFlow实现多层感知机

此代码主要参考黄文坚老师的《TensorFlow实战》此网络数据集为MNIST手写数据集,采用一层隐含层(隐含层节点数量300)的神经网络架构,并且使用Dropout方法随机丢失神经元来丰富训练的特征,使用自适应学习速率算法Adagrad,激活函数使用ReLU,输出层采用softmax计算各个类别概率。此处输入,[None,784]代表将图片784像素点一维“铺开”,一张图片对应一个向量:...

2018-07-21 10:57:02 391

原创 随机梯度下降法和最小二乘法的TensorFlow实现

1.随机梯度下降法(SGD)随机梯度下降法是用来求参数的优化算法,具体算法不过多阐述,此处采用线性拟合来实现SGD,同时使用TensorFlow进行计算,具体思路注释写的较为清楚,直接附上代码:import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt#权重W=0.3#偏置b=0.8n...

2018-07-18 15:23:36 2958

原创 随机梯度下降法学习

以下代码是学习李宏毅老师的课程,数据集为神奇宝贝进化后的cp数据值。# -*- coding: utf-8 -*-"""Created on Thu May 31 09:59:54 2018@author: Administrator"""import numpy as npimport matplotlib.pyplot as plt#给出训练数据x_data=[328,3...

2018-05-31 14:00:35 418

原创 《scikit-learn常用机器学习算法》学习笔记---KNN算法及KNN回归

一、KNN算法具体算法原理不再细说,此处生成3类,60个点集合,并对预测值进行预测分类。# -*- coding: utf-8 -*-"""Created on Wed May 16 12:09:34 2018@author: Administrator"""from sklearn.datasets.samples_generator import make_blobsfrom ...

2018-05-17 10:04:09 696

原创 HDOJ-1019(Java)

Q:The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105.Input:...

2018-03-30 16:45:10 166

原创 HDOJ-1005(Java)

Q:A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).Input:The input consist...

2018-03-29 15:09:10 340

原创 保研经历回顾

保研经验回顾

2017-10-12 18:46:00 1824 2

原创 LeetCode-121-Best Time to Buy and Sell Stock(最佳买卖股票的时间)

Q: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 (ie, buy one and sell one share of the stock), de

2017-08-21 09:21:38 224

原创 《Python机器学习》笔记--感知机分类鸢尾花数据集

书籍参考机械工业出版社的《Python机器学习》,如下图:           一、   感知机模型是很基础的二类分类(判别)模型,主要采用了分离超平面的概念,其学习策略是极小化误分点到超平面距离,使用的学习算法为随机梯度下降算法。   详细算法不再阐述,各位聚聚博客or书籍有大量讲解内容。 二、   此处使用sklearn包中的Perceptron(感知机)类来对sklearn包中提供的

2017-08-20 21:41:41 5532

原创 LeetCode-118-Pascal's Triangle(帕斯卡的三角形)

Q:Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]Analysis:基础的算法问题,中间元素值等于“肩上”两元素之和。C

2017-08-19 09:53:30 311

原创 LeetCode-112-Path Sum(路径和)

Q:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example: Given the below binary tree and sum =

2017-08-17 09:13:06 184

原创 LeetCode-111-Minimum Depth of Binary Tree(二叉树的最短路径)

Q:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Analysis:此题要求返回二叉树根结点到叶子结点最短的距离。可以采用递归的方法

2017-08-16 19:07:32 322

原创 LeetCode-110-Balanced Binary Tree(平衡二叉树)

Q:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ b

2017-08-12 15:56:17 265

原创 LeetCode-108-Convert Sorted Array to Binary Search Tree(转化已排序数组到二叉排序树)

Q:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.Analysis:题目要求将已升序的数组转化为二叉排序树;可以使用递归,二分的方法,进行生成二叉排序树。Code:/** * Definition for a binary tree node. *

2017-08-11 10:24:51 391

原创 LeetCode-107-Binary Tree Level Order Traversal II(二叉树级序遍历<2>)

Q:Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example: Given binary tree [3,9,20,null,null,15,7

2017-08-10 11:20:10 277

原创 LeetCode-101-Symmetric Tree(判断是否为对称树)

Q:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the

2017-08-09 15:16:46 267

原创 LeetCode-70-Climbing Stairs(爬楼梯)

Q:You are climbing a stair case. It takes n steps 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: Given n will be a positive in

2017-08-04 09:29:12 201

原创 LeetCode-67-Add Binary(二进制相加)

Q:Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.Analysis:刚开始傻傻的以为Java自带API就可以完成,后来试了确实naive了。然后正常思路做题吧,找出最长的二进制字符串,较短的前面补0,依次按各个位相加即可。C

2017-08-03 21:44:00 235

原创 LeetCode-66-Plus One(加一操作)

Q:Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digits are

2017-08-02 08:55:24 520

原创 LeetCode-53-Maximum Subarray(最大和子串)

Q:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] has t

2017-08-01 09:53:29 180

原创 LeetCode-38-Count and Say(计数并显示)

Q:The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211 is read off as “one 1” or 11. 11 is read off as

2017-07-31 18:08:41 189

原创 LeetCode-35-Search Insert Position(搜素并插入指定位置)

Q:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Her

2017-07-28 18:04:40 223

原创 LeetCode-28-Implement strStr()(字符串匹配)

Q:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Analysis:第一反应就是用基础的KMP算法来实现,也可用其他字符串匹配算法如BM等算法。Code:public class Solution {

2017-07-27 18:46:26 302

原创 LeetCode-27-Remove Element(消除数组中给定的元素)

Q: Given an array and a value, 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 in place with constant memory.The o

2017-07-25 09:37:11 213

原创 LeetCode-26-Remove Duplicates from Sorted Array(消除已排序数组中的重复元素)

Q:Given a sorted array, 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 in place with co

2017-07-24 17:22:05 202

原创 LeetCode-21- Merge Two Sorted Lists(合并两个已排序链表)

Q:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Analysis:题目简单,合并两个已排序的链表。需要注意的是,若有相同的元素,并没说要删除,需要“一次链接两个相同

2017-07-23 17:08:27 286

原创 LeetCode-20-Valid Parentheses(有效的括号)

Q:Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the correct order, “()” and “()[]{}” are all valid but

2017-07-22 20:35:14 173

原创 LeetCode-14-Longest Common Prefix(最长公共前缀)

Q:Write a function to find the longest common prefix string amongst an array of strings.Analysis:先将字符串数组按每个元素的长度从小到大排序,然后用二重循环直接依次判断各个字符数组元素的字符和最短的字符串中的各个字符是否相等并返回。Code:public class Solution { publ

2017-07-21 16:42:14 229

原创 LeetCode-13-Roman to Integer(罗马数字转换为整型数字)

Q:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.Analysis:可以枚举出罗马字母对应的阿拉伯数字,罗马数字来说,如果左边的字符比右边的字符小,则应该减去左边的字符,计算出整型数字;如果左边的字符大于右边的字符,则需加上右边的字符,

2017-07-20 17:04:11 349

原创 LeetCode-9-Palindrome Number(回文数)

Q: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1)If you are thinking of converting the integer to string, not

2017-07-19 17:26:53 188

原创 Android学习之路---使用ViewPager实现引导页

许多app安装之后都有可滑动的引导页,今天看了视频学习了下ViewPager的使用。      下面是我的实现:      1.主类:public class ViewPagerProject extends Activity implements ViewPager.OnPageChangeListener { private ViewPager viewPager; pri

2017-01-16 19:29:50 351

原创 Android学习之路---Menu综合

一:选项菜单1.选项菜单的实现步骤:(1)覆盖Activity的onCreateOptionsMenu(Menu menu)方法,当菜单第一次被打开时调用;(2)调用Menu的add()方法添加菜单项(MenuItem),同时可以调用MenuItem的setIcon()方法来为菜单设置图片;(3)当菜单项(MenuItem)被选择时,覆盖Activity的;onOptionsItemSelect

2017-01-16 13:08:24 251

原创 Android学习之路---ImageSwitcher和TextSwitcher切换图片及文本

一:ImageSwitcher实现图片切换:1.需要实现ViewSwitcher.ViewFactory和 View.OnTouchListener两个接口; 2.重写两个接口中的makeView()和onTouch(View v, MotionEvent event)方法。public class ImageSwitcherTest extends Activity implements Vie

2017-01-15 11:58:57 379

原创 Android学习之路---Button单击事件的实现方法

又到一次寒假了,接触安卓一年了,没有学多深,先把最基础的复习一遍。今天看到了Button按钮单击事件的三中实现方法。1.使用OnClick()方法 /** * 1.需要在布局文件中的按钮添加 android:onClick="ttt"属性(ttt是代码中的方法名) * 2.然后在代码中定义Button变量先findById找到按钮之后, * 3.写一个和androi

2017-01-08 11:14:16 515

中文实体词典(NLP必备)

此词典由多个txt文件构成,各个txt分别为不同的类别,比如动漫、电影、电视剧、明星、篮球、美食等多个分类,每个txt中均为对应类目下的中文实体词典,对于分词,命名实体识别的准确率提升十分有帮助!

2019-02-25

《深度学习框架Pytorch快速开发与实践》数据及源代码

邢梦来老师的《深度学习框架Pytorch快速开发与实践》原书代码及数据,也可以直接学习代码,来入门PyTorch,深度学习框架PyTorch的入门代码

2019-02-24

常用英文停用词(NLP处理英文必备)

常用英文停用词(NLP处理英文必备),常见基础语气词、代词、疑问词等等,在做文本相关比赛或者学习自然语言处理知识时必备

2018-10-12

空空如也

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

TA关注的人

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