![]() ![]() O = torch.mm(net.weight,x.t()) net.bias One is to verify the result of forward() function and clarify your understanding on how the network forward processing works. You can evaluate the network manually as shown below. Print('net.forward(x) :\n',net.forward(x)) You can evaluate the whole network using forward() function as shown below. Print('Activation function of network :\n',net) You can get access to the second component as follows. Linear(in_features=2, out_features=1, bias=True) => Network Structure of the first component : Print('Weight of network :\n',net.weight) Print('Network Structure of the first component :\n',net) You can get access to each of the component in the sequence using array index as shown below. (0): Linear(in_features=2, out_features=1, bias=True) You can print out overal network structure and Weight
0 Comments
Leave a Reply. |