# How to create a task-graph based neural network?

I'm trying to design a neural network with a task hierarchy. This is my idea so far:

 [Desires]
|
[Layer 1] [T0]
|    /
[Layer 2] [T1]
|    /
[Layer 3] [T2]
|    /
[Layer 4] [T3]
|    /
[Action]


The way this would work is that each layer represents a task as a binary number. Layer 1 is the main task, layer 2 the sub-task etc. Each task consists of 2 sub-tasks determined by T={0,1}. In this way the neural network represents a binary task graph with T=0 being the left child and T=1 being the right child of a node.

You can think of it as T3 changing every second T2 changed every 2 seconds and so on. So {T0 T1 T2 T3} gives the binary time in seconds in a 16 second cycle.

So far this only makes the output a sequence of 16 actions in order. But if some of the layers could be "if" gates they might control the T-values and so act as switches and so have more complicated programs.

Do you have any suggestions to improve this? Or has this kind of binary task graph representation been done before in a neural network?

Also importantly how would you train such a neural network? (At the moment I just assume that the model is pre-trained and just trying to find a good architecture).