Skip to content
/ ml-lhy Public

国立台湾大学:机器学习 HUNG-YI LEE (李宏毅)

Notifications You must be signed in to change notification settings

doongz/ml-lhy

Repository files navigation

Machine Learning

Introduction

  • 所属大学:國立台灣大學
  • 授课老师:李宏毅
  • 先修要求:熟练掌握 Python
  • 编程语言:Python
  • 课程难度:🌟🌟🌟🌟
  • 预计学时:80 小时
  • 学年:Spring 2022

李宏毅老师是国立台湾大学的教授,其风趣幽默的授课风格深受大家喜爱,并且尤其喜欢在 PPT 中插入宝可梦等动漫元素,是个非常可爱的老师。

这门课挂着机器学习的牌子,但其课程内容之广实在令人咋舌,其作业一共包含 15 个 lab,分别是 Regression、Classification、CNN、Self-Attention、Transformer、GAN、BERT、Anomaly Detection、Explainable AI、Attack、Adaptation、 RL、Compression、Life-Long Learning 以及 Meta Learning。可谓是包罗万象,能让学生对于深度学习的绝大多数领域都有一定了解,从而可以进一步选择想要深入的方向进行学习。

大家也大可不必担心作业的难度,因为所有作业都会提供助教的示例代码,帮你完成数据处理、模型搭建等,你只需要在其基础上进行适量的修改即可。这也是一个学习别人优质代码的极好机会,大家需要水课程大作业的话,这里也是一个不错的资料来源。

Resources

Notes

Lecture 1: Introduction of Deep Learning

介绍了些本门课可以学到的东西

Lecture 2: What to do if my network fails to train

为什么参数越多,越容易 overfit

训练集不好

image-20230108182217458

image-20230108183339463

image-20230108183422655

image-20230108215257508

Optimization Fails

image-20230210205926945

image-20230210211430195

为什么 small batch 的效果要好,因为在另一个损失函数中就不是 critical point

image-20230210211810177

image-20230210211756412

image-20230210212251337

image-20230210214209299

image-20230210214409150

Tips for training: Adaptive Learning Rate

image-20230210221116963

客制化的 learning rate

image-20230211214337185

image-20230211214403013

Lecture 3: Image as input

cnn

image-20230205125441972

image-20230205131700429

image-20230205132102613

image-20230205132131344

深度学习好在哪

ReLU 进行叠加 + 常数可代表任何方程

image-20230108223304383

image-20230108223414917

image-20230108230226158

image-20230108232105650

Lecture 4: Sequence as input

image-20230205135807348

image-20230205142626232

step-1 从 a_i 得到 q k v 的矩阵

image-20230205143344853

step-2 K 和 Q 的矩阵乘 得到 A 矩阵

image-20230205143822509

step-3 V 和 A 的矩阵乘得到 O 矩阵

image-20230205144116182

并发能力由硬件提供,整个过程需要训练的是 q k v 的 weight 矩阵

image-20230205144211354

image-20230205151409655

image-20230205151633597

self-attention vs CNN

  • CNN 是 self-attention 的特例,CNN 的 receptive field 是固定的,self-attention 的 receptive field 是可变的,甚至是全图,甚至是可以训练的
  • 训练集小的时候 CNN 效果好些,在大训练集上 self-attention 效果更好

image-20230205152152888

self-attention vs RNN

  • RNN 中的输入是有距离的(第一个输入在最后面的计算时慢慢会被遗忘),self-attention 中所有的输入都是平等的
  • RNN 只能一个一个去算,self-attention 可以并行计算

Lecture 5: Sequence to sequence

image-20230207233649899

encoder

image-20230207233738684

decoder

image-20230208221948200

image-20230208222141298

image-20230208223416137

image-20230208225443220

training

image-20230208231147154

Tips

image-20230208231422408

Scheduled Sampling

image-20230208234349083

各式各樣的 Attention

image-20230210204520913

image-20230210204627492

image-20230210204753892

通过改变矩阵乘的顺序来降低计算量

image-20230210204834366

image-20230210204924461

Lecture 6: Generation

image-20230212171042161

image-20230212171908913

image-20230212173910051

风格迁移

image-20230212213444288

image-20230212214109109

Recent Advance of Self-supervised learning for NLP

BERT: https://leemeng.tw/attack_on_bert_transfer_learning_in_nlp.html

image-20230219213117374

image-20230219213733819

image-20230219214255436

image-20230219214731632

...

image-20230219215149932

image-20230219215547329

image-20230219220128778

Lecture 7: Self-supervised learning for Speech and Image

  1. Generative Approaches

image-20230221224028165

image-20230221224043308

image-20230221224310876

image-20230221224413124

  1. Predictive Approach

image-20230221225039622

  1. Contrastive Learning

image-20230221225737652

image-20230221230258071

Lecture 8: Auto-encoder/ Anomaly Detection

image-20230222220243772

image-20230222220925680

image-20230222223433760

Lecture 9: Explainable AI

image-20230224224032047

image-20230224225532342

image-20230224230356847

Lecture 10: Attack

白盒攻击:知道模型和模型参数,输入的图片作为参数进行训练,既能让输出为另一个东西,同时也和原图片还很相同

image-20230227230142745

image-20230227230901029

image-20230227232352463

黑盒攻击:不知道模型,用同一个数据集训练一个模型,对自己的模型进行攻击,那么训练好的输入图片,对要攻击的模型同样有效

image-20230228223103633

image-20230228225418185

image-20230228230428890

image-20230228231122088

image-20230228231305462

Lecture 11: Adaptation

image-20230302225233152

image-20230302230041993

Lecture 12: Reinforcement Learning

Lecture 13: Network Compression

Lecture 14: Life-long Learning

Lecture 15: Meta Learning

About

国立台湾大学:机器学习 HUNG-YI LEE (李宏毅)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published