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

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).

主站蜘蛛池模板: 江口县| 平顺县| 大埔县| 十堰市| 镇宁| 定结县| 富平县| 加查县| 卢湾区| 叙永县| 株洲市| 师宗县| 垣曲县| 仲巴县| 莎车县| 余江县| 雷波县| 麻城市| 临颍县| 刚察县| 巨野县| 平远县| 大同市| 揭西县| 张家界市| 岳阳县| 淮北市| 五家渠市| 泾源县| 东安县| 灌阳县| 云林县| 苍梧县| 高邑县| 桦甸市| 东港市| 贵州省| 朝阳县| 海宁市| 荣昌县| 留坝县|