python-函数参数
位置参数
即遵循位置一一对应的原则
默认参数
python中的默认参数类似于 C++ 的默认参数,值得注意的是 python 默认参数的一个坑
def push_back(L=[]):
L.a ...
python-打包和解包
基本概念
解包相当于是把列表,元组之类的元素拆成一个一个元素,而打包则是反向的过程,比如
# 1
t = (4, 2, 3)
a, b, c = t
# a=4, b=2, c=3
# 2
l = ...
markdown中使用emoji
冲浪的时候怎么能不用 emoji,写文档的时候也是一样的,不过我们不可能每次都去网上粘贴,特别是一些常用的 emoji,怎么快速的打出来还是挺有用的 😡,本文介绍三种方式
第一种方式更简单点,就是在 ...
从RNN到LSTM和GRU
RNN
引入 RNN,自然涉及到原有神经网络的缺点,比如前馈神经网络的一个缺点就是,信息传递是单向的,因此当前的输出只由当前输入决定。但是很多任务不会这么简单,比如有限自动机的输出不仅和当前输入有关, ...
30-days-of-pandas
题目来源 leetcode 上的 30 天 Pandas 挑战30 天 Pandas 挑战,本文作为一个打卡记录来学习 pandas 基本用法。
pandas 基础
主要从 Joyful Pandas ...
lambda表达式
经常遇到要用 lambda 表达式的场景,于是还是总结下吧。
lambda 表达式的作用是简化代码,能给没有函数指针的编程语言提供函数式的接口(方便函数式编程,包括闭包等),创建匿名函数等。函数式编程 ...
给hexo添加评论功能
配置
这里用的是 gitalk 构建的评论区,首先需要安装,在博客根目录输入命令
npm i --save gitalk
安装后在配置文件会出现 gitalk 的配置信息,形如
# gitalk
# ...
面向对象和类图
本文记录一些面向对象的概念以及类图的规范,代码部分主要是介绍 python 中的写法。
python 中的类
类属性
python 中使用关键字 class 定义一个类。类中的属性包含两种,类属性和对 ...
cs231n-lec4
计算图
计算原理
图中的每个结点是计算的一个步骤,每个运算结点只管输入该结点的数和输出的计算结果
正向传播时,计算相对输入数的梯度,反向传播回来的时候,能通过链式法则计算处损失函数相对此处的梯度。所 ...
cs231n assignment1
作业要求
assignment1
准备工作
在 google drive 上连接 colab,可以看官网作业链接中的视频进行配置
KNN
实验只选取了num_training=5000, num_te ...