继续看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解决C语言竞赛题之0501挑选素数

        题目

  2. 一步一步重写 CodeIgniter 框架 (5) —— 实现Controller,并加载Model

    CodeIgniter 框架采用MVC模式,而MVC模式中起纽带作用的就是C(控制器),在控制器的中通过加载模型获得数据,将数据传到视图中进行展示.本课将实现在控制器中加载模型. 1. 控制器的实现 ...

  3. c语言,链表

    #include "stdafx.h" #include <stdio.h> #include <stdlib.h> struct Node{ struct ...

  4. 边框圆角化方式(原文链接http://www.cnblogs.com/SJP666/p/4678730.html)

    第一种方法:如果是CSS2.2的话,可以简单写一个制作圆角矩形,分上中下裁成三张图 <title>CSS3实现圆角</title> <style type="t ...

  5. sencha touch(7)——list组件

    1.list组件是一个很强大的组件.用于以一览表的形式或者列表的形式展示应用程序中的大量的数据.该组件使用XTemplate模版来显示数据,同时与数据仓库进行绑定.所以当数据仓库中的数据发生变化的时候 ...

  6. 【C# -- OpenCV】Emgu CV 第一个实例

    原文 [C# -- OpenCV]Emgu CV 第一个实例 Emgu CV下载地址 http://sourceforge.net/projects/emgucv/files/ 找最新的下就行了,傻瓜 ...

  7. Android 代码混淆

    什么是代码混淆 Java 是一种跨平台的.解释型语言,Java 源代码编译成中间”字节码”存储于 class 文件中.由于跨平台的需要,Java 字节码中包括了很多源代码信息,如变量名.方法名,并且通 ...

  8. 终于懂了:Delphi重定义消息结构随心所欲,只需要前4个字节是消息编号就行了(有了这个,就有了主动)

    Delphi重定义消息结构随心所欲,只需要前4个字节是消息编号就行了,跟Windows消息虽然尽量保持一致,但其实相互没有特别大的关系.有了这个,就有了主动,带不带句柄完全看需要. 比如这个结构就带句 ...

  9. 基于visual Studio2013解决C语言竞赛题之1050矩阵反斜线求和

       题目 解决代码及点评 /************************************************************************/ /* 50 ...

  10. Java引用详解

    区分几个概念 ,类 .对象 .对象的引用 A  a1  = new A(); A a2 = a1; a1-------------------->对象内存<---------------- ...