May 2020
Intermediate to advanced
530 pages
17h 8m
English
In this example, we chose the LeNet5 architecture, which was developed by Yann LeCun, Leon Bottou, Yosuha Bengio, and Patrick Haffner (http://yann.lecun.com/exdb/lenet/). The architecture's details were discussed earlier in the Convolution network architecture section. Here, we'll show you how to implement it with the PyTorch framework.
All the structural parts of the neural networks in the PyTorch framework should be derived from the torch::nn::Module class. The following snippet shows the header file of the LeNet5 class:
#include <torch/torch.h>class LeNet5Impl : public torch::nn::Module { public: LeNet5Impl(); torch::Tensor forward(torch::Tensor x); private: torch::nn::Sequential conv_; torch::nn::Sequential ...Read now
Unlock full access