PyTorch教程學習總結
05-14
1.一些重要的概念
Tensor
autograd
Variable
nn -- high-level abstraction
使用nn.optim時,requires_grad設為False,意為freeze some layers
載入數據使用datasets loader
2.一些操作
Tensor.topkto get the index of the greatest value:
def categoryFromOutput(output): top_n, top_i = output.data.topk(1) # Tensor out of Variable with .data category_i = top_i[0][0] return all_categories[category_i], category_iprint(categoryFromOutput(output))
nn.LogSoftmax對應的loss是criterion = nn.NLLLoss()
nn.LSTM
nn.GRU
3.遇到的坑
在測試pytorch-yolo2的時候,發現這個錯誤,已解決
PyTorch socket.error [Errno 111] Connection refused
References
[1] Pytorch中文文檔.
推薦閱讀:
※Pytorch學習體會(二)
※DenseNet論文翻譯及pytorch實現解析(下)
※Conda command not found
※PyTorch發布一年團隊總結:運行資源降低至十分之一,單機王者
TAG:PyTorch |
