question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple network outputs

See original GitHub issue

Is there any way to handle multiple output layers? I’d like to train a network where the first classification result is feed back into the network, e.g.:

example_layer = lasagne.layers.InputLayer(inputs_layer, **params)

...

classification_output = lasagne.layers.DenseLayer(example_layer, nonlinearity=lasagne.nonlinearities.softmax, **params2)

...

another_output_layer = lasagne.layers.DenseLayer(classification_output, nonlinearity=lasagne.nonlinearities.softmax, **params3)

return classification_output, another_output_layer

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
DanChianuccicommented, Jul 21, 2016

I have a similar issue, which doesn’t work even if I write my own objective. I have a network which splits into two branches. One branch outputs an image patch (NxCHxHxW), and the other outputs a class (NxCLS) , similar to the network shown below.

   A
   B
 /  \
C    E
D    F

Since the NeuralNet takes a single Layer instance for its layers parameter, one of the branches is completely ignored. For example, if I instantiate the NeuralNet with F as the layers param, then C and D are not placed into the layers_ dictionary. Consequently, I can’t reference C or D from my objective function.

I have fixed this by slightly modifying the initialize_layers method, so that it loops over all Layer instances contained within self.layers, rather than only self.layers[0]. I can submit a pull request if this is of interest.

0reactions
dnouricommented, Aug 28, 2016

Feature implemented in #278 and merged. Continuing in #284: Network.predict works with multi-outputs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a multi-output Convolutional Neural Network with Keras
In this post, we will be exploring the Keras functional API in order to build a multi-output Deep Learning model. We will show...
Read more >
Multiple-Input and Multiple-Output Networks - MathWorks
Define networks with multiple inputs when the network requires data from multiple sources or in different formats. For example, networks that require image...
Read more >
Multiple Inputs & Multiple Outputs in a Neural Network - Medium
In this post, we will see how to apply Backpropagaton to train the Neural Network which has Multiple Inputs and Multiple Outputs.
Read more >
machine learning - One Neural network with multiple outputs ...
Still, it has been shown empirically in research that a neural network may benefit from having multiple outputs.
Read more >
Learn about Multiple-Input Multiple-Output - Intel
Multiple -Input Multiple-Output (MIMO) is a wireless technology that uses multiple transmitters and receivers to transfer more data at the same time.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found