继续看yusugomori的代码,看逻辑回归。在DBN(Deep Blief Network)中,下面几层是RBM,最上层就是LR了。关于回归、二类回归、以及逻辑回归,资料就是前面转的几篇。套路就是设定目标函数(softmax损失函数),对参数求偏导数,得出权重更新公式等。

LogisticRegression.h注释如下:

class LogisticRegression
{
public:
int N; // number of input samples
int n_in; // number of input nodes
int n_out; // number of output nodes
double **W; // weights connecting the input nodes and the output nodes
double *b; // bias of the output nodes
// allocate memory and initialize the parameters
LogisticRegression(
int, // N
int, // n_in
int // n_out
);
~LogisticRegression(); public:
// train the logistic regression model, update the value of W and b
void train (
int*, // the input from input nodes in training set
int*, // the output from output nodes in training set
double // the learning rate
);
// calculate the softmax for a input vector
// dSoftMax = exp(d_i - Max) / sum_i( exp(d_i - Max) )
void softmax (
double* // the calculated softmax probabiltiy -- input & output
);
// do prediction by calculating the softmax probability from input
void predict (
int*, // the input from input nodes in testing set
double* // the calculated softmax probability
);
};

顺便提一句。从前RBM的那个注释,是在家用VS2008写的;现在这个,用CFree5.0,轻量级、编辑器操作贴心,赞一下!

【deep learning学习笔记】注释yusugomori的LR代码 --- LogisticRegression.h的更多相关文章

  1. 【deep learning学习笔记】注释yusugomori的LR代码 --- LogisticRegression.cpp

    模型实现代码,关键是train函数和predict函数,都很容易. #include <iostream> #include <string> #include <mat ...

  2. 【deep learning学习笔记】注释yusugomori的DA代码 --- dA.h

    DA就是“Denoising Autoencoders”的缩写.继续给yusugomori做注释,边注释边学习.看了一些DA的材料,基本上都在前面“转载”了.学习中间总有个疑问:DA和RBM到底啥区别 ...

  3. 【deep learning学习笔记】注释yusugomori的RBM代码 --- 头文件

    百度了半天yusugomori,也不知道他是谁.不过这位老兄写了deep learning的代码,包括RBM.逻辑回归.DBN.autoencoder等,实现语言包括c.c++.java.python ...

  4. [置顶] Deep Learning 学习笔记

    一.文章来由 好久没写原创博客了,一直处于学习新知识的阶段.来新加坡也有一个星期,搞定签证.入学等杂事之后,今天上午与导师确定了接下来的研究任务,我平时基本也是把博客当作联机版的云笔记~~如果有写的不 ...

  5. Deep Learning 学习笔记(8):自编码器( Autoencoders )

    之前的笔记,算不上是 Deep Learning, 只是为理解Deep Learning 而需要学习的基础知识, 从下面开始,我会把我学习UFDL的笔记写出来 #主要是给自己用的,所以其他人不一定看得 ...

  6. 【deep learning学习笔记】Recommending music on Spotify with deep learning

    主要内容: Spotify是个类似酷我音乐的音乐站点.做个性化音乐推荐和音乐消费.作者利用deep learning结合协同过滤来做音乐推荐. 详细内容: 1. 协同过滤 基本原理:某两个用户听的歌曲 ...

  7. Neural Networks and Deep Learning学习笔记ch1 - 神经网络

    近期開始看一些深度学习的资料.想学习一下深度学习的基础知识.找到了一个比較好的tutorial,Neural Networks and Deep Learning,认真看完了之后觉得收获还是非常多的. ...

  8. paper 149:Deep Learning 学习笔记(一)

     1. 直接上手篇 台湾李宏毅教授写的,<1天搞懂深度学习> slideshare的链接: http://www.slideshare.net/tw_dsconf/ss-62245351? ...

  9. Deep Learning 学习笔记——第9章

    总览: 本章所讲的知识点包括>>>> 1.描述卷积操作 2.解释使用卷积的原因 3.描述pooling操作 4.卷积在实践应用中的变化形式 5.卷积如何适应输入数据 6.CNN ...

随机推荐

  1. 基于visual Studio2013解决算法导论之027hash表

     题目 hash表,用链表来解决冲突问题 解决代码及点评 /* 哈希表 链接法解决冲突问题 */ #include <iostream> using namespace std; s ...

  2. iOS 打印日志的保存 (一)

    当我们真机调试app的时候,作为开发人员的我们可以很方便的通过Xcode的debug area查看相关的打印信息.而测试人员在对app进行测试的时候,一旦出现了crash,这时我们就需要把相关的打印信 ...

  3. iOS:(接口适配器3)--iPhone适应不同型号 6/6plus 前

    对于不同的苹果设备.检查每个参数<iOS:机型參数.sdk.xcode各版本号>.        机型变化 坐标:表示屏幕物理尺寸大小,坐标变大了.表示机器屏幕尺寸变大了: 像素:表示屏幕 ...

  4. ArrayList集合-[习题]--C#

    :向集合中添加10个元素,计算平均值,求最大.最小值. ; list.AddRange(, , , , , , , , }); int Max, Min; Max = Min = (]; ; i &l ...

  5. SSH框架总结(框架分析+环境搭建+实例源码下载)(转)

    首先,SSH不是一个框架,而是多个框架(struts+spring+hibernate)的集成,是目前较流行的一种Web应用程序开源集成框架,用于构建灵活.易于扩展的多层Web应用程序. 集成SSH框 ...

  6. 分析内存使用情况 (JavaScript)

    [此文档是初定版,随时可能进行更改.] JavaScript 内存分析器在 Visual Studio 2012 更新 1 和 Visual Studio 2013 中提供,旨在帮助你了解内存使用量和 ...

  7. Makefile学习(二)[第二版]

    复杂实例 #演示样例1:在上一个演示样例的基础上再添加一个可运行文件03test[改动之处已标红] .PHONY: clean all CC = gcc CFLAGS = -Wall -g BIN = ...

  8. Swift - 使用HTML5进行iOS开发(将HTML5打包成iOS应用)

    最近越来越流行使用HTML5进行跨平台应用开发,先不说运行效率如何.从人力成本来说,只要写一套html页面就可以打包发布到安卓和iOS等多个平台,确实会省下不少时间和人力(这个领导最喜欢了). 下面简 ...

  9. android 巧用资源文件(不断积累)

    1.shape的使用 <shape xmlns:android="http://schemas.android.com/apk/res/android" > <s ...

  10. 将表中null值替换成想要的值、查询某一列值为null

    用到ISNULL()函数 例如:SELECT 其他列名,ISNULL(列名,替换值)as 重命名  from 表名 (简单参考:http://www.cnblogs.com/netsa/archive ...