Answers.Body: <p>The chain rule applies here as usual, and the term <em>symbolic gradient</em> is interesting.</p>
  
  <p>How such might apply will depend much on the nature of the policy layer representation and the connections of that layer or layers to other non-policy layers.</p>
  
  <ul>
  <li>A binary threshold layer may feed a logical inference layer.</li>
  <li>A sigmoid function might feed a fuzzy logic layer.</li>
  <li>The logical layer could be a production system adapted to look like a layer.</li>
  <li>The logical layer might be more like a PLD (programmable logic device).</li>
  <li>The output of the logical layer might be mapped one to one with a perceptron or an LSTM layer</li>
  </ul>
  
  <p>In the example in the question, we can't, from the information given in the question, assume that <em>discrete</em> means a discrete approximation of a curve, since the term used is <em>discrete/symbolic</em>. Since the nature of logic cannot be generalized in a differentiable closed form, it may be that it has to be probabilistically represented in closed form so a derivative may be obtained, if that is possible in the specific case under study.</p>
  
  <p>Back propagation is a feedback mechanism to provide corrective signaling to the portions of the system that must be corrected. The hope is that the direction of the correction during back propagation leads to convergence on the global minimum of loss without severe delay, which is not always easy to make happen, thus Gaussian noise injection explicitly or indirectly through mini-batching, momentum, multiple initialization states, parallel searches with different hyper-parameters, and other techniques.</p>
  
  <p>One technique used quite a bit in analog systems and entering use in digital systems in recent years is the idea of multiple corrective mechanisms. Control theory for instrumentation and countermeasure aeronautics is thick with this concept. For the case given in this question, it can look like this, with <span class="math-container">$f$</span> representing feed forward layer with some activation function, <span class="math-container">$\ell$</span> representing some logical inference container, <span class="math-container">$p$</span> is the parameter set for the function of the same subscript, <span class="math-container">$\epsilon$</span> is the evaluation function (error, loss, value, benefit), <span class="math-container">$b$</span> representing the corrective feedback using the back propagation, the Jacobian, and the chain rule.</p>
  
  <p><span class="math-container">$$ f_1 \quad \rightarrow \;\quad \ell \quad \rightarrow \quad\ f_2 \quad \rightarrow \quad\ \epsilon \\
   p_1 \leftarrow \, b \leftarrow \ell\, ; \quad\quad\quad \; p_2 \, \leftarrow b \leftarrow \epsilon  \\
  \quad\quad\quad\quad\quad \ell \quad\quad \leftarrow \quad\quad\quad\quad\quad \epsilon
   $$</span></p>
  
  <p>In the last line <span class="math-container">$\epsilon$</span> is simply a fact (piece of information) passed into the a rules engine session or a floating point representation of a feedback signal assigned as a probability to a rule in a fuzzy logical container. In the first half of the second line, the logical unit is responsible for providing the evaluation function output.</p>
  
  <p>In Norbert Wiener's <em>Cybernetics</em>, he states the following<sup>1</sup> with regard to automating the steering of ships via rudder control, from which cybernetics got its name.</p>
  
  <blockquote>
    <p>In the important book of MacColl<sup>2</sup>, we have an example of a complicated system which can be stabilized by two feedbacks but not by one.</p>
  </blockquote>
  
  <p>He then procures the differential equations and proves MacColl's conclusion. That conclusion is used in nearly every instrumentation amplifier circuit on a chip sold today, if not all of them. There is no way to get the desired stability without the multiple feedback paths.</p>
  
  <p>Similarly, it may not be possible to stabilize the convergence of <span class="math-container">$f_1, \ell, and f_2$</span> via a single mechanism of back-propagation using <span class="math-container">$\epsilon$</span> and the Jacobians to descend a gradient.</p>
  
  <hr>
  
  <p><strong>References</strong></p>
  
  <p>[1] Norbert Wiener's *Cybernetics, 1948, MIT, p 106 in the 1996 printing</p>
  
  <p>[2] LeRoy A. MacColl. Fundamental Theory of Servomechanisms. Van Nostrand, New York, 1945</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-29T15:41:08.930Z
Answers.LastActivityDate: 2019-01-29T15:41:08.930Z
Answers.UserDisplayName: Douglas Daseeco
Body: <p>I am doing neural machine translation task from language S to language T via interlingua L. So - there is the structure:</p>
  
  <pre><code>S -&gt;
  encoding of S (crisp) -&gt;
  S-L encoder -&gt; S-L decoder -&gt;
  encoding of L (non-crisp, coming from decoder) -&gt;
  L -&gt;
  encoding of L (crisp) -&gt;
  L-T encoder -&gt; L-T decoder -&gt;
  encoding of T (non-crisp, coming from decoder) -&gt;
  T
  </code></pre>
  
  <p>All of this can be implemented in Pytorch more or less adapting the usual encoder-decoder NMT. So, the layer of interlingua L acts as a somehow symbolic/discrete layer inside the whole S-L-T neural network. My question is - how such system can be trained in end-to-end (S-T) manner? The gradient propagates from the T to the L and at the L one should do some kind of <strong>symbolic gradient</strong>? I. e. one should be able do compute the difference L1-L2?</p>
  
  <p>I am somehow confused by such setting. My question is - is there similar networks which contain the symbolic representation as the intermediate layer and how one can train such system. I have heard about policy gradients but are they relevant to my setting?</p>
  
  <p>Essentially - if I denote some neural network by symbols x(Wi)y, then the training of this network means, that I change Wi and x stays intact. I.e. the last member of backpropagation equation has the form d.../dw1. But if I combine (<strong>chain!</strong>) 2 neural networks x(Wi)y-y(Wj)z, then the the last backpropagation term for the y(Wj)z has the form (d.../dw1+d.../dy) and hence both the w1 and y should be changed/updated by the gradient descent too. So, doesn't some ambiguity arise here? Is such chaining of neural networks possible? Is is possible to train end-to-end chains of neural networks?</p>
  
  <p>I am also thinking about use of evolutionary training.</p>
  
Tags: <neural-networks><training><gradient-descent><policy-gradients><machine-translation>
Title: Neural network with logical hidden layer - how to train it? Is it policy gradient problem? Chaining NNs?
UserDisplayName: TomR
ThreadText: # Neural network with logical hidden layer - how to train it? Is it policy gradient problem? Chaining NNs?
  
  (Asked by: username_0 on 2019-01-29)
  
  I am doing neural machine translation task from language S to language T via interlingua L. So - there is the structure:
  S ->
  encoding of S (crisp) ->
  S-L encoder -> S-L decoder ->
  encoding of L (non-crisp, coming from decoder) ->
  L ->
  encoding of L (crisp) ->
  L-T encoder -> L-T decoder ->
  encoding of T (non-crisp, coming from decoder) ->
  T
  
  All of this can be implemented in Pytorch more or less adapting the usual encoder-decoder NMT. So, the layer of interlingua L acts as a somehow symbolic/discrete layer inside the whole S-L-T neural network. My question is - how such system can be trained in end-to-end (S-T) manner? The gradient propagates from the T to the L and at the L one should do some kind of symbolic gradient? I. e. one should be able do compute the difference L1-L2?
  I am somehow confused by such setting. My question is - is there similar networks which contain the symbolic representation as the intermediate layer and how one can train such system. I have heard about policy gradients but are they relevant to my setting?
  Essentially - if I denote some neural network by symbols x(Wi)y, then the training of this network means, that I change Wi and x stays intact. I.e. the last member of backpropagation equation has the form d.../dw1. But if I combine (chain!) 2 neural networks x(Wi)y-y(Wj)z, then the the last backpropagation term for the y(Wj)z has the form (d.../dw1+d.../dy) and hence both the w1 and y should be changed/updated by the gradient descent too. So, doesn't some ambiguity arise here? Is such chaining of neural networks possible? Is is possible to train end-to-end chains of neural networks?
  I am also thinking about use of evolutionary training.
  
  **Tags:** neural-networks, training, gradient-descent, policy-gradients, machine-translation
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-29. Score: 1
  
  The chain rule applies here as usual, and the term *symbolic gradient* is interesting.
  
  How such might apply will depend much on the nature of the policy layer representation and the connections of that layer or layers to other non-policy layers.
  
  * A binary threshold layer may feed a logical inference layer.
  * A sigmoid function might feed a fuzzy logic layer.
  * The logical layer could be a production system adapted to look like a layer.
  * The logical layer might be more like a PLD (programmable logic device).
  * The output of the logical layer might be mapped one to one with a perceptron or an LSTM layer
  
  In the example in the question, we can't, from the information given in the question, assume that *discrete* means a discrete approximation of a curve, since the term used is *discrete/symbolic*. Since the nature of logic cannot be generalized in a differentiable closed form, it may be that it has to be probabilistically represented in closed form so a derivative may be obtained, if that is possible in the specific case under study.
  
  Back propagation is a feedback mechanism to provide corrective signaling to the portions of the system that must be corrected. The hope is that the direction of the correction during back propagation leads to convergence on the global minimum of loss without severe delay, which is not always easy to make happen, thus Gaussian noise injection explicitly or indirectly through mini-batching, momentum, multiple initialization states, parallel searches with different hyper-parameters, and other techniques.
  
  One technique used quite a bit in analog systems and entering use in digital systems in recent years is the idea of multiple corrective mechanisms. Control theory for instrumentation and countermeasure aeronautics is thick with this concept. For the case given in this question, it can look like this, with $f$ representing feed forward layer with some activation function, $\ell$ representing some logical inference container, $p$ is the parameter set for the function of the same subscript, $\epsilon$ is the evaluation function (error, loss, value, benefit), $b$ representing the corrective feedback using the back propagation, the Jacobian, and the chain rule.
  
  $$ f\_1 \quad \rightarrow \;\quad \ell \quad \rightarrow \quad\ f\_2 \quad \rightarrow \quad\ \epsilon \\
  p\_1 \leftarrow \, b \leftarrow \ell\, ; \quad\quad\quad \; p\_2 \, \leftarrow b \leftarrow \epsilon \\
  \quad\quad\quad\quad\quad \ell \quad\quad \leftarrow \quad\quad\quad\quad\quad \epsilon
  $$
  
  In the last line $\epsilon$ is simply a fact (piece of information) passed into the a rules engine session or a floating point representation of a feedback signal assigned as a probability to a rule in a fuzzy logical container. In the first half of the second line, the logical unit is responsible for providing the evaluation function output.
  
  In Norbert Wiener's *Cybernetics*, he states the following1 with regard to automating the steering of ships via rudder control, from which cybernetics got its name.
  
  > In the important book of MacColl2, we have an example of a complicated system which can be stabilized by two feedbacks but not by one.
  
  He then procures the differential equations and proves MacColl's conclusion. That conclusion is used in nearly every instrumentation amplifier circuit on a chip sold today, if not all of them. There is no way to get the desired stability without the multiple feedback paths.
  
  Similarly, it may not be possible to stabilize the convergence of $f\_1, \ell, and f\_2$ via a single mechanism of back-propagation using $\epsilon$ and the Jacobians to descend a gradient.
  
  ---
  
  **References**
  
  [1] Norbert Wiener's \*Cybernetics, 1948, MIT, p 106 in the 1996 printing
  
  [2] LeRoy A. MacColl. Fundamental Theory of Servomechanisms. Van Nostrand, New York, 1945
  
  
  ---
  
  