In pytorch, we can use torch.nn.functional.cross_entropy() to compute the cross entropy loss between inputs and targets. In this tutorial, we will introduce how to use it.
In pytorch, we can use torch.nn.functional.one_hot() to create one hot embeddings, which is very useful in classification problem. In this tutorial, we will introduce how to use it to create.
In pytorch, we can use torch.nn.MSELoss() to compute the mean squared error (MSE). In this tutorial, we will use some examples to show you how to use it.
In this tutorial, we will use some examples to show you how to use torch.nn.AdaptiveAvgPool1d() in pytorch, which is very useful when you are building a CNN networks.
When we are install some python packages, we may need to know what the installed torch version is. In this tutorial, we will introduce you how to check.
When we are building ai model using pytorch, we may get this error: AttributeError: module ‘torch’ has no attribute ‘permute’. In this tutorial, we will introduce you how to fix it.
Pretrained bert models are usually trained in tensorflow, which can not be used in pytorch. In this tutorial, we will introduce you how to convert a tensorflow pretrained bert model to pytorch model.