private HiddenLayer(Unit[][][] readDataToHiddenLayerWeights, Unit[][] inputToHiddenLayerWeights, Unit[] hiddenLayerThresholds, Unit[] hiddenLayer, int controllerSize, int inputSize, int headCount, int memoryUnitSizeM, IDifferentiableFunction activationFunction) { _readDataToHiddenLayerWeights = readDataToHiddenLayerWeights; _inputToHiddenLayerWeights = inputToHiddenLayerWeights; _hiddenLayerThresholds = hiddenLayerThresholds; HiddenLayerNeurons = hiddenLayer; _controllerSize = controllerSize; _inputSize = inputSize; _headCount = headCount; _memoryUnitSizeM = memoryUnitSizeM; _activationFunction = activationFunction; }
public HiddenLayer(int controllerSize, int inputSize, int headCount, int memoryUnitSizeM) { _controllerSize = controllerSize; _inputSize = inputSize; _headCount = headCount; _memoryUnitSizeM = memoryUnitSizeM; _activationFunction = new SigmoidActivationFunction(); _readDataToHiddenLayerWeights = UnitFactory.GetTensor3(controllerSize, headCount, memoryUnitSizeM); _inputToHiddenLayerWeights = UnitFactory.GetTensor2(controllerSize, inputSize); _hiddenLayerThresholds = UnitFactory.GetVector(controllerSize); }
/// <summary>Initializes a new <see cref="DifferentiableMDFunction"/> from a <see cref="IDifferentiableFunction"/>.</summary> public DifferentiableMDFunction(IDifferentiableFunction function) : base(function) { gradient = (x, output) => output[0] = function.EvaluateDerivative(x[0], 1); }