服务器部署hexo博客
step1. 安装hexo 安装nodejs git Nginx hexo Linux 12345678910# 更新系统包sudo apt update && sudo apt upgrade -y# 安装nodejscurl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -sudo apt install -y nodejs# 验证安装node -vnpm -v# 安装hexosudo npm install -g hexo-cli Windows windows不用安装Nginx 访问 Node.js 官网 下载Node.js 12345# 验证安装node -vnpm -v# 安装hexonpm install -g hexo-cli 初始化hexo, 安装butterfly主题 123456# 创建hexo目录mkdir BLOG && cd BLOG# 初始化hexohexo init# 安装butterfly主题git clone -b master...
hexo deploy出现warning in the working copy of 'xxx' LF will be replaced by CRLF the next time Git touches it
1234warning: in the working copy of 'tags/画图/index.html', LF will be replaced by CRLF the next time Git touches itwarning: in the working copy of 'tags/矩阵分解/index.html', LF will be replaced by CRLF the next time Git touches itwarning: in the working copy of 'tags/离散卷积/index.html', LF will be replaced by CRLF the next time Git touches itwarning: in the working copy of 'tags/统计/index.html', LF will be replaced by CRLF the next time Git touches...
离散卷积与循环卷积
Discrete Convolution 给定两个向量,f∈R2n+1,g∈R2m+1f\in\mathbb R^{2n+1},g\in\mathbb R^{2m+1}f∈R2n+1,g∈R2m+1 f=[f−n,⋯ ,f−1,f0,f1,⋯ ,fn]g=[g−n,⋯ ,g−1,g0,g1,⋯ ,gn]\begin{gather} f = [f_{-n},\cdots,f{-1},f_0,f_1,\cdots,f_n]\\ g = [g_{-n},\cdots,g_{-1},g_0,g_1,\cdots,g_n] \end{gather} f=[f−n,⋯,f−1,f0,f1,⋯,fn]g=[g−n,⋯,g−1,g0,g1,⋯,gn] 其卷积f∗g∈R2(m+n)+1f*g\in\mathbb{R}^{2(m+n)+1}f∗g∈R2(m+n)+1为: (f∗g)k=∑i=−nnfigk−ifor k=−(m+n),⋯ ,−1,0,1,⋯(m+n)(f*g)_k = \sum_{i=-n}^nf_ig_{k-i}\quad \text{for...
hexo图片路径解决方案
前言:由于我大部分时间使用 typora进行写作。在 typora中,我使用的是如下文件结构: 1234567BLOG/├── imgs/ ├── article-1/ ├── img1.png ├── img2.png├── article-1.md├── artical-2.md 此时markdown中的图片位置为: 1 我希望实现的功能是: 我不希望使用图床,因为这会改变我在本地时的写作习惯,每次打开typora都要加载一堆图片。 我不希望对markdown中的图片位置进行大量的改动,这会增加很多工作量。 此外,由于我的博客目录和我平时的写作目录是分开的,我不需要在博客目录下对markdown的图片进行预览。 因此,大道至简,直接使用默认的source作为根目录,在其下面创建imgs文件夹,形成如下文件结构: 12345678BLOG/source/├── imgs/ ├── article-1 ├── img1.png ├── img2.png├──_posts/ ├──...
快速入门:如何在Linux服务器上跑爬虫
快速入门:在Linux服务器上部署和运行爬虫程序 服务器准备工作 购买一个服务器实例 以阿里云为例,阿里云现在有学生优惠,可以在以下链接领取:https://university.aliyun.com/ 然后租一个2核2G的服务器,仅需285元,优惠下来只需0元即可租一年,还多出来15块钱可以缴十几个G的流量钱。 绑定弹性网卡 参考: 弹性网卡概述:弹性网卡概述_云服务器 ECS(ECS)-阿里云帮助中心 (aliyun.com) 如何创建弹性网卡:如何创建弹性网卡_云服务器 ECS(ECS)-阿里云帮助中心 (aliyun.com) 绑定弹性网卡的功能: 绑定弹性网卡以访问外网 获得公网ip,从而可以ssh访问 设置安全组 参考: 安全组概述:什么是安全组_云服务器 ECS(ECS)-阿里云帮助中心 (aliyun.com) 设置安全组:如何创建一个安全组并设置安全组规则_云服务器 ECS(ECS)-阿里云帮助中心...
Strassen's Algorithm
封面来自Swift Algorithm Club: Strassen’s Algorithm | Kodeco 对于正常情况,矩阵乘法需要O(n3)\mathcal{O}(n^3)O(n3)的时间复杂度(假设m,p=nm,p=nm,p=n) 考虑分块矩阵C=ABC = ABC=AB A=[A11A12A21A22],B=[B11B12B21B22],C=[C11C12C21C22]A=\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix},\quad B=\begin{bmatrix}B_{11}&B_{12}\\B_{21}&B_{22}\end{bmatrix},\quad...
Hexo front-matter模板
hexo front matter 模板
自动微分(Automatic Differentiation)原理详解
自动微分(Automatic Differentiation) 注:该文章参考*《Automatic Differentiation in Machine Learning: a Survey》*这篇综述。这篇综述很赞,建议有能力直接阅读该综述。 任何一个由简单函数构成的复杂函数,都可以用计算图来表示。 比如函数 f(x1,x2)=ln(x1)+x1x2−sin(x2)f(x_1,x_2) = \ln(x_1)+x_1x_2-\sin(x_2) f(x1,x2)=ln(x1)+x1x2−sin(x2) 就可以用如下计算图表示: 其中,各个节点的计算关系如下图所示 接下来介绍两种自动微分的方法,分别是Forward Mode AD和Reverse Mode AD。Reverse Mode Automatic Differentiation就是我们常见的使用“前向传播”和“反向传播”求梯度的方法。 Forward Mode AD一次计算可以算出y=f(x):R→Rm\mathbf{y}=f(x):\mathbb{R}\rightarrow...
如何在PyTorch中自定义Optimizer
如何在PyTorch中自定义优化器 Optimizer类 所有优化器都继承自Optimizer类。 Optimizer初始化的时候接受params和defaults两个变量,分别是模型参数和优化器的超参。 Optimizer的变量如下: 变量名称 作用 state 储存状态变量 param_groups 储存每一组参数的值、梯度和超参 其中state是一个字典,储存的是优化器中的状态变量,比如Adam中的mtm_tmt和vtv_tvt,其结构如下: 12345678910state -- p1 -- state 1 -- Tensor -- state 2 -- ... -- state n -- p2 -- ... -- pn 假设一个模型被划分为了NNN个group,优化器有nnn个超参数,则param_groups的结构如下: 1234567891011121314151617param_groups -- param_group 1 -- params -- p1 -- data -- grad --...
Hexo+github pages部署个人博客
Hexo+github pages部署个人博客 参考: Hexo博客搭建基础教程(一) | Fomalhaut🥝 Hexo博客搭建基础教程(二) | Fomalhaut🥝 Butterfly 安裝文檔(四) 主題配置-2 | Butterfly step1. 安装Node.js和npm 访问 Node.js 官网 下载Node.js 安装完成后,可以在命令行中输入以下命令来验证安装 12node -vnpm -v step2. Hexo的安装与初始化 安装 1npm install -g hexo-cli 初始化 12cd BlogRoothexo init 安装依赖 1npm install 在本地运行Hexo服务器 1hexo server step3. 部署到github pages上 创建一个github仓库,名称必须为<username>.github.io 创建ssh密钥,一路回车 1ssh-keygen -t ed25519 -C...