def convnet_cost(W_fb, b_fb, V, c, W, b, x, y1): layer1 = tanh_conv_layer(W_fb, b_fb, x) layer1_size = np.prod(layer1.shape[1:]) layer2 = tanh_layer(V, c, np.reshape(layer1, (x.shape[0], layer1_size))) cost = ova_svm_cost(W, b, layer2, y1) return cost
def convnet_prediction(W_fb, b_fb, V, c, W, b, x): layer1 = tanh_conv_layer(W_fb, b_fb, x) layer1_size = np.prod(layer1.shape[1:]) layer2 = tanh_layer(V, c, np.reshape(layer1, (x.shape[0], layer1_size))) prediction = ova_svm_prediction(W, b, layer2) return prediction