在python中,“args=[temp[n]for n In array(index)]”是否检查temp[n]?
回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我正在从Python转换成Java。你知道吗</p>
<p>我的问题是“args”在做什么?你知道吗</p>
<pre><code>args = [this.scrath[c] for c in this.connections(n)]; //Python
</code></pre>
<p>是不是:</p>
<pre><code>[this.scrath[c] //get data at index c of this.scratch[]
for c in // for number of c in connections
this.connections(n)]; //connections to ANN_Neuron n
</code></pre>
<p>在这种情况下这个。刮痕[c] “检查数据是否与中的c匹配”这个。连接(n) “?你知道吗</p>
<pre><code>this.scratch = Arrays.copyOfRange(inputValues, this.scratch.length-this.input_length, this.scratch.length+1); //JAVA
//inputValues given as negative values.
for (int i=0; i<this.scratch.length; i++){
this.scratch[i] = inputValues[i]*-1;
}
//loop through the active genes in order
for (ANN_Neuron n : nodes){
if (n.active){
float func = n.function;
for (ANN_Connection c : n.connections){
//Argument here!!
}
}
args = [this.scrath[c] for c in this.connections(n)]; //Python
//apply function to the inputs from scratch, save results in scratch
this.scratch[n] = function(*args);
}
</code></pre>