init_W=init_W, init_b=init_b) c2 = ConvertLayer(name='c2', parent=['h3'], outshape=(batch_size, 128)) # Global average pooling missing h4 = FullyConnectedLayer(name='h4', parent=['c2'], nout=10, unit='softmax', init_W=init_W, init_b=init_b) cost = MulCrossEntropyLayer(name='cost', parent=['y', 'h4']) # You will fill in a list of nodes and fed them to the model constructor nodes = [c1, c2, h1, h2, h3, h4, cost] # Your model will build the Theano computational graph cnn = Net(inputs=inputs, inputs_dim=inputs_dim, nodes=nodes) cnn.build_graph() # You can access any output of a node by doing model.nodes[$node_name].out cost = cnn.nodes['cost'].out err = error(predict(cnn.nodes['h4'].out), predict(y)) cost.name = 'cost' err.name = 'error_rate' model.graphs = [cnn]
outshape=(batch_size, 128, 1, 1), unit='relu', init_W=init_W, init_b=init_b) c2 = ConvertLayer(name='c2', parent=['h3'], outshape=(batch_size, 128)) # Global average pooling missing h4 = FullyConnectedLayer(name='h4', parent=['c2'], nout=10, unit='softmax', init_W=init_W, init_b=init_b) cost = MulCrossEntropyLayer(name='cost', parent=['y', 'h4']) # You will fill in a list of nodes and fed them to the model constructor nodes = [c1, c2, h1, h2, h3, h4, cost] # Your model will build the Theano computational graph cnn = Net(inputs=inputs, inputs_dim=inputs_dim, nodes=nodes) cnn.build_graph() # You can access any output of a node by doing model.nodes[$node_name].out cost = cnn.nodes['cost'].out err = error(predict(cnn.nodes['h4'].out), predict(y)) cost.name = 'cost' err.name = 'error_rate' model.graphs = [cnn]