Closed AStupidBear closed 8 years ago
You can easily reuse the same data layer as bottom for two different layers.
Simply put bottoms=[:data]
in the definitions of your d1 and d2 layers.
As introduction to layer construction, have a look at the MNIST example, (source).
Thanks for your response. However, in my problem d1 and d1 are different data layers using different data.
I see. The updated sketch explains your problem much better.
For final clarification: Do you want ip1
to be a bottom of ip2
? Or do you want ip1
and ip2
to share parameters?
@greenflash1357 ip1 is a bottom of ip2
@pluskid @greenflash1357 Could Mocha do this?
From what I know, Mocha can do this. Two notable things:
ip1
and output blob of d2
should share feature dimensions. If they do, ip2
can combine the two bottoms.Split Layer
, so that Mocha can handle the back propagation from l1
and l2
to ip1
.How can I deal with :data? I haven't seen an example that use :data2Sent from my Huawei Mobile
Depending on the source of your data, you can either create one data layer with two tops or vice versa.
If you have HDF5 files, the tops
of the data layer are the names of the HDF5 datasets as Symbol
s. If you have a MemoryDataLayer
the tops can be arbitrary symbols.
Please provide us with more detailed information if you have further questions.
@greenflash1357 Thank you. I'll try.
Try a Concat Layer to combine the output of ip1
and d2
.
Sorry, I missed Concat LayerSent from my Huawei Mobile
@greenflash1357 It finally works. Thank you!
Here is a toy model of my project. Since there's no such a kind of examples in Mocha, I don't know how to deal with the input data.![net](https://cloud.githubusercontent.com/assets/16422976/15714685/12ac586c-284e-11e6-9a15-2119c017d426.jpg)