Implementing joint learning in keras
<p>i am trying to implement a model that is composed of two layers to segment object candidates in keras
So basically this model has the following architecture</p>

<p>Image(channel,width,height) -> multiple convolution and pooling layers- > output('n' feature maps , height width ) </p>

<p>Now this <strong><em>single output</em></strong> is being used by two layers
which are as follows
1) convolution (1*1) - > dense layer with m units (output = n * 1*1 )  - > pixel classifier using fully connected layers of h*w dimesion -> upsmapling to (H,N) - > output</p>

<p>2) convolution -> maxpooling->dense layer - > score</p>

<p>Cost function uses outputs of both these layers which is sum of binary logistic regression of each output</p>

<p>Now I have two questions
1) how to implement dense connection over  convoluted output in layer 1 to produce h*w pixel classifier as mentioned above
2) How to merge  the two layers to calculate the single cost function and then train both the layers jointly using back-propagation </p>

<p>Can anyone tell me how to create the model for above mentioned network architecture.i am new to deep learning so if there something which i misunderstood i ll appreciate if anyone can explain me the errors in my understanding
Thanks</p>