MCPcopy Create free account
hub / github.com/Apress/quantum-machine-learning-python / forward

Method forward

Chapter_6/listing6_1/QCNN.py:110–120  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

108 copies=copies)
109
110 def forward(self, x):
111 x = F.relu(self.conv1(x))
112 x = F.max_pool2d(x, 2)
113 x = F.relu(self.conv2(x))
114 x = F.max_pool2d(x, 2)
115 x = self.dropout(x)
116 x = x.view(1, -1)
117 x = F.relu(self.fc1(x))
118 x = self.fc2(x)
119 x = self.q_layer(x)
120 return torch.cat((x, 1 - x), -1)
121
122
123

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected