Skip to content

Python

[Solved][PyCharm] An ERROR occurred when Adding a New Virtual Environment: ModuleNotFoundError: No module named 'distutils.core'

In yesterday I installed a new operating system in my device, and downloaded an PyCharm IDE for programming. But when I configure a new Interpreter in virtual environment, I got an error message:

Read More »[Solved][PyCharm] An ERROR occurred when Adding a New Virtual Environment: ModuleNotFoundError: No module named 'distutils.core'

[PyTorch] Set the threshold of Sigmoid output and convert it to binary value

When using sigmoid function in PyTorch as our activation function, for example it is connected to the last layer of the model as the output of binary classification. After all, sigmoid can compress the value between 0-1, we only need to set a threshold, for example 0.5 and you can divide the value into two categories.

Read More »[PyTorch] Set the threshold of Sigmoid output and convert it to binary value

[PyTorch] Convert Tensor to One-Hot Encoding Type

Today if you are preprocessing some machine learning data, maybe you need to convert PyTorch tensor to one-hot encoding type. There is a intuitive method that is convert TENSOR to NUMPY-ARRAY, and then convert NUMPY-ARRAY to one-hot encoding type, just like this article: [Python] Convert the value to one-hot type in Numpy

Read More »[PyTorch] Convert Tensor to One-Hot Encoding Type
Exit mobile version