ML Development/ML Framework
-
Pytorch hub pytorch hub는 torch 기반 모델 publish 및 load를 지원하여 사전 학습된 모델을 손쉽게 활용할 수 있도록 도와준다. 현재 load 해서 사용할 수 있는 모델은 48개라고 돼있지만 pytorch-transformers와 같이 여러 모델들을 한 곳에 모아둔 경우도 있어 실제로는 더 다양한 모델을 사용할 수 있다. publish 및 load에 대한 자세한 방법은 아래 링크를 통해서 확인할 수 있다. torch.hub — PyTorch 1.12 documentation torch.hub Pytorch Hub is a pre-trained model repository designed to facilitate research reproducibility. Publishi..
Pytorch hub를 통해 MEAL V2 모델 사용하기Pytorch hub pytorch hub는 torch 기반 모델 publish 및 load를 지원하여 사전 학습된 모델을 손쉽게 활용할 수 있도록 도와준다. 현재 load 해서 사용할 수 있는 모델은 48개라고 돼있지만 pytorch-transformers와 같이 여러 모델들을 한 곳에 모아둔 경우도 있어 실제로는 더 다양한 모델을 사용할 수 있다. publish 및 load에 대한 자세한 방법은 아래 링크를 통해서 확인할 수 있다. torch.hub — PyTorch 1.12 documentation torch.hub Pytorch Hub is a pre-trained model repository designed to facilitate research reproducibility. Publishi..
2022.07.15 -
torch.take는 input tensor들을 1차원으로 생각해서 처리한다. 따라서 batch 단위 tensor를 처리할 때는 torch.gather를 사용하는 것이 좋다. Returns a new tensor with the elements of input at the given indices. The input tensor is treated as if it were viewed as a 1-D tensor. The result takes the same shape as the indices. 다음 예시를 통해 torch.take와 torch.gather의 차이점을 확인할 수 있다. 예시는 batch 유저별 label과 negative sample(100개)의 logits을 구하기 위한 과정이다. ..
torch.take vs torch.gathertorch.take는 input tensor들을 1차원으로 생각해서 처리한다. 따라서 batch 단위 tensor를 처리할 때는 torch.gather를 사용하는 것이 좋다. Returns a new tensor with the elements of input at the given indices. The input tensor is treated as if it were viewed as a 1-D tensor. The result takes the same shape as the indices. 다음 예시를 통해 torch.take와 torch.gather의 차이점을 확인할 수 있다. 예시는 batch 유저별 label과 negative sample(100개)의 logits을 구하기 위한 과정이다. ..
2022.05.31