nGPT pytorch
0.2.7
การใช้งาน nGPT อย่างรวดเร็ว โดยเรียนรู้ทั้งหมดบนไฮเปอร์สเฟียร์จาก NvidiaAI คำถามก็คือว่าพวกเขาสูญเสียการแสดงออกใดๆ ที่ถูกซุกไว้ใต้พรมหรือไม่ แต่ฉันจะรับไว้ด้วยความสุจริตใจ
เครือข่ายประเภทนี้ควรได้รับการศึกษาในบริบทของการเรียนรู้อย่างต่อเนื่องและการสูญเสียความเป็นพลาสติก
การปรับตัวให้เข้ากับ Vision Transformer อยู่ที่นี่แล้ว
$ pip install nGPT-pytorch
import torch
from nGPT_pytorch import nGPT
model = nGPT (
num_tokens = 256 ,
dim = 512 ,
depth = 4 ,
attn_norm_qk = True
)
x = torch . randint ( 0 , 256 , ( 2 , 2048 ))
loss = model ( x , return_loss = True )
loss . backward ()
logits = model ( x ) # (2, 2048, 256)
เอนวิก8
$ python train.py
@inproceedings { Loshchilov2024nGPTNT ,
title = { nGPT: Normalized Transformer with Representation Learning on the Hypersphere } ,
author = { Ilya Loshchilov and Cheng-Ping Hsieh and Simeng Sun and Boris Ginsburg } ,
year = { 2024 } ,
url = { https://api.semanticscholar.org/CorpusID:273026160 }
}
@article { Luo2017CosineNU ,
title = { Cosine Normalization: Using Cosine Similarity Instead of Dot Product in Neural Networks } ,
author = { Chunjie Luo and Jianfeng Zhan and Lei Wang and Qiang Yang } ,
journal = { ArXiv } ,
year = { 2017 } ,
volume = { abs/1702.05870 } ,
url = { https://api.semanticscholar.org/CorpusID:1505432 }
}
@inproceedings { Zhou2024ValueRL ,
title = { Value Residual Learning For Alleviating Attention Concentration In Transformers } ,
author = { Zhanchao Zhou and Tianyi Wu and Zhiyun Jiang and Zhenzhong Lan } ,
year = { 2024 } ,
url = { https://api.semanticscholar.org/CorpusID:273532030 }
}