C_Meng PSNA

Never wait for the storm to pass, just dance in the rain.

0%

问题原因

MySQL自带配置数据库mysql中的表user中,User=root一栏,Host的值为localhost,导致root用户只能通过本地登录。

解决思路

将User=root对应行的Host一栏的值修改为%,允许任意ip登录root。

具体解决方案

在本机登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost”改称’%’即可

1
2
3
4
mysql -u root -p  
mysql>use mysql;
mysql>update user set host = '%' where user ='root';
mysql>flush privileges;

概要

这篇文章介绍了何为pickle以及pickle模块的简单使用方法,即如何使用pickle进行存储存储以及数据的提取,关于pickle模块的其他更加详细的介绍可以参看https://docs.python.org/2/library/pickle.html

pickle简介

pickle模块是python中用来持久化对象的一个模块。所谓对对象进行持久化,即将对象的数据类型、存储结构、存储内容等所有信息作为文件保存下来以便下次使用。

就比如说你通过pickle将一个数组保存成了文件,那么当你下次通过pickle将这个文件读取出来的时候,你读取到的依然是一个数组,而不是一个看起来长得像数组的字符串。

用pickle保存对象到文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#导入pickle模块
import pickle

#创建一个名为data1的对象
data1 = {'a': '123', 'b': [1, 2, 3, 4]}

#打开(或创建)一个名为data1.pkl的文件,打开方式为二进制写入(参数‘wb’)
file_to_save = open("data1.pkl", "wb")

#通过pickle模块中的dump函数将data1保存到data1.pkl文件中。
#第一个参数是要保存的对象名
#第二个参数是写入到的类文件对象file。file必须有write()接口, file可以是一个以'w'方式打开的文件或者一个StringIO对象或者其他任何实现write()接口的对象。如果protocol>=1,文件对象需要是二进制模式打开的。
#第三个参数为序列化使用的协议版本,0:ASCII协议,所序列化的对象使用可打印的ASCII码表示;1:老式的二进制协议;2:2.3版本引入的新二进制协议,较以前的更高效;-1:使用当前版本支持的最高协议。其中协议0和1兼容老版本的python。protocol默认值为0。
pickle.dump(data1, file_to_save, -1)

#关闭文件对象
file_to_save.close()

用pickle从文件中读取对象

(请接着上一个脚本运行)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#导入pickle模块
import pickle

#打开一个名为data1.pkl的文件,打开方式为二进制读取(参数‘rb’)
file_to_read = open('data1.pkl', 'rb')

#通过pickle的load函数读取data1.pkl中的对象,并赋值给data2
data2 = pickle.load(file_to_read)

#打印data2
print data2

#关闭文件对象
file_to_read.close()

III. 训练一个手写体识别器

在这一部分中,我们将使用MNIST手写数字数据集来尝试区分一个28x28像素的手写体图像。这是一个典型的有监督的深度学习。

对于这个问题,我们将会改变我们之前的线性回归器,同时引入一些隐藏的线性神经网络层,当然,也会引入一些非线性的激活函数。这种类型的架构通常被称为Multilayer Perceptron(MLP)。接下来我们就来看一下它是如何处理眼下的这个任务的。

下面的这一段代码会帮助你下载、引入并结构化MNIST数据集。然而为了完成这部分工作,你还需要下载data.py文件,并把它放在你的工作目录(你的脚本或notebook所在的目录)下以方便导入。

Read more »

简介

神经网络技术在统计建模、数据的转换分类回归等各大领域都有很大的应用空间。但是由于计算本身的复杂性以及早期的计算能力不足,神经网络一直没有得到很大的发展。然而近几年,随着GPU计算的进步,涌现出一大批非常强大而实用的神经网络的训练框架如Caffe、Keras、CUDA convnet、Torch7等。在这片教程中,我们着重介绍另一款灵活又好用的框架:Chainer的基础使用方法。你可以通过Jupyter Notebook或是其他的python终端来跟进这篇教程。

在这篇教程中,我们将先通过编写一个简单的线性回归器来帮助你入门,然后我们再编写一个用于识别MNIST手写数字的标准的深度学习模型来让你熟悉编程逻辑。

Read more »

Abstract

This article propose an object detection system that relies on a multi-region deep convolutional neural network that also encodes sematic segmentation-aware features. The module aims at capturing a diverse set of discriminative appearance factors and exhibits localization sensitivity that is essential for accurate object localization. They exploit the above properties of their recognition module by intergrating it on an iterative localization mechanism that alternates between socring a box proposal and refgining its location with a deep CNN regression model. And consiquently, they detect objects with very high localization accuracy.

I. Introduction

The definition of object detection:

Given an image return all the instances of one or more type of objects in form of bounding boxes that tightly enclose them.

Read more »

Abstract

Cause the wealth of information available on the web keeps growing, we want to use web crawler to get them. But the traditional method has a fatal limit of its large infrastructure cost. To reduce it, we developed this method, unicrawl, which can show a performance improvement of 93.6% in terms of network bandwidth consumption, and a speedup factor of 1.75.

I. introduction

Nowadays, it’s common that to use parallel process on a large number of machines to achieve a reasonable collection time. While this method requires large computing infrastructures. Like Google and Bing, who rely on big data centers.

Read more »

Motivation

Mobile devices have revolutionized how people share photos with each other on social networks with a single click of a button.

The content of the photos people shared to the internet are rarely analyzed by the websites before the photos are made available to view. After the photos are posted on the social network to the public to view, it is close to impossible to permanently delete the uploaded photos.

Photo leakage, regretion after posting and malicious posting happens from time to time.

Read more »

版本信息:
Ubuntu15.10
Apache2.4.12
php5.6.11(zabbix3.0要求php版本至少5.4以上)
Mysql5.6.31
zabbix3.0

前言:本教程包括了ubuntu上LAMP(Linux+Apache+Mysql+Php)环境的搭建以及zabbix安装。因为我们最终是要通过外部计算机访问我们的服务器的,所以我希望你可以先运行一下“ifconfig -a”语句来查看以下自己的IP地址,以方便之后测试服务器。文中将以“IPAddr”来代替你的IP地址,阅读时请注意。
这是博主虚拟机上的IP地址:

Read more »