private LayerBase <T> LoadAffineActivationLayer(AffineActivation activation, BinaryReader reader) { switch (activation) { case AffineActivation.Sigmoid: return(new SigmoidLayer <T>(reader)); case AffineActivation.Tanh: return(new TanhLayer <T>(reader)); default: throw new ArgumentOutOfRangeException(nameof(activation), activation, null); } }
private LayerBase <T> GetAffineActivationLayer(AffineActivation activation, int ySize) { switch (activation) { case AffineActivation.Sigmoid: return(new SigmoidLayer <T>(ySize)); case AffineActivation.Tanh: return(new TanhLayer <T>(ySize)); default: throw new ArgumentOutOfRangeException(nameof(activation), activation, null); } }
public AffineLayer(AffineLayer <T> other) : base(other) { _activationType = other._activationType; _linearLayer = (LinearLayer <T>)other._linearLayer.Clone(); _activationLayer = other._activationLayer.Clone(); }
public AffineLayer(int xSize, int ySize, AffineActivation activation, IMatrixInitializer <T> matrixInitializer) { _activationType = activation; _linearLayer = new LinearLayer <T>(xSize, ySize, matrixInitializer); _activationLayer = GetAffineActivationLayer(activation, ySize); }
public AffineLayer(int xSize, int ySize, AffineActivation activation) { _activationType = activation; _linearLayer = new LinearLayer <T>(xSize, ySize); _activationLayer = GetAffineActivationLayer(activation, ySize); }