public Vector CalculateAndGetOutput(Vector input, LstmGatesForCell gatesForCell) { Input = input; InputConcatenated = Vector.Union(Input, OutputFromPreviousLayer); ForgetGateResultF = Sigmoid.Func(gatesForCell.ForgetLayer * InputConcatenated + gatesForCell.BiasForgetLayer); InputLayerGateResultI = Sigmoid.Func(gatesForCell.InputLayer * InputConcatenated + gatesForCell.BiasInputLayer); TanhLayerGateResultG = Tanh.Func(gatesForCell.TanhLayer * InputConcatenated + gatesForCell.BiasTanhLayer); OutputLayerGateResultO = Sigmoid.Func(gatesForCell.OutputLayer * InputConcatenated + gatesForCell.BiasOutputLayer); Forget = ForgetFromPreviousLayer * ForgetGateResultF + TanhLayerGateResultG * InputLayerGateResultI; Output = Tanh.Func(Forget) * OutputLayerGateResultO; return(Output); }