ResNet 笔记
The Paper
Deep Residual Learning for Image Recognition | arxiv
Pytorch ResNet implementation from Scratch | Aladdin Persson | YouTube
Comparison of the time complexity between two blocks
2nd block of layer conv2_x in 34-layer (left block)
3x3, 64→64, strides=1, padding=1, 56x56→56x56
3x3, 64→64, strides=1, padding=1, 56x56→56x56
2nd block of layer conv2_x in 50-layer (right block)
1x1, 256→64, strides=1, padding=0, 56x56→56x56
3x3, 64→64, strides=1, padding=1, 56x56→56x56
1x1, 64→256, st ...
Pytorch常用函数
链接
项目仓库:pytorch | github
pytorch 源码:pytorch/pytorch | source code | github
torch 源码:pytorch/pytorch/torch source code | github
torchvision源码:pytorch/vision | source code | github
torch.Tensor
torch.Tensor
ways to make tensor
Uniform distribution on the interval [0,1)
torch.rand
Normal distribution with mean 0 and variance 1 (standard normal distribution)
torch.randn
Random integers generated uniformly between low (inclusive) and high (exclusive)
torch.randint
Returns a tensor filled with ...
SpringBoot项目
简介
本项目主要参考 B站 up 主三更的视频
B站最通俗易懂手把手SpringBoot+Vue项目实战-前后端分离博客项目-Java项目 | 三更草堂 | 哔哩哔哩
工程创建
IDEA > File > New > Project > Maven ArcheType
12345678910Name: JavaProjectLocation: ~\Desktop\code\JavaJDK: 1.8Catalog: InternalArchetype: org.apache.maven.archetypes:maven-archetype-quickstartversion: 1.0// Advanced SettingsGroupId: com.wenxiangArtifactId: JavaProjectversion: 1.0-SNAPSHOT
配置根目录下的 pom.xml 文件
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 ...
SpringBoot
课程
1天搞定SpringBoot+Vue全栈开发 | 刘老师教编程 | 哔哩哔哩
环境
JDK1.8 + Maven + IDEA
新建 SpringBoot 项目
注意 Spring3.0 及 Spring3.0+ 最低支持 JDK17, 如果想要创建 Java8 的项目, 在新建 Spring 项目的时候需要设置 Spring Boot 的版本为 3.0 以下.
对于已经创建好的项目, 需要在 Pom.xml 中修改 Spring 的版本为 2.0+, 以及修改对应的 Java 版本为 1.8, 然后在右侧栏的 Maven 中点击 Reload All Maven Projects.
12345678910<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.2</version> & ...
U-Net and Transposed Convolution
论文
论文原文
U-Net: Convolutional Networks for Biomedical Image Segmentation | arXiv{target="_blank"}
论文讲解
U-Net网络结构讲解(语义分割) | 霹雳吧啦Wz | 哔哩哔哩{target="_blank"}
转置卷积
移动窗口的卷积运算可以转换成矩阵乘法, 将输入图片中的像素按从左到右从上到下的顺序排列成一个列向量, 卷积核的每个窗口都可以同样排成一个行向量, 整个卷积核对应着一个矩阵, 其行数是卷积窗口的数量, 列数是输入图片的像素数.
例如, 对于 4×44\times44×4 的输入图片和 3×33\times33×3 的卷积核, 做 padding=0, strides=1 的卷积运算, 得到一个 2×22\times22×2 的输出. 将这个过程用矩阵乘法表示如下:
[y00y01y10y11]=[w0,0w0,1w0,20w1,0w1,1w1,20w2,0w2,1w2,2000000w0,0w0,1w0,20w1,0w1 ...
Vuejs笔记
课程链接
【黑马程序员vue前端基础教程-4个小时带你快速入门vue】
环境
Html 环境: Vscode + Live Server 插件
在 Vscode 中新建一个 .html 文件
12345678910<!DOCTYPE html> <!--约束,声明--><html lang="zh_CN"> <!--html标签表示html的开始--><!--lang="zh_CN"表示中文--><head> <!-- 表示头部信息,一般包含三部分内容,title标签,css样式,js代码 --> <meta charset="UTF-8"> <!--表示当前页面UTF-8字符集--> <title>Title</title> <!--表示标题,标签页上显示的文字 ...
Markdown Preview Enhanced
Markdown Preview Enhanced
[toc]
图片
使用 PicGo 插件
快捷键 Ctrl+Alt+U 从剪贴板上传
合并单元格
需要在设置中勾选
Enable Entended Table Syntax to support merging table cells
aa
bb
cc
1
2
3
1
^
1
>
3
CodeChunk
code-chunk
调用系统环境变量下的 Python 解释器
1print("Hello World!")
可以用下面的命令查看当前 Python 解释器所在路径, 方便得知其所属的虚拟环境
{cmd}12import sysprint(sys.executable)
使用 id="xxx" 和 continue="xxx" 的方式可以接着 id="xxx" 对应的代码块继续执行
12345```python{cmd id="xxx"}````` ...
卷积神经网络
简介
一些关于卷积的笔记
从MLP到CNN
网络结构
如图1所示,一个卷积神经网络由若干卷积层、Pooling层、全连接层组成。你可以构建各种不同的卷积神经网络,它的常用架构模式为:
1INPUT -> [[CONV]*N -> POOL?]*M -> [FC]*K
也就是N个卷积层叠加,然后(可选)叠加一个Pooling层,重复这个结构M次,最后叠加K个全连接层。
对于图1展示的卷积神经网络:
1INPUT -> CONV -> POOL -> CONV -> POOL -> FC -> FC
按照上述模式可以表示为:
1INPUT -> [[CONV]*1 -> POOL]*2 -> [FC]*2
也就是:N=1, M=2, K=2
三维的层结构
从图1我们可以发现卷积神经网络的层结构和全连接神经网络的层结构有很大不同。全连接神经网络每层的神经元是按照一维排列的,也就是排成一条线的样子;而卷积神经网络每层的神经元是按照三维排列的,也就是排成一个长方体的样子,有宽度、高度和深度。
对于图1展示的神经网络,我们看 ...
Pytorch笔记
Pytorch安装
安装miniconda
安装cuda(本台电脑暂时没有独立显卡,暂时跳过)
使用conda创建新的python虚拟环境
1conda create --name pytorch python=3.9
激活新的python环境
1conda activate pytorch
Note: 这里的pytorch仅仅是环境的名字, 可以修改为其它任何你喜欢的环境名.
进入Pytorch官网, 根据自己的情况进行选择, 注意如果电脑没有独显, 没有安装CUDA时请选择CPU版本
选择好后获得一串安装指令, 将其在之前创建的conda环境下运行
Note1: 此时给出的句子后有 -c pytorch参数, 这表示从官网下载, 国内速度会比较慢. 如果你已经配置好conda的下载源, 例如清华源, 阿里源等, 删去 -c pytorch 参数即可. 否则请挂VPN再执行命令.
第一次选择Conda安装失败, 无论是去掉 -c pytorch 或者不去掉, 最后都没能正常安装.
第二次选择Pip安装速度过慢30kb/s, Ctrl+C终止安装, 第三次挂梯子 ...
Gamma函数和Beta函数
Euler积分
含参积分
Γ(s)=∫0∞xs−1e−xdx,s>0\Gamma(s) = \int_{0}^\infty x^{s-1}e^{-x}\mathrm dx,\quad s > 0
Γ(s)=∫0∞xs−1e−xdx,s>0
B(p,q)=∫01xp−1(1−x)q−1dx,p>0,q>0\Beta(p,q) = \int_{0}^1 x^{p-1}(1-x)^{q-1}\mathrm d x,\quad p > 0,q > 0
B(p,q)=∫01xp−1(1−x)q−1dx,p>0,q>0
在应用中经常出现, 它们统称为Euler积分. 其中前者被称为Gamma函数, 后者称为 Beta函数.
Gamma函数
Γ(s)\Gamma(s)Γ(s)的定义域为s>0s>0s>0
Gamma函数Γ(s)\Gamma(s)Γ(s)可以写成如下两个积分的和:
Γ(s)=∫01xs−1e−xdx+∫1∞xs−1e−xdx=Φ(s)+Ψ(s)\Gamma(s) = \int_0^1 x^{s-1}e^{- ...