Skip to content

PyTorch

[Machine Learning] 旋轉位置嵌入 (Rotary Position Embedding, RoPE)筆記

介紹

(備註:由於本篇文章自我個人 Hackmd 導入,所以有些符號跟 WordPress 顯示不對位,還請閱讀者多多包涵,Sorry~)

RoPE 是一種通過絕對位置編碼的方式,引入相對位置的資訊給自注意力機制(Self-Attention Mechanism)的位置嵌入。

Read More »[Machine Learning] 旋轉位置嵌入 (Rotary Position Embedding, RoPE)筆記

[PyTorch] BERT 架構實現筆記

前言

以前我的指導教授常常告訴我,不要僅僅只是使用別人的套件,一定要自己寫過才會有感覺。當時我沒有太多的時間去實現各種我感興趣的技術,光是拼出論文就已經竭盡全力了。但是直到現在仍時常回想教授的諄諄教誨,忍不住開始動手實現 BERT 這一經典架構的 encoder-only transformer 模型。

Read More »[PyTorch] BERT 架構實現筆記

[已解決] RuntimeError: view size is not compatible with input tensor’s size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(…) instead.

問題描述

在使用 PyTorch 進行深度學習模型的建設時,我們免不了一次又一次地調整神經層與輸入輸出的形狀,這顯然是每位 AI 工程師必經的道路 —— 而在 PyTorch 的形狀變換 view() 方法中,顯然存在一個有趣的小陷阱:

RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
Read More »[已解決] RuntimeError: view size is not compatible with input tensor’s size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(…) instead.

[論文閱讀] RAGAS: Automated Evaluation of Retrieval Augmented Generation

前言

2023 年是生成式 AI 大爆發的一年,各式各樣的 AI 應用層出不窮。其中在自然語言處理NLP)領域中,大型語言模型Large Language Model, LLM)絕對是最重要的技術。只要把 LLM 訓練好、減少幻覺,就會在各式各樣的任務上減少人力。

Read More »[論文閱讀] RAGAS: Automated Evaluation of Retrieval Augmented Generation