Example #1
0
 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;
 }
Example #2
0
        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);
        }
Example #3
0
 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;
 }
Example #4
0
        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);
        }
Example #5
0
 /// <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);
 }