Hands-On Artificial Intelligence for Beginners
上QQ阅读APP看书,第一时间看更新

The PyTorch graph

PyTorch seems more Pythonic because of its dynamic graph compute structure. Since Python is an interpreted language, meaning that operations are executed at runtime, PyTorch's graphing feature seeks to replicate this by allowing us to alter variables in the graph at runtime. In simpler words, PyTorch's graphs are created at the time you actually execute the code, not defined statically beforehand like in TensorFlow. Architecturally, this means that you can actually change your network architecture during training, which means PyTorch can accommodate a lot more cutting edge, dynamic architectures.