private void InitializeCells(RecurentCellParameters[] cellsParameters, SigmoidActivation sigmoid, HyperbolicActivation tanh) { Cells = new List <LstmCell>(); for (var i = 0; i < cellsParameters.Length; i++) { Cells.Add(new LstmCell(cellsParameters[i].LengthOfInput, cellsParameters[i].LengthOfOutput, sigmoid, tanh)); } }
// нужно передать значение активации public LstmCell(int lengthOfInput, int lengthOfOutput, SigmoidActivation sigmoid, HyperbolicActivation tanh) { InitializeData(lengthOfInput, lengthOfOutput); Sigmoid = sigmoid; Tanh = tanh; }
public LstmLayer(RecurentCellParameters[] cellsParameters, SigmoidActivation sigmoid, HyperbolicActivation tanh) { InitializeCells(cellsParameters, sigmoid, tanh); Input = new Vector(cellsParameters.First().LengthOfInput); Output = new Vector(cellsParameters.Last().LengthOfOutput); Sigmoid = sigmoid; }