自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

imbabao的博客

高中欠的债要用一辈子来还

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

原创 TensorFlow笔记:模型的存储和加载

tf.train.Saver类TensorFlow中的模型存取都是通过这个类来实现的以 my_model 为例,存储时会在目录下生成四个文件,分别是 checkpoint 文件、 my_model.meta 文件、 my_model.index 文件和 my_model.data-00000-of-00001 文件checkpoint 文件:该文件在目录下只会生成一个,是用来记录和管理整个...

2018-10-02 21:43:53 395

原创 机器学习笔记:正则化项

在机器学习算法中如果只使用经验风险最小化去优化损失函数则很可能造成过拟合的问题,通常我们要在损失函数中加入一些描述模型复杂程度的正则化项,使得模型在拥有较好的预测能力的同时不会因为模型过于复杂而产生过拟合现象,即结构风险最小化正则化项一般是模型复杂程度的单调递增函数,因此可以使用模型参数向量的范数来计算范数在数学上的定义更为广泛,大家可以看看别的资料。这里只涉及了一些和机器学习有关的定义,可能...

2018-10-02 16:54:35 2198

原创 TensorFlow笔记:指数衰减学习率

学习率决定了参数更新的幅度。通常我们希望在学习开始阶段提供一个较大的学习率,使得参数快速更新,达到最优解附近。然后随着训练的进行,我们希望在学习率随着训练次数的增加而减少,即在接近最优解的时候能够以较小的学习率逼近最优解TensorFlow为我们提供了tf.train.exponential_decay()函数实现这个功能tf.train.exponential_decay()函数定义tf...

2018-10-02 15:34:25 1609

原创 机器学习笔记:各种熵

在机器学习中通常会使用各种熵来描述分布与分布之间的关系,如条件熵和交叉熵等,也有直接优化熵的模型,如最大熵模型。这篇文章简单总结一下之前见到过的一些熵相关的概念。信息量定义假设有离散随机变量 XXX 满足分布 P(X=xi)=piP(X = x_{i}) = p_{i}P(X=xi​)=pi​ , 定义事件 X=xiX = x_{i}X=xi​的信息量为I(xi)=−log(pi)I(...

2018-10-01 17:11:48 386

原创 TensorFlow笔记:激活函数

tf.nn.sigmid()函数函数表达式f(x)=11+e−xf(x) = \frac{1}{1 + e^{-x}}f(x)=1+e−x1​函数图像函数性质对其求导可得到 f′(x)=f(x)(1−f(x))f'(x) = f(x)(1 - f(x))f′(x)=f(x)(1−f(x))sigmoid函数取值范围在 (0, 1) 区间内,常用于输出层进行二分类...

2018-10-01 15:15:54 576

原创 TensorFlow笔记:数值操作

基本运算+, -, *, /直接对张量进行加减乘除运算会得到元素级别的运算v1 = tf.constant([[1.0, 2.0], [3.0, 4.0]])v2 = tf.constant([[1.0, 2.0], [3.0, 4.0]])with tf.Session() as sess: print((v1 + v2).eval()) # [[2, 4], [6, 8]...

2018-09-30 23:49:10 186

原创 TensorFlow笔记:常量和变量

常量tf.constant()函数tf.constant( value, dtype=None, shape=None, name='Const', verify_shape=False)用于定义常量,可以直接传入一个list来初始化 vaule ,也可以指定 value 和 shape 来进行填充。tensor = tf.constant([1...

2018-09-30 21:37:26 2017

原创 为Jupyter notebook增加新的kernel

在初学python的时候被pip、conda、anaconda、jupyter的关系搞的很头大。差不多了解了conda的威力之后,发现虽然使用conda create可以创建很多不同的python环境,但是在使用jupyter notebook时并不能直接使用这些环境,jupyter提供的kernel还是默认的环境。下面介绍如何将一个新建的环境加入到jupyter中作为一个新的kernel。创建...

2018-09-30 17:36:40 11989 2

原创 conda常用命令

查看现有环境conda env list创建环境conda create -n hello python=3.6-n 参数指明环境名称,python= 参数指明Python版本激活环境source activate hello激活后会在控制台显示当前环境查看当前环境下的库conda list安装库conda install numpy删除库conda remov...

2018-09-30 17:03:38 544

原创 Ubuntu下安装Tomcat

安装Java环境可以参考我的另外一篇文章安装Tomcat环境下载和解压到官网下载对应的tar.gz文件,我安装的是apache-tomcat-8.5.33.tar.gz 使用如下命令对文件进行解压:tar -zxvf apache-tomcat-8.5.33.tar.gz使用如下命令将解压得到的文件夹移动至 opt 目录下,并重命名为 tomcat :su...

2018-08-29 14:55:20 1037

原创 Ubuntu安装CUDA和cuDNN

我的环境Ubuntu16.04_x64CUDA_9.2uDNN_7.1.4一、安装CUDA1.进入官网,根据自己的系统选择版本开始下载链接2.下载完成后进入目录,按照官网给定的四条命令进行安装sudo dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64.debsudo apt-key add /var...

2018-08-06 14:11:19 1042

原创 Ubuntu下上传本地仓库到GitHub

一、安装git使用命令安装gitbabao@babao:~$ sudo apt-get install gitbabao@babao:~$ sudo apt-get install git-core二、配置git使用命令配置用户基本信息babao@babao:~$ git config --global user.name "Babao"babao@babao:~$ g...

2018-07-25 11:08:03 1511

原创 Ubuntu16.04与Windows10双系统启动顺序

使用命令打开配置文件:sudo gedit /etc/default/grub 要修改默认启动顺序,找到如下行:(应该是除去注释的第一行)GRUB_DEFAULT=0该行就是启动时默认的选项。修改为自己Windows所在的值。如我的启动项分别是  0. Ubuntu启动  1. Ubuntu配置  2.Windows启动... 要修改默认等待时间,找...

2018-06-07 14:42:26 5559

原创 POJ1797 Heavy Transportation Dijkstra

Heavy TransportationTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 44998 Accepted: 11768DescriptionBackground Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now ...

2018-05-23 23:36:16 157

原创 POJ2253-Frogger Floyd

FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 56007 Accepted: 17619DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sittin...

2018-05-23 21:37:36 178

原创 POJ2387-Til the Cows Come Home Dijkstra

Til the Cows Come HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 68691 Accepted: 23025DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as pos...

2018-05-23 20:46:50 164

原创 POJ1017-Packets

PacketsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 60023 Accepted: 20357DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*...

2018-04-25 22:30:31 107

原创 POJ1016-Numbers That Count

Numbers That CountTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21528 Accepted: 7227Description"Kronecker's Knumbers" is a little company that manufactures plastic digits for use in signs ...

2018-04-25 21:31:04 336

原创 POJ1015-Jury Compromise dp

Jury CompromiseTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 30832 Accepted: 8276 Special JudgeDescriptionIn Frobnia, a far-away country, the verdicts in court trials are determined by a j...

2018-04-22 00:00:16 170

原创 POJ1014-Dividing 多重背包+二进制划分

DividingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 74312 Accepted: 19441DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so tha...

2018-04-21 20:34:14 301

原创 POJ1013-Counterfeit Dollar

Counterfeit DollarTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 50542 Accepted: 15817DescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true ...

2018-04-21 19:49:05 145

原创 Ubuntu下文件压缩与归档

一、gzip-文件压缩与解压缩        gzip命令用于压缩文件。gunzip命令用于解压缩文件。对应于.gz文件。 gzip常用选项 选项 功能 -d 解压缩。加上此选项,gzip命令类似于gunzip。可替换为--stdout -v 在压缩时显示详细信息。可替换为--verbose -r 如果操作参数中存在目录,则递归压缩包含在目录中的文...

2018-04-08 17:10:51 1908

原创 Ubuntu与Windows双系统下时间不统一

        两者时间不统一是因为两者使用的时间计算方案不同。        在Ubuntu16.04中,可以在控制台输入如下命令:timedatectl set-local-rtc true 

2018-04-07 23:19:27 229

原创 POJ1012-Joseph 约瑟夫环问题

JosephTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 56986 Accepted: 21688DescriptionThe Joseph's problem is notoriously known. For those who are not familiar with the original problem: fro...

2018-04-07 22:56:23 887 1

原创 POJ1011-Sticks 搜索

SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 151709 Accepted: 36124DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units lon...

2018-04-07 22:15:01 187

原创 POJ1010-STAMPS 搜索

STAMPSTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19490 Accepted: 5712DescriptionHave you done any Philately lately? You have been hired by the Ruritanian Postal Service (RPS) to design ...

2018-04-07 20:52:20 441

原创 POJ1008-Maya Calendar

Maya CalendarTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 81342 Accepted: 25016DescriptionDuring his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya cal...

2018-03-26 23:42:11 144

原创 POJ1007-DNA Sorting

DNA SortingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 106816 Accepted: 42795DescriptionOne measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of or...

2018-03-26 22:37:07 122

原创 模板:中国剩余定理

一、m[]两两互质时        简单证明:        必要时数据类型改为long long#include <iostream>#include <sstream>#include <iomanip>#include <string>#include <numeric>#include <vector>#i...

2018-03-26 22:04:38 146

原创 模板:欧几里得 扩展欧几里得 乘法逆元

一、欧几里得算法        求a,b的最小公约数。int GCD(int a, int b) { int r; while (b) { r = a % b; a = b; b = r; } return a;}二、扩展欧几里得        求解方程ax + by = gcd(a, b),并返回gcd(a,b)。        简单证明://求解ax + by = gcd...

2018-03-26 15:29:54 260

原创 POJ1006-Biorhythms 中国剩余定理

BiorhythmsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 143074 Accepted: 46000DescriptionSome people believe that there are three cycles in a person's life that start the day he or she is ...

2018-03-23 22:09:31 173

原创 POJ1005-I Think I Need a Houseboat

I Think I Need a HouseboatTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 108947 Accepted: 47310DescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on....

2018-03-23 21:25:57 121

原创 POJ1004-Financial Management

Financial ManagementTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 193201 Accepted: 73428DescriptionLarry graduated this year and finally has a job. He's making a lot of money, but somehow ...

2018-03-23 21:04:55 185

原创 POJ1003-Hangover

HangoverTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 132971 Accepted: 64680DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximu...

2018-03-23 20:55:58 104

原创 POJ1002-487-3279 map应用

487-3279Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 303418 Accepted: 54259DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is ...

2018-03-23 20:26:46 191

原创 POJ1000-A+B Problem

A+B ProblemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 446656 Accepted: 251482DescriptionCalculate a+bInputTwo integer a,b (0<=a,b<=10)OutputOutput a+bSample Input1 2Sample Output3...

2018-03-23 19:46:41 160

原创 模板:区间GCD

一、RMQ实现        RMQ不能实现更新。#include <iostream>#include <sstream>#include <iomanip>#include <string>#include <numeric>#include <vector>#include <queue>#in

2018-02-09 16:21:14 518

原创 Codeforces Round#458Div.1+2 D.Bash and a Tough Math Puzzle 区间GCD

D. Bash and a Tough Math Puzzletime limit per test2.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBash likes playing with arrays. He has an array a1, a2, ... an of...

2018-02-09 15:50:26 257

原创 HDU5726-GCD 区间GCD+二分

GCDTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4611    Accepted Submission(s): 1655Problem DescriptionGive you a sequence of N(N≤100,000) i...

2018-02-08 16:41:17 241

原创 Codeforces Round#458Div.1+2 C.Travelling Salesman and Special Numbers 数位dp

C. Travelling Salesman and Special Numberstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Travelling Salesman spends a lot of time travelling s...

2018-02-08 14:49:35 308

空空如也

空空如也

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

TA关注的人

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