In this section, we will learn how to build a network in Caffe2 using model_helper. (model_helper was introduced earlier in this chapter.) To maintain the simplicity of this example, we use mathematical operators that require no trained parameters. So, our network is a computation graph rather than a neural network because it has no trained parameters that were learned from training data. The network we will build is illustrated by the graph shown in Figure 2.5:
As you can see, we provide two inputs to the network: a matrix, A, and a vector, B. A MatMul operator is applied to A and B and its result is fed to a Sigmoid function, designated by σ in Figure 2.5. The result of the Sigmoid function is fed to a SoftMax function. (We will learn a bit more about the Sigmoid and SoftMax operators...