2017-07-19 19:42:26 Scythe666 阅读数 20198
  • 深度学习30系统实训

    系列教程从深度学习核心模块神经网络开始讲起,将复杂的神经网络分模块攻克。由神经网络过度到深度学习,详解深度学习中核心网络卷积神经网络与递归神经网络。选择深度学习当下流行框架Tensorflow进行案例实战,选择经典的计算机视觉与自然语言处理经典案例以及绚丽的AI黑科技实战,从零开始带大家一步步掌握深度学习的原理以及实战技巧。课程具体内容包括:神经网络基础知识点、神经网络架构、tensorflow训练mnist数据集、卷积神经网络、CNN实战与验证码识别、自然语言处理word2vec、word2vec实战与对抗生成网络、LSTM情感分析与黑科技概述。

    14741 人正在学习 去看看 唐宇迪

1新智元编译1

来源:Linkedin

译者:胡祥杰

【新智元导读】本文是2016 台湾资料科学年会前导课程“一天搞懂深度学习”的全部讲义PPT(共268页),由台湾大学电机工程学助理教授李宏毅主讲。作者在文中分四个部分对神经网络的原理、目前存在形态以及未来的发展进行了介绍。深度学习的每一个核心概念在文中都有相关案例进行呈现,通俗易懂。一天的时间搞懂深度学习?其实并不是没有可能。

关注新智元,在公众号后台回复0822,可下载全部PPT(PDF版)

深度学习 ( Deep Learning ) 是机器学习 ( Machine Learning ) 中近年来备受重视的一支,深度学习根源于类神经网络 ( Artificial Neural Network ) 模型,但今日深度学习的技术和它的前身已截然不同,目前最好的语音识别和影像辨识系统都是以深度学习技术来完成,你可能在很多不同的场合听过各种用深度学习做出的惊人应用 ( 例如:最近红遍大街小巷的 AlphaGo ),听完以后觉得心痒痒的,想要赶快使用这项强大的技术,却不知要从何下手学习,那这门课就是你所需要的。

这门课程将由台大电机系李宏毅教授利用短短的一天议程简介深度学习。以下是课程大纲:

什么是深度学习

深度学习的技术表面上看起来五花八门,但其实就是三个步骤:设定好类神经网络架构、订出学习目标、开始学习,这堂课会简介如何使用深度学习的工具 Keras,它可以帮助你在十分钟内完成深度学习的程序。另外,有人说深度学习很厉害、有各种吹捧,也有人说深度学习只是个噱头,到底深度学习和其他的机器学习方法有什么不同呢?这堂课要剖析深度学习和其它机器学习方法相比潜在的优势。

深度学习的各种小技巧

虽然现在深度学习的工具满街都是,想要写一个深度学习的程序只是举手之劳,但要得到好的成果可不简单,训练过程中各种枝枝节节的小技巧才是成功的关键。本课程中将分享深度学习的实作技巧及实战经验。

有记忆力的深度学习模型

机器需要记忆力才能做更多事情,这段课程要讲解递归式类神经网络 ( Recurrent Neural Network ),告诉大家深度学习模型如何可以有记忆力。

深度学习应用与展望

深度学习可以拿来做甚么?怎么用深度学习做语音识别?怎么用深度学习做问答系统?接下来深度学习的研究者们在意的是什么样的问题呢?

本课程希望帮助大家不只能了解深度学习,也可以有效率地上手深度学习,用在手边的问题上。无论是从未尝试过深度学习的新手,还是已经有一点经验想更深入学习,都可以在这门课中有所收获。

下面是课程全部PPT,由于篇幅有限,新智元对第一部分进行了翻译:

深度学习吸引了很大的关注:

我相信,你之前肯定见到过很多激动人心的结果。图中是谷歌内部深度学习技术的使用趋势,可以看到从2015年第二季度开始,使用量呈直线上升。本讲义聚焦深度学习基础技术。

大纲:

报告第一部分:介绍深度学习

报告第二部分:关于训练深度神经网络的一些建议

报告第三部分:各种各样的神经网络

报告第四部分:下一股浪潮

报告1:深度学习介绍

深度学习有3步:神经网络架构--学习目标--学习。

这三个步骤都是以数据为基础的。

第3步:选择最佳的功能函数。

从原理上说,深度学习非常简单。

从函数的角度理解深度学习:第一步,是一个函数集;第二步,定义函数的拟合度;第三部,选择最佳函数。

人类大脑的构成

神经网络:神经元

激活函数的工作原理

不同的连接会导致不同的网络结构

完全连接的反向网络:S型网络

极深网络:从8层到19层,一直到152层。

全连接的反向网络:矩阵系统

输出层(选择)

问题:

下图中,总共有多少层?每一层有多少个神经元?

结构能自动决定吗?

第二步:学习目标,定义函数拟合度。

例子:识别“2”

训练数据:

准备训练数据:图像和相应的标签

学习目标

损失:一个好的函数应该让所有例子中的损失降到最小。

全局损失

第三步:学习!选择最佳函数。

如何选择最佳函数

梯度下降

梯度下降:综合多个参数考虑的时候,你发现什么问题了吗?

局部最小值:梯度下降从来不会保证可以获得全局最小值

反向传播

可以做什么?

第二部分:关于训练深度神经网络的一些小建议

第三部分:各种各样的神经网络

篇幅有限。200页以后PPT请在新智元公众号后台回复0822,下载浏览。

新智元Top10智能汽车创客大赛招募!

新智元于7月11日启动2016年【新智元100】人工智能创业公司评选,在人工智能概念诞生60周年之际,寻找中国最具竞争力的人工智能创业企业。

智能驾驶技术是汽车行业的重点发展方向之一,同时也是人工智能相关产业创新落地的重要赛道之一。为此新智元联合北京中汽四方共同举办“新智元Top10智能汽车创客大赛”,共同招募智能汽车相关优质创业公司,并联合组织人工智能技术专家、传统汽车行业技术专家、关注智能汽车领域的知名风投机构,共同评审并筛选出Top 10进入决赛,在2016年10月16日“国际智能网联汽车发展合作论坛”期间,进行路演、颁奖及展览活动。

如何参加【新智元Top10智能汽车创客大赛】评选

点击文章下方阅读原文,在线填写报名表。该报名表为参加评选必填资料。

如有更多介绍资料(例如BP等),可发送至xzy100@aiera.com.cn,邮件标题请注明公司名称。如有任何咨询问题,可联系微信号Kunlin1201。

评选活动时间表

创业企业报名期:即日起至2016年8月31日

专家评委评审期:2016年9月

入围企业公布期:2016年10月18日

微信号:AI_era100

2018-02-07 14:52:38 xuluohongshang 阅读数 3330
  • 深度学习30系统实训

    系列教程从深度学习核心模块神经网络开始讲起,将复杂的神经网络分模块攻克。由神经网络过度到深度学习,详解深度学习中核心网络卷积神经网络与递归神经网络。选择深度学习当下流行框架Tensorflow进行案例实战,选择经典的计算机视觉与自然语言处理经典案例以及绚丽的AI黑科技实战,从零开始带大家一步步掌握深度学习的原理以及实战技巧。课程具体内容包括:神经网络基础知识点、神经网络架构、tensorflow训练mnist数据集、卷积神经网络、CNN实战与验证码识别、自然语言处理word2vec、word2vec实战与对抗生成网络、LSTM情感分析与黑科技概述。

    14741 人正在学习 去看看 唐宇迪

相信做目标检测的同学都知道facebook已经开源了一个集成很多先进目标检测算法的库,但是官网教程主要针对采用ubuntu系统python来编译安装caffe2,由于采用深度学习服务器没有sudo权限,我花费了一天半安装GPU版的caffe2,最多的错误就是protobuff错误!!很难搞,做了很多测试才弄懂,下面做一个简单的总结,希望能帮助后来的初学者:
编译Anaconda下的Caffe2常出现的protobuff错误如下:

../lib/libcaffe2.so: undefined reference to `google::protobuf::internal::OnShutdownDestroyString(std::string const*)'
../lib/libcaffe2.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
../lib/libcaffe2.so: undefined reference to `google::protobuf::Message::ShortDebugString() const'
../lib/libcaffe2.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
../lib/libcaffe2.so: undefined reference to `google::protobuf::internal::ParseNamedEnum(google::protobuf::EnumDescriptor const*, std::string const&, int*)'
../lib/libcaffe2.so: undefined reference to `google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::string*)'
../lib/libcaffe2.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/blob_test] Error 1
make[1]: *** [caffe2/CMakeFiles/blob_test.dir/all] Error 2
Linking CXX shared module python/caffe2_pybind11_state.so
[ 92%] Built target caffe2_pybind11_state
make: *** [all] Error 2

下面,是我探索出的安装方法(仅供参考!)


Anaconda2+自建python2.7的虚拟环境:py27+Caffe2GPU版

GPU的cuda配置不再本教程范围介绍之内!请自行配置

下载anconda到用户的home路径下就不介绍了,以我的/home/slb/anaconda2为例介绍:
1.确定anconda的bin路径在普通用户的.bashrc中,如:

export PATH="/home/slb/anaconda2/bin:$PATH"

路径里不要添加如下路径,以免系统的Protobuf和conda环境的Protobuf冲突!:

#export PYTHONPATH=/usr/local:$PYTHONPATH
#export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

2.创建名为py27的conda虚拟环境,以避免与Tensorflow和老版Caffe的干扰
如下:

conda create -n py27 python=2.7

也可以自己起一个名字如叫:py27-caffe2

3.让管理员执行一下如下命令(注,这步貌似不是必须的)

# for Ubuntu 14.04
sudo apt-get install -y --no-install-recommends libgflags2
# for Ubuntu 16.04
sudo apt-get install -y --no-install-recommends libgflags-dev
sudo apt-get install -y --no-install-recommends \
      libgoogle-glog-dev \
      libgtest-dev \
      libiomp-dev \
      libleveldb-dev \
      liblmdb-dev \
      libopencv-dev \
      libopenmpi-dev \
      libsnappy-dev \
      libprotobuf-dev \
      openmpi-bin \
      openmpi-doc \
      protobuf-compiler \
      python-dev \
      python-pip     

3.安装caffe2到Caffe2_ROOT,如我的Caffe2安装在/home/slb/softwares/目录下,具体步骤是:

cd /home/slb/softwares/
git clone --recursive https://github.com/caffe2/caffe2.git && cd caffe2

激活py27的python环境,进行caffe2的编译并安装到虚拟环境的库中
source activate py27
安装依赖:

conda install -y \
    future \
    gflags \
    glog \
    lmdb \
    mkl \
    mkl-include \
    numpy \
    opencv \
    protobuf \
    snappy \
    six

再运行一遍下面指令:

conda install -y --channel https://conda.anaconda.org/conda-forge  gflags glog  numpy protobuf(这步很关键,不然会protobuf老报错!在conda安装包的时候最好指定从官网正式发布包源安装!!因为直接用conda install安装的包可能不稳定)

尤其是编译时会用到conda安装的opencv和protobuff
查看可得到的protobuf

protoc --version

显示为libprotoc 3.5.1,而不是usr/local/.下的 libprotoc即表明该虚拟环境下不是系统路径下的protobuf,但是即便有干扰我们也不怕,看下面的步骤:

cd到Caffe2目录下:

mkdir build && cd build

然后cmake到上一层目录下,即按照下面的“尝试1”进行操作(按照尝试2操作会安装失败)

尝试1:成功测试!
:成功安装的话python的site-packages目录下应该有caffe2和caffe文件夹!
cmake指令为:

~/softwares/caffe2/build$ cmake .. -DCMAKE_PREFIX_PATH=$HOME/anaconda2/envs/py27  -DCMAKE_INSTALL_PREFIX=$HOME/anaconda2/envs/py27
注:当时把py27写错了,以至于安装到其他环境了,注意粘贴时注意!

其中:

-DCMAKE_PREFIX_PATH=$HOME/anaconda2/envs/py27保证编译搜索库时先搜索虚拟环境中可用的库
-DCMAKE_INSTALL_PREFIX=$HOME/anaconda2/envs/py27保证最终的caffe2安装到你的虚拟环境的python包文件夹下

cmake输出信息:

-- GCC 4.8.4: Adding gcc and gcc_s libs to link line
-- Include NCCL operators
-- Including image processing operators
-- Excluding video processing operators due to no opencv
-- Excluding mkl operators as we are not using mkl
-- Include Observer library
-- Automatically generating missing __init__.py files.
-- 
-- ******** Summary ********
-- General:
--   CMake version         : 2.8.12.2
--   CMake command         : /usr/bin/cmake
--   Git version           : v0.8.1-1061-g5d7ef79
--   System                : Linux
--   C++ compiler          : /usr/bin/c++
--   C++ compiler version  : 4.8.4
--   Protobuf compiler     : /home/slb/anaconda2/envs/py27/bin/protoc
--   Protobuf include path : /home/slb/anaconda2/envs/py27/include
--   Protobuf libraries    : optimized;/home/slb/anaconda2/envs/py27/lib/libprotobuf.so;debug;/home/slb/anaconda2/envs/py27/lib/libprotobuf.so;-lpthread
--   CXX flags             :  -Wno-deprecated -std=c++11 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization
--   Build type            : Release
--   Compile definitions   : 
-- 
--   BUILD_BINARY          : ON
--   BUILD_DOCS            : OFF
--   BUILD_PYTHON          : ON
--     Python version      : 2.7.11
--     Python library      : /home/slb/anaconda2/envs/py27/lib/libpython2.7.so
--   BUILD_SHARED_LIBS     : ON
--   BUILD_TEST            : ON
--   USE_ATEN              : OFF
--   USE_ASAN              : OFF
--   USE_CUDA              : ON
--     CUDA version        : 8.0
--     CuDNN version       : 6.0.21
--     CUDA root directory : /usr/local/cuda
--     CUDA library        : /usr/lib/x86_64-linux-gnu/libcuda.so
--     CUDA NVRTC library  : /usr/local/cuda/lib64/libnvrtc.so
--     CUDA runtime library: /usr/local/cuda/lib64/libcudart.so
--     CUDA include path   : /usr/local/cuda/include
--     NVCC executable     : /usr/local/cuda/bin/nvcc
--     CUDA host compiler  : /usr/bin/cc
--   USE_EIGEN_FOR_BLAS    : 1
--   USE_FFMPEG            : OFF
--   USE_GFLAGS            : ON
--   USE_GLOG              : ON
--   USE_GLOO              : ON
--   USE_LEVELDB           : ON
--     LevelDB version     : 1.15
--     Snappy version      : ..
--   USE_LITE_PROTO        : OFF
--   USE_LMDB              : ON
--     LMDB version        : 0.9.21
--   USE_METAL             : OFF
--   USE_MKL               : 
--   USE_MOBILE_OPENGL     : OFF
--   USE_MPI               : ON
--   USE_NCCL              : ON
--   USE_NERVANA_GPU       : OFF
--   USE_NNPACK            : ON
--   USE_OBSERVERS         : ON
--   USE_OPENCV            : ON
--     OpenCV version      : 3.3.0
--   USE_OPENMP            : OFF
--   USE_PROF              : OFF
--   USE_REDIS             : OFF
--   USE_ROCKSDB           : OFF
--   USE_THREADS           : ON
--   USE_ZMQ               : OFF

尝试2:失败!!,虽成功编译但没有成功安装到python路径中,原因:cmake时输出信息显示:BUILD_PYTHON : OFF,在次编译查找到是因为CMAKE后面指令中的python路径指定造成的,不应该有相关的指定

cmake .. -DCMAKE_PREFIX_PATH=$HOME/anaconda2/envs/py27  -DCMAKE_INSTALL_PREFIX=$HOME/anaconda2/envs/py27 -DPYTHON_LIBRARY=$(python2 -c "from distutils import sysconfig; print(sysconfig.get_python_lib())") -DPYTHON_INCLUDE_DIR=$(python2 -c "from distutils import sysconfig; print(sysconfig.get_python_inc())")

其中:

-DCMAKE_PREFIX_PATH=$HOME/anaconda2/envs/py27保证编译搜索库时先搜索虚拟环境中可用的库
-DCMAKE_INSTALL_PREFIX=$HOME/anaconda2/envs/py27保证最终的caffe2安装到你的虚拟环境的python包文件夹下
-DPYTHON_LIBRARY=$(python2 -c "from distutils import sysconfig; print(sysconfig.get_python_lib())") -DPYTHON_INCLUDE_DIR=$(python2 -c "from distutils import sysconfig; print(sysconfig.get_python_inc())")再次保证编译时能先去激活环境下的python中找可用的libprotoc(例如当系统的libprotoc低版本时,如2.5版本的就会冲突和python中的protoc库,从而导致无法顺利安装)

cmake配置后的输出信息如下:仅供参考

-- GCC 4.8.4: Adding gcc and gcc_s libs to link line
-- Include NCCL operators
-- Including image processing operators
-- Excluding video processing operators due to no opencv
-- Excluding mkl operators as we are not using mkl
-- Include Observer library
-- 
-- ******** Summary ********
-- General:
--   CMake version         : 2.8.12.2
--   CMake command         : /usr/bin/cmake
--   Git version           : v0.8.1-1061-g5d7ef79
--   System                : Linux
--   C++ compiler          : /usr/bin/c++
--   C++ compiler version  : 4.8.4
--   Protobuf compiler     : /home/slb/anaconda2/envs/caffe2-py27/bin/protoc
--   Protobuf include path : /home/slb/anaconda2/envs/caffe2-py27/include
--   Protobuf libraries    : optimized;/home/slb/anaconda2/envs/caffe2-py27/lib/libprotobuf.so;debug;/home/slb/anaconda2/envs/caffe2-py27/lib/libprotobuf.so;-lpthread
--   CXX flags             :  -Wno-deprecated -std=c++11 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization
--   Build type            : Release
--   Compile definitions   : 
-- 
--   BUILD_BINARY          : ON
--   BUILD_DOCS            : OFF
--   BUILD_PYTHON          : OFF
--   BUILD_SHARED_LIBS     : ON
--   BUILD_TEST            : ON
--   USE_ATEN              : OFF
--   USE_ASAN              : OFF
--   USE_CUDA              : ON
--     CUDA version        : 8.0
--     CuDNN version       : 6.0.21
--     CUDA root directory : /usr/local/cuda
--     CUDA library        : /usr/lib/x86_64-linux-gnu/libcuda.so
--     CUDA NVRTC library  : /usr/local/cuda/lib64/libnvrtc.so
--     CUDA runtime library: /usr/local/cuda/lib64/libcudart.so
--     CUDA include path   : /usr/local/cuda/include
--     NVCC executable     : /usr/local/cuda/bin/nvcc
--     CUDA host compiler  : /usr/bin/cc
--   USE_EIGEN_FOR_BLAS    : 1
--   USE_FFMPEG            : OFF
--   USE_GFLAGS            : ON
--   USE_GLOG              : ON
--   USE_GLOO              : ON
--   USE_LEVELDB           : ON
--     LevelDB version     : 1.15
--     Snappy version      : ..
--   USE_LITE_PROTO        : OFF
--   USE_LMDB              : ON
--     LMDB version        : 0.9.21
--   USE_METAL             : OFF
--   USE_MKL               : 
--   USE_MOBILE_OPENGL     : OFF
--   USE_MPI               : ON
--   USE_NCCL              : ON
--   USE_NERVANA_GPU       : OFF
--   USE_NNPACK            : ON
--   USE_OBSERVERS         : ON
--   USE_OPENCV            : ON
--     OpenCV version      : 2.4.13.4
--   USE_OPENMP            : OFF
--   USE_PROF              : OFF
--   USE_REDIS             : OFF
--   USE_ROCKSDB           : OFF
--   USE_THREADS           : ON
--   USE_ZMQ               : OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/slb/softwares/caffe2/build

最后一步:

make install 

编译并把编译好的库安装到你的虚拟环境的python库中,安装成功, 最后会输入如下信息:

-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/ios/mpscnn/mpscnn_context.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/ios/mpscnn/mpscnn.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/ios/ios_caffe_defines.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/libvulkan-stub
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/libvulkan-stub/include
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/libvulkan-stub/include/libvulkan-stub.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/libvulkan-stub/include/vulkan
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/libvulkan-stub/include/vulkan/vk_platform.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/libvulkan-stub/include/vulkan/vulkan.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/libvulkan-stub/src
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/snpe
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/mobile/contrib/snpe/snpe_ffi.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/adam_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/adagrad_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/rmsprop_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/ftrl_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/iter_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/learning_rate_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/fp32_momentum_sgd_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/fp16_momentum_sgd_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/learning_rate_functors.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/yellowfin_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/sgd/momentum_sgd_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/transforms
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/transforms/pattern_net_transform.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/transforms/common_subexpression_elimination.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/transforms/single_op_transform.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/transforms/conv_to_nnpack_transform.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/cuda_rtc
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/cuda_rtc/common_rtc.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/shm_mutex
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/shm_mutex/shm_mutex.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/aten
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/aten/docs
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/aten/aten_op_template.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/warpctc
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/warpctc/ctc_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/prof
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/prof/htrace_conf.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/prof/prof_dag_stats_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/prof/prof_dag_net.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script/error_report.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script/tree_views.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script/compiler.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script/examples
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script/tree.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script/lexer.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/script/parser.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/docker-ubuntu-14.04
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/torch
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/torch/torch_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/tensorboard
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/nccl
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/nccl/cuda_nccl_gpu.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/nervana
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/nervana/nervana_c_api.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/nervana/nervana.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/nnpack
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/common.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/allgather_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/allreduce_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/common_world_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/store_handler.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/context.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/barrier_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/contrib/gloo/broadcast_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/mkl
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/operator_test
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/rnn
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/layers
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/examples
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/docs
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/helpers
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/modeling
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/pybind_state_dlpack.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/pybind_state.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/test
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/predictor
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/models
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/models/seq2seq
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/tutorials
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/tutorials/images
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/tutorials/experimental
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/tutorials/py_gen
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/mint
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/mint/templates
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/mint/static
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/mint/static/css
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/python/dlpack.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/fused_rowwise_8bit_conversion_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/softmax_shared.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/recurrent_network_blob_fetcher_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/cross_entropy_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/slice_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/reshape_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/reducer_functors.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/expand_squeeze_dims_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/elementwise_logical_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/roi_align_gradient_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/order_switch_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/zero_gradient_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/flexible_top_k.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/prepend_dim_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/string_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/boolean_unmask_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_transpose_op_mobile.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/lengths_reducer_rowwise_8bit_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/loss_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/normalize_l1_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_transpose_unpool_op_base.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/sparse_normalize_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/create_scope_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/rmac_regions_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_op_cache_cudnn.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/concat_split_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/pad_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/batch_sparse_to_dense_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/quant_decode_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/percentile_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/square_root_divide_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/map_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/local_response_normalization_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/remove_data_blocks_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conditional_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/gru_unit_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/box_with_nms_limit_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/partition_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/locally_connected_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/sequence_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/ngram_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/operator_fallback_gpu.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/prefetch_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/text_file_reader_utils.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/reduction_front_back_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/apmeter_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/math_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/generate_proposals_op_util_boxes.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/top_k.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_op_shared.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/dropout_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/lstm_unit_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/half_float_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/utility_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/accuracy_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/instance_norm_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/locally_connected_op_impl.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/one_hot_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/key_split_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/reverse_packed_segs_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/bbox_transform_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/max_pool_with_index.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/negate_gradient_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/elementwise_op_test.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/flatten_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/piecewise_linear_transform_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/sparse_to_dense_mask_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/generate_proposals_op_util_nms.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_pool_op_base.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/pack_segments.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/stop_gradient.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/roi_pool_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/spatial_softmax_with_loss_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/gather_ranges_to_dense_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/prelu_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/swish_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/pack_rnn_sequence_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/given_tensor_fill_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/relu_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/mod_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/filler_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/weighted_sample_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/assert_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/spatial_batch_norm_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_transpose_op_impl.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/summarize_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/distance_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/elementwise_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/recurrent_network_executor.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/deform_conv_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/rowmul_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/find_duplicate_elements_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/elu_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/normalize_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/margin_ranking_criterion_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_op_impl.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/do_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/channel_stats_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/accumulate_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/segment_reduction_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/tile_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/recurrent_network_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/counter_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/lengths_top_k_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/scale_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/batch_matmul_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/recurrent_op_cudnn.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/listwise_l2r_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/layer_norm_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/leaky_relu_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/multi_class_accuracy_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/find_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/tt_linear_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/while_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/dataset_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/h_softmax_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/clip_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/recurrent_network_executor_gpu.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/cast_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/sinusoid_position_encoding_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_transpose_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/recurrent_network_executor_incl.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/resize_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/lengths_reducer_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/logit_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/lpnorm_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/shape_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/onnx_while_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/load_save_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/deform_conv_op_impl.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/replace_nan_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/space_batch_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/if_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/transpose_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/matmul_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/roi_align_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/boolean_mask_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/channel_backprop_stats_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/softmax_with_loss_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/selu_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/batch_box_cox_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/pool_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/feed_blob_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/lengths_tile_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/channel_shuffle_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/lengths_reducer_fused_8bit_rowwise_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/im2col_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/minmax_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/softplus_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/perplexity_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/reduction_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/generate_proposals_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/merge_id_lists_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/elementwise_linear_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/softmax_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/no_default_engine_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/tensor_protos_db_input.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/cosine_embedding_criterion_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/conv_transpose_op_mobile_impl.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/batch_gather_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/fully_connected_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/sparse_to_dense_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/free_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/index_hash_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/rank_loss_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/operators/glu_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/python
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/fully_connected_op_sparse.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/sparse_matrix_reshape_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/tt_pad_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/sparse_funhash_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/funhash_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/fully_connected_op_decomposition.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/fully_connected_op_prune.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/experiments/operators/tt_contraction_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/distributed
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/distributed/file_store_handler_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/distributed/redis_store_handler_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/distributed/redis_store_handler.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/distributed/store_handler.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/distributed/file_store_handler.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/distributed/store_ops.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/test
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/test/assets
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/observers
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/observers/time_observer.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/observers/operator_attaching_net_observer.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/observers/runcnt_observer.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/proto
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/db
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/db/create_db_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/binaries
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/zstd
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/zstd/quant_decomp_zstd_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/observers
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/observers/net_observer_reporter_print.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/observers/perf_observer.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/observers/observer_config.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/observers/net_observer_reporter.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/binaries
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/binaries/caffe2_benchmark
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/share/contrib/nnpack
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/video
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/video/video_io.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/video/optical_flow.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/video/video_input_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/video/video_decoder.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/image
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/image/image_input_op.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/image/transform_gpu.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/mixed_utils.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/conversions.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/zmq_helper.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/math.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/cpu_neon.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/murmur_hash3.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/smart_tensor_printer.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/threadpool
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/threadpool/ThreadPool.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/threadpool/pthreadpool_impl.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/threadpool/WorkersPool.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/threadpool/ThreadPoolCommon.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/threadpool/pthreadpool.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/thread_pool.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/simple_queue.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/signal_handler.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/cblas.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/string_utils.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/cpuid.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/proto_utils.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/eigen_utils.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/cast.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/fixed_divisor.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/utils/math-detail.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/perfkernels
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/perfkernels/common.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/perfkernels/typed_axpy.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/perfkernels/cvtsh_ss_bugfix.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/perfkernels/embedding_lookup.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/perfkernels/fused_8bit_rowwise_embedding_lookup.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/core/macros.h
-- Installing: /home/slb/anaconda2/envs/py27/lib/libcaffe2.so
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/lib/libcaffe2.so"
-- Installing: /home/slb/anaconda2/envs/py27/lib/libcaffe2_gpu.so
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/lib/libcaffe2_gpu.so"
-- Installing: /home/slb/anaconda2/envs/py27/test/init_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/init_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/transform_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/transform_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/blob_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/blob_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/timer_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/timer_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/graph_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/graph_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/registry_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/registry_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/stats_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/stats_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/net_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/net_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/logging_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/logging_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/operator_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/operator_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/operator_schema_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/operator_schema_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/workspace_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/workspace_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/module_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/module_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/context_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/context_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/event_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/event_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/common_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/common_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/parallel_net_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/parallel_net_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/predictor_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/predictor_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/typeid_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/typeid_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/observer_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/observer_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/mpi_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/mpi_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/time_observer_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/time_observer_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/text_file_reader_utils_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/text_file_reader_utils_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/generate_proposals_op_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/generate_proposals_op_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/boolean_unmask_ops_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/boolean_unmask_ops_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/batch_matmul_op_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/batch_matmul_op_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/generate_proposals_op_util_boxes_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/generate_proposals_op_util_boxes_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/utility_ops_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/utility_ops_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/string_ops_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/string_ops_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/elementwise_op_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/elementwise_op_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/conv_transpose_op_mobile_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/conv_transpose_op_mobile_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/generate_proposals_op_util_nms_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/generate_proposals_op_util_nms_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/conv_op_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/conv_op_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/pattern_net_transform_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/pattern_net_transform_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/common_subexpression_elimination_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/common_subexpression_elimination_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/conv_to_nnpack_transform_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/conv_to_nnpack_transform_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/fixed_divisor_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/fixed_divisor_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/smart_tensor_printer_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/smart_tensor_printer_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/math_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/math_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/cpuid_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/cpuid_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/proto_utils_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/proto_utils_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/fatal_signal_asan_no_sig_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/fatal_signal_asan_no_sig_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/simple_queue_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/simple_queue_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/context_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/context_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/operator_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/operator_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/net_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/net_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/event_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/event_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/blob_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/blob_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/mpi_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/mpi_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/conv_op_cache_cudnn_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/conv_op_cache_cudnn_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/batch_matmul_op_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/batch_matmul_op_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/reshape_op_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/reshape_op_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/elementwise_op_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/elementwise_op_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/operator_fallback_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/operator_fallback_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/roi_align_op_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/roi_align_op_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/utility_ops_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/utility_ops_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/test/math_gpu_test
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/test/math_gpu_test"
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/proto/predictor_consts.pb.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/proto/caffe2.pb.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/proto/hsm.pb.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/proto/metanet.pb.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/proto/caffe2_legacy.pb.h
-- Installing: /home/slb/anaconda2/envs/py27/include/caffe2/proto/prof_dag.pb.h
-- Installing: /home/slb/anaconda2/envs/py27/bin/convert_caffe_image_db
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/convert_caffe_image_db"
-- Installing: /home/slb/anaconda2/envs/py27/bin/convert_db
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/convert_db"
-- Installing: /home/slb/anaconda2/envs/py27/bin/db_throughput
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/db_throughput"
-- Installing: /home/slb/anaconda2/envs/py27/bin/make_cifar_db
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/make_cifar_db"
-- Installing: /home/slb/anaconda2/envs/py27/bin/make_mnist_db
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/make_mnist_db"
-- Installing: /home/slb/anaconda2/envs/py27/bin/predictor_verifier
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/predictor_verifier"
-- Installing: /home/slb/anaconda2/envs/py27/bin/print_registered_core_operators
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/print_registered_core_operators"
-- Installing: /home/slb/anaconda2/envs/py27/bin/run_plan
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/run_plan"
-- Installing: /home/slb/anaconda2/envs/py27/bin/speed_benchmark
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/speed_benchmark"
-- Installing: /home/slb/anaconda2/envs/py27/bin/split_db
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/split_db"
-- Installing: /home/slb/anaconda2/envs/py27/bin/inspect_gpus
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/inspect_gpus"
-- Installing: /home/slb/anaconda2/envs/py27/bin/print_core_object_sizes
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/print_core_object_sizes"
-- Installing: /home/slb/anaconda2/envs/py27/bin/core_overhead_benchmark
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/core_overhead_benchmark"
-- Installing: /home/slb/anaconda2/envs/py27/bin/run_plan_mpi
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/run_plan_mpi"
-- Installing: /home/slb/anaconda2/envs/py27/bin/convert_encoded_to_raw_leveldb
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/convert_encoded_to_raw_leveldb"
-- Installing: /home/slb/anaconda2/envs/py27/bin/make_image_db
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/make_image_db"
-- Installing: /home/slb/anaconda2/envs/py27/bin/tutorial_blob
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/bin/tutorial_blob"
-- Installing: /home/slb/anaconda2/envs/py27/lib/libcaffe2_detectron_ops_gpu.so
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/lib/libcaffe2_detectron_ops_gpu.so"
-- Installing: /home/slb/anaconda2/envs/py27/lib/libcaffe2_module_test_dynamic.so
-- Removed runtime path from "/home/slb/anaconda2/envs/py27/lib/libcaffe2_module_test_dynamic.so"

以上caffe文件主要安装在虚拟环境py27目录下的bin,lib,include和test目录中!重点内容
注:若安装成功,caffe的build目录的bin目录下必须有东西!
以上如果安装成功,配置好.bashrc后,你就可以在虚拟环境py27下继续Detectron的安装了(安装指导

若以上无法顺利安装,可参考如下链接的Troubleshooting部分说明,尤其是针对Protobuf Errors的说明及解决方法:

https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile#custom-anaconda-install
https://caffe2.ai/docs/getting-started.html?platform=mac&configuration=compile#custom-anaconda-install
https://github.com/facebookresearch/Detectron/blob/master/INSTALL.md

其他可参考的解决方法:
1.conda uninstall libtiff worked for me或者sudo apt-get install libtiff4-dev

当出现opencv。。。。TIFF@错误时,可能系统中既有ananconda的opencv又有系统usr/local中的opencv或者是protobuff系统版本和conda环境中的混淆引起的!

2.Caffe2 uses protobuf as its serialization format and requires version 3.2.0 or newer. If your protobuf version is older, you can build protobuf from Caffe2 protobuf submodule and use that version instead.

To build Caffe2 protobuf submodule:

手动编译支持caffe2的Protobuf:
# CAFFE2=/path/to/caffe2
cd $CAFFE2/third_party/protobuf/cmake
mkdir -p build && cd build
#编译并安装在自己的home路径下,用于caffe2编译,如下:
cmake .. \
  -DCMAKE_INSTALL_PREFIX=$HOME/c2_tp_protobuf \
  -Dprotobuf_BUILD_TESTS=OFF \
  -DCMAKE_CXX_FLAGS="-fPIC"
make install

3.其他错误,如果大家google解决不了,可以提出来,我有时间会跟大家一起交流,共同学习!谢谢

2018-10-12 12:18:16 qq_43322041 阅读数 26
  • 深度学习30系统实训

    系列教程从深度学习核心模块神经网络开始讲起,将复杂的神经网络分模块攻克。由神经网络过度到深度学习,详解深度学习中核心网络卷积神经网络与递归神经网络。选择深度学习当下流行框架Tensorflow进行案例实战,选择经典的计算机视觉与自然语言处理经典案例以及绚丽的AI黑科技实战,从零开始带大家一步步掌握深度学习的原理以及实战技巧。课程具体内容包括:神经网络基础知识点、神经网络架构、tensorflow训练mnist数据集、卷积神经网络、CNN实战与验证码识别、自然语言处理word2vec、word2vec实战与对抗生成网络、LSTM情感分析与黑科技概述。

    14741 人正在学习 去看看 唐宇迪

技术书阅读方法论

一.速读一遍(最好在1~2天内完成)

人的大脑记忆力有限,在一天内快速看完一本书会在大脑里留下深刻印象,对于之后复习以及总结都会有特别好的作用。

对于每一章的知识,先阅读标题,弄懂大概讲的是什么主题,再去快速看一遍,不懂也没有关系,但是一定要在不懂的地方做个记号,什么记号无所谓,但是要让自己后面再看的时候有个提醒的作用,看看第二次看有没有懂了些。

二.精读一遍(在2周内看完)(并且记得看下面的博文)

有了前面速读的感觉,第二次看会有慢慢深刻了思想和意识的作用,具体为什么不要问我,去问30年后的神经大脑专家,现在人类可能还没有总结出为什么大脑对记忆的完全方法论,但是,就像我们专业程序员,打代码都是先实践,然后就渐渐懂了过程,慢慢懂了原理,所以第二遍读的时候稍微慢下来,2周内搞定。记住一句话:没看完一个章节后,总结一下这个章节讲了啥。很关键。

三.实践(在整个过程中都要)

实践的时候,要注意不用都去实践,最好看着书,敲下代码,把重点的内容敲一遍有个肌肉记忆就很不错了。

以及到自己做过的项目中去把每个有涉及的JVM虚拟机的代码,研究一遍,就可以了。

最后 附上这本书的电子版链接:

百度网盘链接:

https://pan.baidu.com/s/1lrlk8jns004xkWqc3YvmNg
提取码:8j7s

本书 《redis设计与实现》为完整版,下载即可观看。

  

附Java/C/C++/机器学习/算法与数据结构/前端/安卓/Python/程序员必读书籍书单大全:

书单导航页(点击右侧 极客侠栈 即可打开个人博客):极客侠栈

1.Web前端书单从HTML到JS到AJAX到HTTP从框架到全栈过来人帮你走更少弯路(珍藏版)

2.程序员史诗级必读书单吐血整理四个维度系列80+本书(珍藏版)

3.C++吐血整理推荐书单从入门到进阶成神之路100+本(珍藏)

4.Java学习之路吐血整理技术书从入门到进阶最全50+本(珍藏版)

5.算法与数据结构+一点点ACM从入门到进阶吐血整理推荐书单(珍藏版)

6.python从入门到进阶推荐书籍最全整理pdf分享附网盘链接已拿BT豆瓣offer

7.安卓入门到进阶推荐书籍整理pdf附网盘链接已拿阿里豆瓣offer(珍藏)

8.机器学习和python学习之路吐血整理技术书从入门到进阶(珍藏版)

9.C语言推荐书籍从入门到进阶带你走上大牛之路(珍藏版)

10.学习数据库从入门到进阶书籍pdf版吐血整理推荐(珍藏版)

11.慕课网100+份前后端/全栈教程资源近800多G超值视频资源

 

 

附网上前辈总结的热门的博文28篇干货,不分先后:最好在第二阶段(精读期间)饭前饭咀嚼一下。

1. www.cnblogs.com/jilodream/p/6147791.html

JVM内存结构---《深入理解Java虚拟机》学习总结 - 王若伊_恩赐解脱 - 博客园

 
2. bxtnicholas.iteye.com/blog/2147553

JVM虚拟机深入学习 - - ITeye博客

 
3. www.imooc.com/article/44436?block_id=tuijian_wz

Java虚拟机知识总结_慕课手记

 
4. www.cnblogs.com/smyhvae/p/4810168.html

Java虚拟机详解----JVM常见问题总结 - 千古壹号 - 博客园

 
5. www.cnblogs.com/cxzdy/p/5388509.html

Java虚拟机(JVM)体系结构概述及各种性能参数优化总结 - 五三中 - 博客园

 
6. sukangqing123.iteye.com/blog/2171547

java虚拟机内存管理机制(一):JVM内存管理总结 - - ITeye博客

 
7. blog.csdn.net/u011109589/article/details/80427142

《深入理解JVM虚拟机》读书总结 - CSDN博客

 
8. blog.csdn.net/u012208784/article/details/79551135

《深入理解JVM虚拟机》读书笔记(一) - CSDN博客

 
9. www.jianshu.com/p/2c99e6df2e75

《深入理解Java虚拟机-JVM高级特性与最佳实践》学习总结(第七章) - 简书

 
10. www.cnblogs.com/wrong5566/p/6531832.html

《深入理解Java虚拟机》读书笔记 - 吴容 - 博客园

 
11. www.jianshu.com/p/355ae3bcec41

《深入理解Java虚拟机》读书笔记 - 简书

 
12. yq.aliyun.com/articles/54440

《深入理解Java虚拟机》读书笔记-博客-云栖社区-阿里云

 
13. blog.csdn.net/aubdiy/article/details/51511130

《深入理解Java虚拟机》读后总结 (一)JVM内存模型 - CSDN博客

 
14. aub.iteye.com/blog/1872868

《深入理解Java虚拟机》读后总结(一)JVM内存模型 - AUB - ITeye博客

 
15. blog.csdn.net/hzy38324/article/details/76405201

一起走进Java虚拟机的世界 —— 为什么要弄懂虚拟机 - CSDN博客

 
16. blog.csdn.net/qq_30436259/article/details/72773002

关于JVM虚拟机 - 学习总结/笔记(浅入) - CSDN博客

 
17. ask.csdn.net/questions/183532

学习JVM虚拟机有什么实践意义?-CSDN问答

 
18. blog.csdn.net/u010814766/article/details/46785425

深入理解JVM(我的总结) - CSDN博客

 
19. blog.csdn.net/maydaysar/article/details/56839617

深入理解Java虚拟机 精华总结(面试) - CSDN博客

 
20. bestcbooks.com/B00D2ID4PK/

深入理解Java虚拟机 JVM高级特性与最佳实践(第2版) - 全本 - 免费下载 - 计算机书籍控

 
21. www.cnblogs.com/bigbigheart/p/6009565.html

深入理解Java虚拟机--个人总结 - Jugen - 博客园

 
22. blog.csdn.net/weixin_36273478/article/details/72614982

深入理解Java虚拟机之虚拟机执行子系统(读书笔记) - CSDN博客

 
23. blog.csdn.net/demonwang1025/article/details/73435517

深入理解Java虚拟机总结 - CSDN博客

 
24. www.cnblogs.com/jiangxiulian/p/7277960.html

深入理解java虚拟机 精华总结(面试)(转) - 菜鸟宝宝 - 博客园

 
25. www.cnblogs.com/JamesWang1993/archive/2018/09/03/8548763.html

深入理解java虚拟机读后总结 - 王菜鸟1993 - 博客园

 
26. blog.csdn.net/hupoling/article/details/62887251

深入理解java虚拟机读后总结(个人总结记录) - CSDN博客

 
27. www.cnblogs.com/zzt-lovelinlin/p/9087062.html

深入理解java虚拟机读后总结(个人总结记录) - 和风细雨汪汪 - 博客园

 
28. www.jianshu.com/p/248e0b949673

深入理解jvm虚拟机读书笔记 - 简书

 

 

 

 

 

G

M

T

 

 

  Detect languageAfrikaansAlbanianAmharicArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CorsicanCroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrenchFrisianGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHawaiianHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanKurdishKyrgyzLaoLatinLatvianLithuanianLuxembourgishMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPashtoPersianPolishPortuguesePunjabiRomanianRussianSamoanScots GaelicSerbianSesothoShonaSindhiSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshXhosaYiddishYorubaZulu

 

AfrikaansAlbanianAmharicArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CorsicanCroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrenchFrisianGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHawaiianHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanKurdishKyrgyzLaoLatinLatvianLithuanianLuxembourgishMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPashtoPersianPolishPortuguesePunjabiRomanianRussianSamoanScots GaelicSerbianSesothoShonaSindhiSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshXhosaYiddishYorubaZulu

 

 

 

 

 

 

 

 

 

Text-to-speech function is limited to 200 characters

 

 

 

Options : History : Feedback : Donate Close
2018-04-02 00:00:00 c9Yv2cf9I06K2A9E 阅读数 1065
  • 深度学习30系统实训

    系列教程从深度学习核心模块神经网络开始讲起,将复杂的神经网络分模块攻克。由神经网络过度到深度学习,详解深度学习中核心网络卷积神经网络与递归神经网络。选择深度学习当下流行框架Tensorflow进行案例实战,选择经典的计算机视觉与自然语言处理经典案例以及绚丽的AI黑科技实战,从零开始带大家一步步掌握深度学习的原理以及实战技巧。课程具体内容包括:神经网络基础知识点、神经网络架构、tensorflow训练mnist数据集、卷积神经网络、CNN实战与验证码识别、自然语言处理word2vec、word2vec实战与对抗生成网络、LSTM情感分析与黑科技概述。

    14741 人正在学习 去看看 唐宇迪

作者丨苏剑林

单位丨广州火焰信息科技有限公司

研究方向丨NLP,神经网络

个人主页丨kexue.fm


前几天写了文章变分自编码器VAE:原来是这么一回事,从一种比较通俗的观点来理解变分自编码器(VAE),在那篇文章的视角中,VAE 跟普通的自编码器差别不大,无非是多加了噪声并对噪声做了约束。


然而,当初我想要弄懂 VAE 的初衷,是想看看究竟贝叶斯学派的概率图模型究竟是如何与深度学习结合来发挥作用的,如果仅仅是得到一个通俗的理解,那显然是不够的。


所以我对 VAE 继续思考了几天,试图用更一般的、概率化的语言来把 VAE 说清楚。事实上,这种思考也能回答通俗理解中无法解答的问题,比如重构损失用 MSE 好还是交叉熵好、重构损失和 KL 损失应该怎么平衡,等等。


建议在阅读变分自编码器VAE:原来是这么一回事后再对本文进行阅读,本文在内容上尽量不与前文重复。


准备


在进入对 VAE 的描述之前,我觉得有必要把一些概念性的内容讲一下。 


数值计算 vs 采样计算


对于不是很熟悉概率统计的读者,容易混淆的两个概念应该是数值计算和采样计算,也有读者对三味Capsule:矩阵Capsule与EM路由出现过同样的疑惑。比如已知概率密度函数 p(x),那么 x 的期望也就定义为:



如果要对它进行数值计算,也就是数值积分,那么可以选若干个有代表性的点 x0<x1<x2<⋯<xn,然后得到:



这里不讨论“有代表性”是什么意思,也不讨论提高数值计算精度的方法。这样写出来,是为了跟采样计算对比。如果p(x) 中采样若干个点 x1,x2,…,xn,那么我们有:



我们可以比较 (2) 跟 (3),它们的主要区别是 (2) 中包含了概率的计算而 (3) 中仅有 x 的计算,这是因为在 (3) 中 xi 是从 p(x) 中依概率采样出来的,概率大的 xi 出现的次数也多,所以可以说采样的结果已经包含了 p(x) 在里边,就不用再乘以 p(xi) 了


更一般地,我们可以写出:



这就是蒙特卡洛模拟的基础。


KL散度及变分


我们通常用 KL 散度来度量两个概率分布 p(x) 和 q(x) 之间的差异,定义为:



KL 散度的主要性质是非负性,如果固定 p(x),那么 KL(p(x)‖‖‖q(x))=0⇔p(x)=q(x);如果固定 q(x),同样有 KL(p(x)‖‖‖q(x))=0⇔p(x)=q(x),也就是不管固定哪一个,最小化 KL 散度的结果都是两者尽可能相等。


这一点的严格证明要用到变分法,而事实上 VAE 中的 V(变分)就是因为 VAE 的推导就是因为用到了 KL 散度(进而也包含了变分法)。 


当然,KL 散度有一个比较明显的问题,就是当 q(x) 在某个区域等于 0,而 p(x在该区域不等于 0,那么 KL 散度就出现无穷大。


这是 KL 散度的固有问题,我们只能想办法规避它,比如隐变量的先验分布我们用高斯分布而不是均匀分布,原因便在此,这一点我们在前文变分自编码器VAE:原来是这么一回事中也提到过了。 


顺便说点题外话,度量两个概率分布之间的差异只有 KL 散度吗?


当然不是,我们可以看维基百科的 Statistical Distance 一节,里边介绍了不少分布距离,比如有一个很漂亮的度量,我们称之为巴氏距离(Bhattacharyya distance),定义为:



这个距离不仅对称,还没有 KL 散度的无穷大问题。然而我们还是选用 KL 散度,因为我们不仅要理论上的漂亮,还要实践上的可行。KL 散度可以写成期望的形式,这允许我们对其进行采样计算,


相反,巴氏距离就没那么容易了,读者要是想把下面计算过程中的 KL 散度替换成巴氏距离,就会发现寸步难行了。


本文的符号表


讲解 VAE 免不了出现大量的公式和符号,这里将部分式子的含义提前列举如下:


框架


这里通过直接对联合分布进行近似的方式,简明快捷地给出了 VAE 的理论框架。 


直面联合分布


出发点依然没变,这里再重述一下。首先我们有一批数据样本 {x1,…,xn},其整体用 x 来描述,我们希望借助隐变量 z 描述 x 的分布 p(x)



这样(理论上)我们既描述了 p(x),又得到了生成模型 p(x|z),一举两得。 


接下来就是利用 KL 散度进行近似。但我一直搞不明白的是,为什么从原作 Auto-Encoding Variational Bayes 开始,VAE 的教程就聚焦于后验分布 p(z|x) 的描述?


也许是受了 EM 算法的影响,这个问题上不能应用 EM 算法,就是因为后验分布 p(z|x) 难以计算,所以 VAE 的作者就聚焦于 p(z|x) 的推导。 


但事实上,直接来对 p(x,z) 进行近似是最为干脆的。具体来说,我们设想用一个新的联合概率分布 q(x,z) 来逼近 p(x,z),那么我们用 KL 散度来看它们的距离:



KL 散度是我们的终极目标,因为我们希望两个分布越接近越好,所以 KL 散度越小越好。由于我们手头上只有 x 的样本,因此利用 p(x,z)=p(x)p(z|x) 对上式进行改写:



这样一来利用 (4) 式,把各个 xi 代入就可以进行计算了,这个式子还可以进一步简化,因为:



而:



注意这里的 p(x) 是根据样本 x1,x2,…,xn 确定的关于 x 的先验分布(更常见的写法是 (x)),尽管我们不一定能准确写出它的形式,但它是确定的、存在的,因此这一项只是一个常数,所以可以写出:



目前最小化 KL(p(x,z)‖q(x,z)) 也就等价于最小化 L。注意减去的常数一般是负数(概率小于 1,取对数就小于 0),而 KL 散度本来就非负,非负数减去一个负数,结果会是一个正数,所以 恒大于一个某个正数。


你的VAE已经送达


到这里,我们回顾初衷——为了得到生成模型,所以我们把 q(x,z) 写成 q(x|z)q(z),于是就有:



再简明一点,那就是:



看,括号内的不就是 VAE 的损失函数吗?只不过我们换了个符号而已。我们就是要想办法找到适当的 q(x|z)q(z) 使得 L 最小化。


再回顾一下整个过程,我们几乎都没做什么“让人难以想到”的形式变换,但 VAE 就出来了。所以,没有必要去对后验分布进行分析,直面联合分布,我们能更快捷地到达终点。


不能搞分裂


鉴于 (13) 式的特点,我们也许会将 L 分开为两部分看:?zp(z|x)[−lnq(x|z)] 的期望和 KL(p(z|x)‖q(z)) 的期望,并且认为问题变成了两个 loss 的分别最小化。


然而这种看法是不妥的,我们前面已经分析了,L 会大于一个正数,这就意味着 ?zp(z|x)[−lnq(x|z)] KL(p(z|x)‖q(z)) 两部分的 loss 不可能同时为零——尽管它们每一个都有可能为 0。这也表明这两部分的 loss 其实是相互拮抗的。


所以,L 不能割裂来看,而是要整体来看,整个的 L 越小模型就越接近收敛,而不能只单独观察某一部分的 loss。


事实上,这正是 GAN 模型中梦寐以求的——有一个总指标能够指示生成模型的训练进程,在 VAE 模型中天然就具备了这种能力了,而 GAN 中要到 WGAN 才有这么一个指标。


实验


截止到上面的内容,其实我们已经完成了 VAE 整体的理论构建。但为了要将它付诸于实验,还需要做一些工作。事实上原论文 Auto-Encoding Variational Bayes 也在这部分做了比较充分的展开,但遗憾的是,网上很多 VAE 教程都只是推导到 (13) 式就没有细说了。


后验分布近似


现在 q(z),q(x|z),p(z|x) 全都是未知的,连形式都还没确定,而为了实验,就得把 (13) 式的每一项都明确写出来。 


首先,为了便于采样,我们假设 z∼N(0,I),即标准的多元正态分布,这就解决了 q(z)。那 q(x|z)p(z|x) 呢?一股脑用神经网络拟合吧


注:本来如果已知 q(x|z)q(z),那么 p(z|x) 最合理的估计应该是:



这其实就是 EM 算法中的后验概率估计的步骤,具体可以参考从最大似然到EM算法:一致的理解方式。但事实上,分母的积分几乎不可能完成,因此这是行不通的。所以干脆用一般的网络去近似它,这样不一定能达到最优,但终究是一个可用的近似。


具体来说,我们假设 p(z|x) 也是(各分量独立的)正态分布,其均值和方差由 x 来决定,这个“决定”,就是一个神经网络:



这里的 μ(x),σ^2(x) 是输入为 x、输出分别为均值和方差的神经网络,其中 μ(x) 就起到了类似 encoder 的作用。既然假定了高斯分布,那么 (13) 式中的 KL 散度这一项就可以先算出来:



也就是我们所说的 KL loss,这在上一篇文章已经给出。


生成模型近似


现在只剩生成模型部分 q(x|z) 了,该选什么分布呢?论文 Auto-Encoding Variational Bayes 给出了两种候选方案:伯努利分布或正态分布。 


什么?又是正态分布?是不是太过简化了?然而并没有办法,因为我们要构造一个分布,而不是任意一个函数,既然是分布就得满足归一化的要求,而要满足归一化,又要容易算,我们还真没多少选择。 


伯努利分布模型


首先来看伯努利分布,众所周知它其实就是一个二元分布:



所以伯努利分布只适用于 x 是一个多元的二值向量的情况,比如 x 是二值图像时(mnist 可以看成是这种情况)。这种情况下,我们用神经网络 ρ(z) 来算参数 ρ,从而得到:



这时候可以算出:



这表明 ρ(z) 要压缩到 0~1 之间(比如用 sigmoid 激活),然后用交叉熵作为损失函数,这里 ρ(z) 就起到了类似 decoder 的作用。


正态分布模型


然后是正态分布,这跟 p(z|x) 是一样的,只不过 xz 交换了位置:



这里的 μ(z),σ^2(z) 是输入为 z、输出分别为均值和方差的神经网络,μ(z) 就起到了 decoder 的作用。于是:



很多时候我们会固定方差为一个常数 σ^2,这时候:



这就出现了 MSE 损失函数。


所以现在就清楚了,对于二值数据,我们可以对 decoder 用 sigmoid 函数激活,然后用交叉熵作为损失函数,这对应于 q(x|z) 为伯努利分布;而对于一般数据,我们用 MSE 作为损失函数,这对应于 q(x|z) 为固定方差的正态分布


采样计算技巧


前一节做了那么多的事情,无非是希望能将 (13) 式明确地写下来。当我们假设 p(z|x) 和 q(z) 都是正态分布时,(13) 式的 KL 散度部分就已经算出来了,结果是 (16) 式;当我们假设 q(x|z) 是伯努利分布或者高斯分布时,−lnq(x|z) 也能算出来了。


现在缺什么呢? 采样!


p(z|x) 的作用分两部分,一部分是用来算 KL(p(z|x)q(z)),另一部分是用来算 ?zp(z|x)[lnq(x|z)] 的,而 ?zp(z|x)[lnq(x|z)] 就意味着:



我们已经假定了 p(z|x) 是正态分布,均值和方差由模型来算,这样一来,借助“重参数技巧”就可以完成采样。


但是采样多少个才适合呢?标准的 VAE 非常直接了当:一个!所以这时候 (13) 式就变得非常简单了:



该式中的每一项,可以在把 (16),(19),(21),(22) 式找到。这因为标准的 VAE 只采样了一个,所以这时候它就跟普通的 AE 对应起来了。


那么最后的问题就是采样一个究竟够了吗?事实上我们会运行多个 epoch,每次的隐变量都是随机生成的,因此当 epoch 数足够多时,事实上是可以保证采样的充分性的。我也实验过采样多个的情形,感觉生成的样本并没有明显变化。


致敬


这篇文章从贝叶斯理论的角度出发,对 VAE 的整体流程做了一个梳理。用这种角度考察的时候,我们心里需要紧抓住两个点:“分布”和“采样”——写出分布形式,并且通过采样来简化过程。


简单来说,由于直接描述复杂分布是难以做到的,所以我们通过引入隐变量来将它变成条件分布的叠加。而这时候我们对隐变量的分布和条件分布都可以做适当的简化(比如都假设为正态分布),并且在条件分布的参数可以跟深度学习模型结合起来(用深度学习来算隐变量的参数),至此,“深度概率图模型”就可见一斑了。


让我们一起致敬贝叶斯大神,以及众多研究概率图模型的大牛,他们都是真正的勇者。



点击以下标题查看相关内容: 





#作 者 招 募#


让你的文字被很多很多人看到,喜欢我们不如加入我们


          

 我是彩蛋

 解锁新功能:热门职位推荐!


PaperWeekly小程序升级啦


今日arXiv√猜你喜欢√热门职位


找全职找实习都不是问题

 

 解锁方式 

1. 识别下方二维码打开小程序

2. 用PaperWeekly社区账号进行登陆

3. 登陆后即可解锁所有功能


 职位发布 

请添加小助手微信(pwbot02)进行咨询

 

长按识别二维码,使用小程序

*点击阅读原文即可注册





关于PaperWeekly


PaperWeekly 是一个推荐、解读、讨论、报道人工智能前沿论文成果的学术平台。如果你研究或从事 AI 领域,欢迎在公众号后台点击「交流群」,小助手将把你带入 PaperWeekly 的交流群里。


▽ 点击 | 阅读原文 | 进入作者博客

2019-12-16 21:52:54 weixin_44781226 阅读数 9
  • 深度学习30系统实训

    系列教程从深度学习核心模块神经网络开始讲起,将复杂的神经网络分模块攻克。由神经网络过度到深度学习,详解深度学习中核心网络卷积神经网络与递归神经网络。选择深度学习当下流行框架Tensorflow进行案例实战,选择经典的计算机视觉与自然语言处理经典案例以及绚丽的AI黑科技实战,从零开始带大家一步步掌握深度学习的原理以及实战技巧。课程具体内容包括:神经网络基础知识点、神经网络架构、tensorflow训练mnist数据集、卷积神经网络、CNN实战与验证码识别、自然语言处理word2vec、word2vec实战与对抗生成网络、LSTM情感分析与黑科技概述。

    14741 人正在学习 去看看 唐宇迪

原题传送门
大佬讲的非常好:大佬讲LCT
看了一天的LCT,终于稍微弄懂了一些,这里有几个个人总结的tip,将来深入应该会继续加一些tip。

LCT就是一颗树,但它上面有很多很多的Splay树,LCT算是一片Splay的集合。

每一颗Splay树的键值都是它在原来树/图里面的深度(这个对理解LCT是非常重要的,是深度!是深度!是深度!)。

每一颗Splay树中的节点都必须保证:最多只有一个属于该Splay树的节点的儿子

因为LCT中有很多Splay树,所以每一颗Splay树内部用实链(例如x,y,当fa[x]=y,t[y][1/0]=x,时为实链;当fa[x]=y,t[y][1/0]!=x,时为虚链),每两颗Splay树之间连接用虚链。

Splay树中有个翻转标记,这个很重要,把它连着“键值是深度”一起想就好理解了。

还有选择一些pushdown和pushup的用法,有一些题是专门卡这些的,如果实在想不通为什么要这样更新,那就这样学模板吧(打不赢就加入,hhh)

#include<bits/stdc++.h>  // 这题初始时,没有LCT树,因为全是些节点,而且还是没有连起来的那种节点
#define lson t[x][0]
#define rson t[x][1]
using namespace std;
const int MX=3e5+9;
int fa[MX],t[MX][2],val[MX],ans[MX],st[MX],n,m;
bool r[MX];

int nroot(int x){   // 判断该x节点是否是它所属的Splay树里面的根节点
    return t[fa[x]][1]==x || t[fa[x]][0]==x ;
}

void pushup(int x){
    ans[x]=ans[lson]^ans[rson]^val[x];
}

void pushr(int x){
    swap(t[x][1],t[x][0]);
    r[x]^=1;    // 这里不直接赋值0是有道理的,可以注意一下makeroot函数
}

void pushdown(int x){    // 听巨佬说这样写可以砍掉很多的特殊情况,所以嫖一下,嘿嘿
    if( r[x] ){    // 这样写基本可以保证:当走到某一个节点x时,x的儿子可以更新,
        if( lson ) pushr(lson);   // 但儿子的儿子还没有更新
        if( rson ) pushr(rson);
        r[x]=0;
    }
}

int get(int x){    // Splay树里面的常规操作,判断x是它父树的左儿子还是右儿子
    return t[fa[x]][1]==x;    
}

void rotate(int x){
    int y=fa[x],z=fa[y],kx=get(x),ky=get(y);
    if( nroot(y) )   // 当y是该Splay树的根节点时,就不允许z的儿子只向x了,因为这里必须要用虚链
        t[z][ky]=x;    // 这里是和普通的Splay树区别的地方
    fa[x]=z;
    t[y][kx]=t[x][!kx],fa[t[x][!kx]]=y;  
    t[x][!kx]=y,fa[y]=x;
    pushup(y),pushup(x);
}

void splay(int x){
    int y=x,z=0;
    st[++z]=y;
    while( nroot(y) ){  // 我们是转到这一颗Splay树的树顶,所以判断条件是nroot(y)
        y=fa[y];    
        st[++z]=y;
    }
    while( z )             // 以x为最底下的节点,向上更新(跟着大佬学的),防止改变树结构时原来
        pushdown(st[z--]);     // 的节点还未更新这种情况
    while( nroot(x) ){
        y=fa[x],z=fa[y];
        if( nroot(y) ){   //判断y是不是顶点,再向上转
            if( (t[y][0]==x)^(t[z][0]==y) )
                rotate(x);
            else
                rotate(y);
        }
        rotate(x);
    }
    pushup(x);
}

void access(int x){
    for( int y=0 ; x ; x=fa[y] ){
        splay(x);
        rson=y;
        pushup(x);   // 这里不能忘记更新
        y=x;
    }
}

void makeroot(int x){
    access(x);
    splay(x);
    pushr(x);
}

int findroot(int x){   // 找到x节点所属LCT树的根,那么它深度必然最小,所以键值最小,也就是最右边
    access(x);
    splay(x);
    while( lson ){   // 注意是lson作为判断
        pushdown(x);   // 还要记得向下更新
        x=lson;
    }
    splay(x);
    return x;
}

void split(int x,int y){   // 把x和y放在同一颗Splay树里面,且y是根,x是最右边的那个
    makeroot(x);
    access(y);
    splay(y);
}

void link(int x,int y){
    makeroot(x);
    if( findroot(y)!=x )    // 只有它们不在同一颗LCT中才能连,不然就形成了环
        fa[x]=y;   // 没有说过子树一颗二叉树,它可以有很多子节点
}

void cut(int x,int y){
    makeroot(x);
    if( findroot(y)==x && fa[y]==x && !t[y][0] ){     // 这个!t[y][0]千万不可以漏掉,因为
        fa[y]=t[x][1]=0;   // t[y][0]=0,可以保证比x(键值,也就是深度)大的只有y,否则就表明x和y
        pushup(x);   // 之间还有其它的节点,还有记得更新
    }
}

int main()
{
    //freopen("input.txt","r",stdin);
    scanf("%d %d",&n,&m);
    for( int i=1 ; i<=n ; i++ )
        scanf("%d",&val[i]);
    while( m-- ){
        int order,x,y;
        scanf("%d %d %d",&order,&x,&y);
        if( order==0 ){
            split(x,y);
            printf("%d\n",ans[y]);
        }
        else if( order==1 ) link(x,y);
        else if( order==2 ) cut(x,y);
        else if( order==3 ){splay(x);val[x]=y;}   // 更新某个节点的值时,一定要放在该Splay树的
    }							// 根节点上再改变
    return 0;
}

一天搞懂深度学习

阅读数 1916

一天搞懂深度学习

博文 来自: seanliu96
没有更多推荐了,返回首页