官术网_书友最值得收藏!

Introduction to PyTorch

At the time of writing this book, PyTorch is the third most popular overall deep learning framework. Its popularity has been increasing in spite of being relatively new in the world compared to TensorFlow. One of the interesting things about PyTorch is that it allows some customizations that TensorFlow does not. Furthermore, PyTorch has the support of Facebook?. 

Although this book covers TensorFlow and Keras, I think it is important for all of us to remember that PyTorch is a good alternative and it looks very similar to Keras. As a mere reference, here is how the exact same shallow neural network we showed earlier would look if coded in PyTorch:

import torch

device = torch.device('cpu')

model = torch.nn.Sequential(
torch.nn.Linear(10, 10),
torch.nn.ReLU(),
torch.nn.Linear(10, 8),
torch.nn.ReLU(),
torch.nn.Linear(8, 2),
torch.nn.Softmax(2)
).to(device)

The similarities are many. Also, the transition from Keras to PyTorch should not be too difficult for the motivated reader, and it could be a nice skill to have in the future. However, for now, most of the interest of the community is on TensorFlow and all its derivatives, especially Keras. If you want to know more about the beginnings and basic principles of PyTorch, you might find this reading useful (Paszke, A., et.al., 2017).

主站蜘蛛池模板: 宿迁市| 洪洞县| 靖边县| 仁寿县| 兰州市| 察隅县| 连平县| 衡阳县| 双鸭山市| 文水县| 安宁市| 栖霞市| 邯郸县| 涟水县| 左云县| 永兴县| 商都县| 齐河县| 德惠市| 金阳县| 溧阳市| 旬阳县| 怀柔区| 电白县| 吉隆县| 富源县| 博乐市| 金湖县| 固镇县| 镇平县| 洛阳市| 美姑县| 玉林市| 伊宁市| 达日县| 东丽区| 若羌县| 通江县| 漾濞| 阿克| 荣昌县|