现在的位置: 首页 > 综合 > 正文

我的草稿本

2018年11月02日 ⁄ 综合 ⁄ 共 7880字 ⁄ 字号 评论关闭

My notebook

###################################################Notebook##################################################################

T 记:学习神经网络已X天,只学过几个数据挖掘上面的几个算法,我说要学习神经网络的时候,老师问我数学怎么样,现在知道其话之内涵了。

1:先让看BP,RBM(超级推荐:http://blog.csdn.net/itplus/article/category/1451403),自编码,DBN。

2:抽空看了看:CNN,HMM,softmax回归。

3:抽样:CD,吉布斯

4:知道了theano底层是用GPU对科学技术做优化。CUDA编程完全不会。

######################################################################################

5:神经网络一些常用的数据集。minist10,cifar-10/100,imagenet。

imagenet比赛内容分两块:

1):对图片分类。(2014年比赛主要采用CNN卷积神经网络,CAFFE框架)

2):对图片上的物体进行检测。(检测主要采用R-CNN,有开源代码。

          http://m.blog.csdn.net/blog/wchenriwei2/38110387)

对比赛结果总结的一些讨论:

http://www.zhihu.com/question/24904450

6:神经网络框架和计算更新太快了:

计算:

GPU,参数服务器(14年底还在编写更新中)

框架:

convnet-cnn

caffe      (http://www.lupaworld.com/article-250356-1.html)

cxxnet   (15年刚出来)    (http://www.zhihu.com/question/28493546/answer/41806910)

注意:convnet-cnn和caffe都是cnn的代码,只是caffe比其易懂。

注意事项:

1:区分马可夫链模型和隐马可夫链的区别。

2:注意单变量和多变量高斯混合模型的区别。

PS:我看算法都是不求甚解,看个大概用法,很多推导步骤忽略了。

3:没看的丫:PCA(主成分分析),白化

4:为什么神将网络常用sigmoid函数:抑制两头,对中间细微变化敏感,使NN对特征识别度更好。

5:体会感知机,逻辑回归和SVM之间的你你我我关系。(http://www.cnblogs.com/jerrylead/archive/2011/03/13/1982684.html 和李航统计)


不错的连接

         1:UFLDL教程  (此教程作为深度学习入门主线)  

                                                                                               地址: http://deeplearning.stanford.edu/wiki/index.php/UFLDL教程


       2:DeepLearning
0.1 documentation
(python 深度学习官网文档,包含深度学习解释与代码,都是用theano写的

 
                                                                                               地址:http://deeplearning.net/tutorial/contents.html         

 
      3:python Module Index(python 包讲解)

 
                                                                                               地址:http://deeplearning.net/software/theano/py-modindex.html)

 
                                 

         4:CNN  (Deep Learning (深度学习)学习笔记整理系列之(七)地址:http://blog.csdn.net/zouxy09/article/details/8781543     )

              (Deep Learning 系列(3):CNN (卷及神经网络)             地址:http://blog.csdn.net/hanzihan123/article/details/38048915)

               (Deep
learning:三十八(Stacked CNN简单介绍)
    地址:http://www.cnblogs.com/tornadomeet/archive/2013/05/05/3061457.html  )

            5:回归(主要区分一般回归和逻辑回归区别)

                 一般来说,回归不用在分类问题上,因为回归是连续型模型,而且受噪声影响比较大。如果非要应用进入,可以使用logistic回归。

        前者可以拟合一条曲线,逻辑回归主要用于二分类问题,一般线性回归可以通过sigmoid函数转化为二分类问题,具体见下面地址。

        地址:http://www.cnblogs.com/jerrylead/archive/2011/03/05/1971867.html


        7:adaboost算法的大致流程。

      说实话,它和神经网络有点相似,不断地调整参数W值,不过这里给每个分类器计算一个重要程度的权值。

                     

#####################################################Q

音频相关:

采用深度学习算法为Spotify做基于内容的音乐推荐        http://www.csdn.net/article/2015-02-10/2823907

http://benanne.github.io/2014/08/05/spotify-cnns.html


《凸优化理论》http://benanne.github.io/2014/08/05/spotify-cnns.html

区######################################################

Q4:机器学习十大算法

1:C4.5 决策树

2:The K-means algorithm

3:SVM 支持向量机

4:Apriori 算法

5:EM 最大期望算法

6:PageRank算法

7:Adaboost (Adaptive boosting)算法  可以参考:李航统计学习方法

8:K-nearest neighbor classification (K邻近算法)

9:byaes (贝叶斯)分类型

10:CART(分类与回归树) Classification And Regression Trees

Address:


From:http://www.open-open.com/doc/view/3bb6b3a9edc348aa992a861ab61b44df

##############################################################################################################

O4:如何提升训练速度

在CPU上训练,慢的要死,那么怎么提速呢?

1:用GPU,那么python包theano是个比较不错的编程接口。其封装CUDA接口,可以在GPU上跑。

2:分布式,多线程等技术来搞,看到下面网站,都是java上搞得,不想看。

Apache Mahout 在hadoop上:http://www.ibm.com/developerworks/cn/java/j-mahout/

DL4J

Deep Learning for Java:http://deeplearning4j.org/

##############################################################################################################################

Q3:Python多线程如何在多核上运行

因Python的多线程无法增加CPU的利用率。(详细参考: http://my.oschina.net/u/240562/blog/136651)

解决办法:

可将函数编译为DLL文件,如:

extern"C" _declspec(dllexport) void DeadLoop()

{

   while (true);

}

然后在python中调用:

fromctypes import *

fromthreading import Thread


lib= cdll.LoadLibrary(r"dead_loop.dll")

t =Thread(target=lib.DeadLoop)

t.start()

lib.DeadLoop() 

python的多线程便可实现与C中多线程一样的利用率。

##############################################################################################################################

Q1:神经网络中训练数据集,验证数据集和测试数据集区别?

whats the diference between train, validation and test set, in neural networks?

Answer:

The training and validation sets are used during training.

伪代码可充分说明:                           #momentum factor动量因子   (比如权值动量因子)

for each epoch
    for each training data instance
        propagate error through the network
        adjust the weights
        calculate the accuracy over training data
    for each validation data instance
        calculate the accuracy over the validation data
    if the threshold validation accuracy is met
        exit training
    else
        continue training

Once you're finished training, then you run against your testing set and verify that the accuracy is sufficient.

Training Set: this data
set is used to adjust the weights on the neural network.

Validation Set: this data
set is used to minimize overfitting. You're not adjusting the weights of the network with this data set, you're just verifying that any increase in accuracy over the training data set actually yields an increase in accuracy over a data set that has not been
shown to the network before, or at least the network hasn't trained on it (i.e. validation data set). If the accuracy over the training data set increases, but the accuracy over then validation data set stays the same or decreases, then you're overfitting
your neural network and you should stop training.

Testing Set: this data
set is used only for testing the final solution in order to confirm the actual predictive power of the network.

From:http://stackoverflow.com/questions/2976452/whats-the-diference-between-train-validation-and-test-set-in-neural-networks

This is very good page, you should look it again.   

   

Q2:Early-Stopping(提前结束训练)

Problem:神经网络并非训练时间越长,迭代次数越多,网络参数调整的越好。一般会有几种情况提前结束:

1:设置迭代次数,如果次数到达则结束。

2:设置验证集上的正确率,比如99%,如果到达这个正确率,也可以提前结束。

3:下面讲到的根据几何增长的耐心量(直接翻译)

Early-stopping combats overfitting by monitoring the model’s performance on avalidation set. A validation set is a set of examples that we never use for gradient descent, but which is also not a part of the test set. The validation
examples are considered to be representative of future test examples. We can use them during training because they are not part of the test set. If the model’s performance ceases to improve sufficiently on the validation set, or even degrades with
further optimization, then the heuristic implemented here gives up on much further optimization.

The choice of when to stop is a judgement call and a few heuristics exist, but these tutorials will make use of a strategybased on a geometrically increasing amount of patience.(根据几何增长的耐心或等待量)

参考http://deeplearning.net/tutorial/gettingstarted.html,中的源代码,讲一下我的理解。

我的理解:

1:设置验证集的频率(即迭代多少次minibatch进行一次验证集的测试,计算出整个测试集的错误率)

2:设置一个最好的错误率,这个错误率可以经过验证集的错误率及时的不断调整。如果在第N次验证时,错误率有明显的减小,说明网络需要调整还不是很充分,以几何速度调整patience的值。如下代码:

if (this_validation_loss < best_validation_loss * improvement_threshold):
                    patience = max(patience, iter * patience_increase)


这个patience可以表征网络调整的怎么样,当网络一直验证集上的错误率值一直都是很小幅度或者停止不进的更改,那么这个值不会调整,它将很快超过minibatch的次数,那么就停止训练。代码如下:

if patience <= iter:

     done_looping = True


验证频率设置:

The validation_frequency should
always be smaller than the 
patience.
The code should check at least two times how it performs before running out of patience. This is the reason we used the formulation 
validation_frequency = min( value, patience/2.)

##############################################################################################################


操作系统:
Q3:虚拟内存别名为虚拟存储器,主要用于页面对换。参考操作系统教材P132页。

确定从何处调入页面

在请求分页系统中的外存分为两部分:用于存放文件的文件区和用于存放对换页面的

对换区。通常,由于对换区是采用连续分配方式,而文件区是采用离散分配方式,故对换

区的磁盘 I/O 速度比文件区的高。 这样, 每当发生缺页请求时, 系统应从何处将缺页调入内

存,可分成如下三种情况:

(1)  系统拥有足够的对换区空间, 这时可以全部从对换区调入所需页面,以提高调页速

度。为此,在进程运行前,便须将与该进程有关的文件从文件区拷贝到对换区。

(2)  系统缺少足够的对换区空间, 这时凡是不会被修改的文件都直接从文件区调入; 而

当换出这些页面时,由于它们未被修改而不必再将它们换出,以后再调入时,仍从文件区

直接调入。但对于那些可能被修改的部分,在将它们换出时,便须调到对换区,以后需要

时,再从对换区调入。

(3)  UNIX 方式。由于与进程有关的文件都放在文件区,故凡是未运行过的页面,都应

从文件区调入。而对于曾经运行过但又被换出的页面,由于是被放在对换区,因此在下次

调入时,应从对换区调入。由于 UNIX 系统允许页面共享,因此,某进程所请求的页面有

可能已被其它进程调入内存,此时也就无须再从对换区调入。

################################################################################################################

数据库:

Q1:Group by,Having 和 Order by的区别

http://wenku.baidu.com/link?url=1Og3q8yhNro9UfhnFF0Sf-2_tTSxD3b6KdcR6ufuw7R99_n0G2g7hHBLLWeETTquT8AzNUMpSHSNgE5pXvxilG3Uhv8rMN0XpRDLHeDJ3aK

Q2:聚簇索引,非聚簇索引,组合索引的含义和用途

http://wzfjesun.blog.163.com/blog/static/14245693920106824737546/

Q3:聚集索引和非聚集索引区别

http://blog.csdn.net/jacky4955/article/details/8020019

它是根据数据存储的形式划分的,聚集索引的具体数据在磁盘上是有序的,而另外一个是无顺序的。

他们有相同的B-Tree结构


抱歉!评论已关闭.