模式识别与深度学习作业(一)

本文介绍了如何寻找包含所有样本的最小超球体问题,通过构建Lagrange函数并进行对偶问题转换,利用Kuhn-Tucker定理推导出最优解的条件,最终得出球心坐标c和半径r的表达式,解决了一个与SVM类似的问题。
摘要由CSDN通过智能技术生成

The smallest enclosing hypersphere

问题描述

样本集: S = { x 1 , x 2 , … , x l } \mathbb{S} = \{\boldsymbol{x}_1, \boldsymbol{x}_2, \dots, \boldsymbol{x}_l\} S={ x1,x2,,xl}
要求寻找一个包含所有样本的最小超球体:
min ⁡ c , r r 2 s . t . ∣ ∣ x i − c ∣ ∣ 2 − r 2 ≤ 0 \min_{\boldsymbol{c},r} r^2 \quad \mathrm{s.t.}||\boldsymbol{x}_i - \boldsymbol{c}||^2 - r^2 \le 0 c,rminr2s.t.xic2r20
如下图:

  1. 仿照本章SVM的推导,构建Lagrange函数,推导其关于 α \boldsymbol{\alpha} α的凸二次规划形式。
  2. α \boldsymbol{\alpha} α最优解为 α ∗ = { α 1 ∗ , α 2 ∗ , … , α l ∗ } \boldsymbol{\alpha}^* = \{\alpha_1^*, \alpha_2^*, \dots, \alpha_l^*\} α={ α1,α2,,αl},求半径 r r r与球心坐标 c \boldsymbol{c} c

求解过程

  1. 首先类似SVM的Lagrange函数构造过程,构造如下Lagrange函数:
    L ( c , r , α ) = r 2 + ∑ i = 1 l α i ( ∣ ∣ x i − c ∣ ∣ 2 − r 2 ) L(\boldsymbol{c}, r ,\boldsymbol{\alpha}) = r^2 + \sum_{i=1}^{l}{\alpha_i(||\boldsymbol{x}_i - \boldsymbol{c}||^2 - r^2)} L(c,r,α)=r2+i=1lαi(xic2r2)
    要求
    min ⁡ c , r r 2 \min_{\boldsymbol{c}, r} r^2 c,rminr
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
深度学习之卷积神经网络CNN做手写体识别的VS代码。支持linux版本和VS2012版本。 tiny-cnn: A C++11 implementation of convolutional neural networks ======== tiny-cnn is a C++11 implementation of convolutional neural networks. design principle ----- * fast, without GPU 98.8% accuracy on MNIST in 13 minutes training (@Core i7-3520M) * header only, policy-based design supported networks ----- ### layer-types * fully-connected layer * convolutional layer * average pooling layer ### activation functions * tanh * sigmoid * rectified linear * identity ### loss functions * cross-entropy * mean-squared-error ### optimization algorithm * stochastic gradient descent (with/without L2 normalization) * stochastic gradient levenberg marquardt dependencies ----- * boost C++ library * Intel TBB sample code ------ ```cpp #include "tiny_cnn.h" using namespace tiny_cnn; // specify loss-function and optimization-algorithm typedef network CNN; // tanh, 32x32 input, 5x5 window, 1-6 feature-maps convolution convolutional_layer C1(32, 32, 5, 1, 6); // tanh, 28x28 input, 6 feature-maps, 2x2 subsampling average_pooling_layer S2(28, 28, 6, 2); // fully-connected layers fully_connected_layer F3(14*14*6, 120); fully_connected_layer F4(120, 10); // connect all CNN mynet; mynet.add(&C1); mynet.add(&S2); mynet.add(&F3); mynet.add(&F4); assert(mynet.in_dim() == 32*32); assert(mynet.out_dim() == 10); ``` more sample, read main.cpp build sample program ------ ### gcc(4.6~) without tbb ./waf configure --BOOST_ROOT=your-boost-root ./waf build with tbb ./waf configure --TBB --TBB_ROOT=your-tbb-root --BOOST_ROOT=your-boost-root ./waf build with tbb and SSE/AVX ./waf configure --AVX --TBB --TBB_ROOT=your-tbb-root --BOOST_ROOT=your-boost-root ./waf build ./waf configure --SSE --TBB --TBB_ROOT=your-tbb-root --BOOST_ROOT=your-boost-root ./waf build or edit inlude/config.h to customize default behavior. ### vc(2012~) open vc/tiny_cnn.sln and build in release mode.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值