擅长:python、mysql、java
<p>为了回答您关于模型如何知道中间张量上调用的层的第一个问题,我认为看一下<code>help(keras.Input)</code>会很有帮助:</p>
<blockquote>
<p><code>Input()</code> is used to instantiate a Keras tensor.</p>
<p>A Keras tensor is a symbolic tensor-like object, which we augment with
certain attributes that allow us to build a Keras model just by
knowing the inputs and outputs of the model.</p>
</blockquote>
<p>因此,基本上,Keras使用Python在引擎盖下做一些魔术</p>
<p>每次在Keras张量上调用Keras层时,它都会输出一个Keras张量,该张量已根据层的功能进行了数学转换,但也会将有关该层的一些信息添加到此Keras张量中(在对象的Python属性中)</p>