↓ Skip to main content
  1. Categories/

Deep-Learning

2023

2022

2021

【推荐系统】Toward the Next Generation of Recommender Systems: A Survey of the State-of-the-Art and Possible Extensions

·1797 words·4 mins
迫于生计,从今天开始学习推荐系统相关的内容,先来读一篇推荐系统领域的综述 Toward the next generation of recommender systems: a survey of the state-of-the-art and possible extensions 由于目前的工作其实偏向推荐系统的 serving、训练的开发,因此这些 paper 可能都是粗读,也不会把 paper 中的内容逐句翻译,而是找出我认为最为重要的一些概念加以记录。

2020

【施工中】torch2trt 学习笔记

·559 words·2 mins
前言 # 偶然发现了 torch2trt 的模型转换方案,思路是直接将pytorch op映射到TensorRT的python api. 在pytorch进行每个op forward的时候,tensorrt也相应往network上添加op. 这里会先涉及torch2trt的使用,后面会补充这个转换工具的代码学习

Jetson Nano踩坑记录

·3101 words·7 mins
写在前面 # 主要是需要在 jetson nano 上做模型转换,来记录下踩的坑。 目前有两条路径,一条是我们现有的转换路径,也就是 pytorch->onnx(->caffe)->trt 的路径。 在这条路径上踩了比较多的坑,最终暂时放弃,最直接的原因是 cudnn8.0 升级接口发生改动,编译 caffe 遇到较多问题。 这里其实仍然采用了两条平行的路径,一条是直接在 nano 上构建环境,另外一种是基于 docker(包括构建交叉编译环境用于加快编译速度)。

caffe 源码学习笔记(11) argmax layer

·1300 words·3 mins
背景 # 似乎没什么背景,继续看 caffe 代码。 argmax 的作用是返回一个 blob 某个维度(或者 batch_size 之后的维度)的 top_k 的 index(或者 pair(index, value))。 proto # 还是先看 proto。

caffe 源码学习笔记(10) eltwise layer

·988 words·2 mins
背景 # 这个 layer 和 reduce layer 有一些相似,就干脆一起看了。 作用是输入至少两个 blob,然后对每个 blob 中的元素做一些运算,最后得到一个 blob。 caffe 支持的运算有 “PROD”、“SUM”、“MAX” 三种。

caffe 源码学习笔记(9) reduce layer

·1251 words·3 mins
背景 # 其实没什么背景,继续啃 caffe 代码而已 2333。 reduce layer 其实就是做 reduce 操作,把一个任意 shape 的 blob 通过某种运算变成一个 scalar。 caffe 目前支持求和(SUM)、绝对值的和(ASUM)、平方和(SUMSQ),以及对得到的 scalar 的总数求平均的求和(MEAN)。

caffe 源码学习笔记(8) loss function

·1095 words·3 mins
背景 # 虽然不太care 训练的过程,但是由于容易看懂的layer都看得差不多了 所以打算看一下这些loss function. Euclidean Loss (L2 loss) # 一般用于 “real-valued regression tasks”。比如之前项目里用的人脸年龄模型,就是用了这个 Loss。

caffe 源码学习笔记(7) slice layer

·1121 words·3 mins
背景 # OCR 组那边有个 shufflenet 的网络,里面有个 pytorch op 叫 chunk,转成的 onnx 对应的 op 是 split。 作用是: Split a tensor into a list of tensors, along the specified ‘axis’. Lengths of the parts can be specified using argument ‘split’. Otherwise, the tensor is split to equal sized parts.

caffe 源码学习笔记(6) reshape layer

·1851 words·4 mins
背景 # 最近在魔改 TensorRT 的 caffe parser。 之前 caffe 模型转到 trt 模型时,有一个修改需要将 reshape layer 的 param 末尾补 1,比较繁琐,于是看了下 caffe 的 reshape layer 的实现。

caffe 源码学习笔记(5) 卷积

·2756 words·6 mins
caffe中卷积运算的实现 # 暴力实现的卷积大概是这样子的 1 2for w in 1..W 3 for h in 1..H 4 for x in 1..K 5 for y in 1..K 6 for m in 1..M 7 for d in 1..D 8 output(w, h, m) += input(w+x, h+y, d) * filter(m, x, y, d) 9 end 10 end 11 end 12 end 13 end 14end 这种方式的效率显然很低,不意外地,caffe中并不是这样实现的.

caffe 源码学习笔记(4) 激活函数

·2604 words·6 mins
在看过 caffe 代码的三个核心部分 blob、layer、net 之后,陷入了不知道以什么顺序继续看的困境。 blob、layer、net 只是三个最基本的概念,关键还是在于各个 layer。但是 layer 这么多,要怎么看呢?想了一下,决定把相同作用的 layer 放在一起分析。今天先分析一下激活函数。

Faster Rcnn 目标检测算法

·4894 words·10 mins
背景 # 2019 年对了好几次 faster rcnn,第一次是赛事之窗项目,和北京的同事对齐 sdk 和训练的实现。 第二次是被 tensorRT4 和 tensorRT5 之间默认参数不一致的问题坑了一下。 第三次是被 caffe proto 中 roi align 的默认参数坑了。

resnet 学习笔记

·1623 words·4 mins
背景 # 基于 Conv 的方法在某年的 ImageNet 比赛上又重新被人想起之后,大家发现网络堆叠得越深,似乎在 cv 的各个任务上表现得越好。 然而事情当然没有无脑堆叠深度那么简单,人们发现,当网络深到一定程度时,结果还不如浅一些的网络结构。

caffe 源码学习笔记(3) Net

·1790 words·4 mins
Net 基本介绍 # 网络通过组合与自动微分,共同定义一个函数及其梯度。 网络是由一些 Layer 组成的 DAG,也就是有向无环图,在 caffe 中通常由 prototxt 定义。 比如 1name: "LogReg" 2layer { 3 name: "mnist" 4 type: "Data" 5 top: "data" 6 top: "label" 7 data_param { 8 source: "input_leveldb" 9 batch_size: 64 10 } 11} 12layer { 13 name: "ip" 14 type: "InnerProduct" 15 bottom: "data" 16 top: "ip" 17 inner_product_param { 18 num_output: 2 19 } 20} 21layer { 22 name: "loss" 23 type: "SoftmaxWithLoss" 24 bottom: "ip" 25 bottom: "label" 26 top: "loss" 27} 定义了

caffe 源码学习笔记(2) Layer

·2896 words·6 mins
layer 整体介绍 # layer 是模型计算的基本单元, 类似于 pytorch 或者其他深度学习框架的 op。 layer 中的数据流向为:输入若干个 blob,称之为 “bottom blob”,经过 layer 的计算后,输出若干个 blob,称之为 “top blob”。

caffe 源码学习笔记(1) Blob

·1189 words·3 mins
迫于生计,开始看 caffe 代码。 会侧重于分析 inference 部分。 整体的依赖关系是:Net 由 Layer 组成,Layer 之间通过 Blob 传递数据。后面几篇会分别展开这三者。 blob 整体介绍 # blob 的含义及目的 # blob 在逻辑上表示的就是所谓的 tensor,blob 是 tensor 在 caffe 中的叫法。 在框架层面上,blob 的意义在于对数据进行封装,提供统一的接口。 这里的数据包含训练/inference 时用的数据,也包含模型参数、导数等数据。 深度学习离不开在 GPU 上的计算,blob 对数据的封装使得用户不必关心和 cuda 有关的数据传输细节。