Layers は Node のギザギザ配列で、各ノードは source[] と destination[] として、Theta の配列を表します。
問題は、4 行目のコードを変更すると、これらのオブジェクトをリンクした後でも 5 行目に「0」が表示されるのはなぜですか?
theta t = new theta();
layers[1][i].source[j] = t;
layers[0][j].destination[i] = t;
layers[0][j].destination[i].weight = 5;
Console.WriteLine(layers[1][i].source[j].weight);
struct theta
{
public double weight;
public theta(double _weight) { weight = _weight; }
}
class node
{
public theta[] source;
public theta[] destination;
public double activation;
public double delta;
public node() { }
public node(double x) { activation = x; }
}
レイヤーがどのように塗りつぶされるかのサンプル:
node n = new node();
n.destination = new theta[numberOfNodesPerHiddenLayer+1];
n.source = new theta[numberOfNodesPerHiddenLayer+1];
layers[i][j] = n;