Esempio n. 1
0
        public void CalculateRelu(ReluLayer layer)
        {
            var dims = ComputeBlocksTreads(layer.Outputs.Length);

            Gpu.Launch(dims.Item1, dims.Item2).CalculateReluGPU(
                layer.Inputs.GPUArray,
                layer.Outputs.GPUArray,
                layer.Outputs.Length
                );
        }
Esempio n. 2
0
        public void BackPropagateRelu(ReluLayer layer)
        {
            var dims = ComputeBlocksTreads(layer.Inputs.Length);

            Gpu.Launch(dims.Item1, dims.Item2).BackPropagateReluGPU(
                layer.Inputs.Length,
                layer.InputGradients.GPUArray,
                layer.Gradients.GPUArray,
                layer.Outputs.GPUArray
                );
        }
Esempio n. 3
0
        public ReluLayer AddReluLayer(string id = "")
        {
            var lastLayer = Layers.Last();

            if (lastLayer == null)
            {
                throw new Exception("There must be one or more layers in the network");
            }
            var reluLayer = new ReluLayer(_gpuModule, lastLayer, id: id);

            Layers.Add(reluLayer);
            return(reluLayer);
        }
Esempio n. 4
0
 public void BackPropagateRelu(ReluLayer layer)
 {
     var dims = ComputeBlocksTreads(layer.Inputs.Length);
     Gpu.Launch(dims.Item1, dims.Item2).BackPropagateReluGPU(
        layer.Inputs.Length,
        layer.InputGradients.GPUArray,
        layer.Gradients.GPUArray,
        layer.Outputs.GPUArray
     );
 }
Esempio n. 5
0
 public void CalculateRelu(ReluLayer layer)
 {
     var dims = ComputeBlocksTreads(layer.Outputs.Length);
     Gpu.Launch(dims.Item1, dims.Item2).CalculateReluGPU(
        layer.Inputs.GPUArray,
        layer.Outputs.GPUArray,
        layer.Outputs.Length
     );
 }
Esempio n. 6
0
 public ReluLayer AddReluLayer(string id = "")
 {
     var lastLayer = Layers.Last();
     if (lastLayer == null) throw new Exception("There must be one or more layers in the network");
     var reluLayer = new ReluLayer(_gpuModule, lastLayer, id: id );
     Layers.Add(reluLayer);
     return reluLayer;
 }