public void CalculateTanh(TanhLayer layer) { var dims = ComputeBlocksTreads(layer.Outputs.Length); Gpu.Launch(dims.Item1, dims.Item2).CalculateTanhGPU( layer.Inputs.GPUArray, layer.Outputs.GPUArray, layer.Outputs.Length ); }
public void BackPropagateTanh(TanhLayer layer) { var dims = ComputeBlocksTreads(layer.Inputs.Length); Gpu.Launch(dims.Item1, dims.Item2).BackPropagateTanhGPU( layer.Inputs.Length, layer.InputGradients.GPUArray, layer.Gradients.GPUArray, layer.Outputs.GPUArray ); }
public TanhLayer AddTanhLayer(string id = "") { var lastLayer = Layers.Last(); if (lastLayer == null) { throw new Exception("There must be one or more layers in the network"); } var tanhLayer = new TanhLayer(_gpuModule, lastLayer, id: id); Layers.Add(tanhLayer); return(tanhLayer); }
public TanhLayer AddTanhLayer(string id = "") { var lastLayer = Layers.Last(); if (lastLayer == null) throw new Exception("There must be one or more layers in the network"); var tanhLayer = new TanhLayer(_gpuModule, lastLayer, id: id); Layers.Add(tanhLayer); return tanhLayer; }