Pytorch學習筆記

教學視頻

張量

【物理学札记XII】电动力学1:指标运算与张量初步

Tensor for beginners 张量入门课程 中英字幕 高阶张量分析链接在简介中

Tensor Calculus张量分析/张量计算 中英双字幕

什麼是場: 場就是collection of variable, 向量場就是collection of vector, 張量場collection of tensor 梯度(gradient): 就是純量場跟向量場之間的轉換

Pytorch

《PyTorch深度学习实践》完结合集

可以安裝scikit learn,裡面有數據可以訓練 ~/anaconda3/envs/env_pytorch/lib/python3.8/site-packages/sklearn/datasets/data

Python人工智能20个小时玩转NLP自然语言处理【黑马程序员】

卷積層/池化層輸入輸出大小

卷積層/池化層輸入輸出大小

LLM

《从零开始用Python搭建LLM模型|Create a LLM from Scratch with Python – Tutorial》

黑馬程序員講義

黑馬程序員講義

github資源

fcc-intro-to-llms

Pytorch 函數列表

Pytorch 函數列表

安裝

安裝matplotlib/numpy/pylzma/jupyter/ipyparallel

1
2
python -m pip install -U matplotlib numpy pylzma jupyter ipyparallel

安裝pytorch pytorch官網

1
pip3 install torch torchvision torchaudio

啟動jupyter

輸入

1
jupyter notebook

LLM訓練用資料

Project Gutenberg

Jupyter %time %%time

Jupyter 時間計算

shape 用法

可以理解為tensor的維度 shape 用法 shape 的理解

torch.stack 用法

torch.stack 用法

self 用法

self 用法

nn.Module 跟 super() 用法

pytorch官方解釋 知乎上的解釋

super()是用來繼承父類 super() 用法 super()是用來繼承父類

nn.Embedding

知乎上的解釋

Tokenization 跟 Embedding

从词到数:Tokenizer与Embedding串讲 怎么形象理解embedding这个概念?

view() 用法

重新調整tensor形狀 view() 用法

Loss Function 損失函數

Loss Function 損失函數

什麼是logits

什麼是logits百度

什麼是logits知乎

神經網絡的結構

神经网络的层次结构:输入、中间与输出层解析 神经网络基础内容--输入、隐藏、输出三层及激活、损失、优化函数简单介绍

Cross Entropy

cross entropy 是實際entropy跟理論entropy的誤差,cross entropy越小,代表算出來的值約真實 Cross Entropy 机器学习:手撕 cross-entropy 损失函数