예전에 학습한 모델을 다시 써볼려고 하는데 import pytorch_lightning as plimport torchimport torch.nn as nnfrom transformers import AutoTokenizer,AutoModelForSequenceClassification,BertForSequenceClassificationdevice = "cuda" if torch.cuda.is_available() else "cpu"class TextClassificationStudentModule(pl.LightningModule): def __init__(self, config, labels, lr=5e-4, alpha=1.0): super().__init__() se..
1. model이 가지는 parameter 확인하기 model에 정의된 modules가, 가지고 있는 forward 계산에 쓰일 parameter tensor가 저장되어 있음 .state_dict(), .parameters() 함수를 이용하여 저장된 parameter를 볼 수 있음 .state_dict()는 무엇이 무엇의 parameter인지 확인 가능 .parameters()는 그냥 parameter를 출력해서 뭐가 뭔지 확인은 어렵다 parameter는 weight와 bias로 이루어져있다는 것을 알 수 있다 2. parameter tensor parameter는 tensor 기반의 class 그냥 tensor가 있고, grad를 가질 수 있는 parameter tensor라는 것이 있는거임.. 이거..