我正在从 Python 转换为 Java。
我的问题是'args'在做什么?
args = [this.scrath[c] for c in this.connections(n)]; //Python
是吗:
[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
在哪种情况下“this.scratch[c]”检查数据是否与“this.connections(n)”中的 c 匹配?
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);
}