yajiemiao / pdnn

PDNN: A Python Toolkit for Deep Learning. http://www.cs.cmu.edu/~ymiao/pdnntk.html
Apache License 2.0
224 stars 105 forks source link

parallel Conv net #2

Closed tofigh- closed 9 years ago

tofigh- commented 9 years ago

Hi Yajie, Is it possible to design a network with 4 parallel convolutional networks where the outputs of these four parallel network are connected to a fully connected layer? The 4 parallel networks are not connected (no share weights) and each of them have their own input (lets say 4 different images are the inputs to these networks)

ghost commented 9 years ago

We can achieve this by modifying models/cnn.py. For example, we have 2 convolutional networks whose layers are conv_layers_1 and conv_layers_2

The outputs from these two nets are concatenated by T.concatenate([conv_layers_1[-1].output, conv_layers_2[-1].output], axis=1) which will be inputs into the fully-connected layer

One way of organizing the inputs is to concatenate them together. Suppose the inputs to the 2 networks have d1 and d2 dimensions. Then we can separate the inputs by: self.input_1 = self.x[:,0:d1] self.input_2 = self.x[:,d1:(d1 + d2)]