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); }
public Model(UnitSize unitSize, Bias bias, Weight weight) { this.unitSize = unitSize; this.bias = bias; this.weight = weight; }
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(); }
public Bias(UnitSize unitSize) { Hidden = new double[unitSize.Hidden]; Output = new double[unitSize.Output]; }