示例#1
0
 public TwoLayerNet(UnitSize unitSize)
 {
     this.unitSize = unitSize;
     weight        = new Weight(unitSize);
     bias          = new Bias(unitSize);
     Initialize();
     Layers    = new Layer[3];
     Layers[0] = new AffineLayer(weight.InToHidden, bias.Hidden);
     Layers[1] = new ReluLayer();
     Layers[2] = new AffineLayer(weight.HiddenToOut, bias.Output);
 }
示例#2
0
 public Model(UnitSize unitSize, Bias bias, Weight weight)
 {
     this.unitSize = unitSize;
     this.bias     = bias;
     this.weight   = weight;
 }
示例#3
0
 public Weight(UnitSize unitSize)
 {
     InToHidden  = new double[unitSize.Input][].Select(x => new double[unitSize.Hidden]).ToArray();
     HiddenToOut = new double[unitSize.Hidden][].Select(x => new double[unitSize.Output]).ToArray();
 }
示例#4
0
 public Bias(UnitSize unitSize)
 {
     Hidden = new double[unitSize.Hidden];
     Output = new double[unitSize.Output];
 }